82 Комити efc1859eec ... 481753d31f

Аутор SHA1 Порука Датум
  吴树波 481753d31f Merge remote-tracking branch 'origin/ScrmStore' into ScrmStore пре 1 недеља
  吴树波 3ed82b76c8 新增,批量删除SOP 的执行任务并添加权限 qw:sopLogs:removeAll пре 1 недеља
  caoliqin ad2ba0942c feat:将企微员工绑定医生功能移动到员工管理 пре 1 недеља
  jzp 459f6e99d0 1.提交舌诊界面 пре 1 недеља
  yfh 4a0223bfc2 Merge remote-tracking branch 'origin/master' пре 1 недеља
  yfh a31121f7d6 增加配置 пре 1 недеља
  三七 15aff0c61e 销售账号导入 пре 1 недеља
  caoliqin c499b5f902 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 1 недеља
  caoliqin c7c2b30ec4 feat:任务模板删除提示文字修改 пре 1 недеља
  yjwang 5429377400 Merge remote-tracking branch 'origin/master' пре 1 недеља
  yjwang d83217ce4c 济南联志健康配置提交 пре 1 недеља
  三七 e4331662b2 所属销售 查询 пре 1 недеља
  三七 1c6ccaad7b 所属销售 查询 пре 1 недеља
  sgw d6f2f3d8c7 一键群发的权限 细分 пре 1 недеља
  三七 3f96bf12a3 所属销售 查询 пре 1 недеља
  三七 8a22a8ca0a 将润天的 sop营期 相关的功能迁移到 his_scrm (我的sop/部门sop只能看见 相应的 我创建的模板/部门创建的模板) пре 1 недеља
  wjj a0fefd58a0 员工绑定医生 пре 1 недеља
  caoliqin 7eb307ce77 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 2 недеља
  caoliqin 147a0b297d feat:看课记录添加sop搜索 пре 2 недеља
  三七 60b7f0e95a 益寿源-其他地方生成注册/绑定销售二维码 пре 2 недеља
  xdd b52917f541 feat: 筛选范围 пре 2 недеља
  wjj f1be8d67e1 用户初诊单 пре 2 недеља
  caoliqin 6e6f5b9c7b Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 2 недеља
  caoliqin 5d70747371 fix:修复企微客户导出为空问题 пре 2 недеља
  jzp 61ac77d9a5 1.提交ai对话配套的代码 пре 2 недеља
  ct 61ae391120 会员看课统计添加上线数 пре 2 недеља
  ct 22ca3ca3a0 课程管理 пре 2 недеља
  三七 b9e223bab2 益寿源-自定义小程序 пре 3 недеља
  Long 0e2449ba24 新增多小程序配置 пре 3 недеља
  ct 11160ca7f2 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 3 недеља
  ct 7a5b1522c7 hyt配置及看课同步 пре 3 недеља
  吴树波 c1549ba1dc Merge remote-tracking branch 'origin/master' пре 3 недеља
  吴树波 84c0808c46 迁移手动发课营期 пре 3 недеља
  ct 4832105c19 同步润天 每日完播,进线客户统计 пре 3 недеља
  wjj 70ac63aaed 1.SOP任务一键群发2.新增模板催课次数可以为0 пре 3 недеља
  yfh 0123380c22 中康配置信息调整 пре 3 недеља
  yfh 83770e4e7d 调整商城订单销售端制单问题 пре 1 месец
  chenguo b1879889a4 商城迁移销售端代码 пре 1 месец
  Long b9a6be365c 红德堂-配置修改 пре 3 недеља
  三七 fd8ef7c4c0 courseTypeList: ['1','3', '4', '9'], + 1 пре 1 месец
  三七 b5b9e7de4e courseTypeList: ["1",'3', '4', '9'], + 1 пре 1 месец
  ct 362fc99a69 宏医堂 пре 1 месец
  yjwang 23dc0c24ce Merge remote-tracking branch 'origin/master' пре 1 месец
  yfh e3da0eb1e2 二维码展示问题 пре 1 месец
  jzp 3f21a67d0f 1.提交看课记录是否会员筛选项 пре 1 месец
  wjj 669aa478aa 企微用户删除流失统计导出 пре 1 месец
  wjj e58fc2891d IM批量发送新增项目ID пре 1 месец
  wjj f3b3a51d27 企微客户删除流失统计 пре 1 месец
  三七 d72b27266e 修改模板传参 пре 1 месец
  yfh 50e29b7597 1、企微客户批量修改备注功能迁移 пре 1 месец
  三七 095042af16 hcl.png пре 1 месец
  三七 9689254c13 Merge remote-tracking branch 'origin/master' пре 1 месец
  三七 e3ac6e775a #默认 1、会员 2、企微 пре 1 месец
  wjj 8c66f068dc change пре 1 месец
  wjj 6f455ffe51 优化IM批量发送 пре 1 месец
  zyp 1de393f239 zyp пре 1 месец
  yfh 71272240b0 项目会员列表两个修改问题处理 пре 1 месец
  yfh f6912e11ff 调整员工新增问题 пре 1 месец
  yjwang 4885fb4407 Merge remote-tracking branch 'origin/master' пре 1 месец
  三七 2fd5444d76 Merge remote-tracking branch 'origin/master' пре 1 месец
  三七 1802b4d81a 群聊注释 пре 1 месец
  吴树波 b4618fee6d Merge remote-tracking branch 'origin/master' пре 1 месец
  吴树波 5e93a37d58 迁移手动发课营期 пре 1 месец
  三七 941acc1f38 销售的充值 пре 1 месец
  wjj 6d64ba82ad 修改IM批量发送消息返回结果业务 пре 1 месец
  wjj 605534a7ee change пре 1 месец
  wjj e5a2cabf19 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 1 месец
  三七 9f38abcd19 IM消息批量发送 пре 1 месец
  三七 faa1ba7187 宽益堂 пре 1 месец
  三七 23e5046d27 宽益堂 пре 1 месец
  ct cca1f456d3 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 1 месец
  ct 0703d6498d add:优惠券相关模块 пре 1 месец
  三七 9bdde323a3 益寿缘 пре 1 месец
  三七 6791119430 益寿缘 пре 1 месец
  ct 9fb87403ac Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_companyUI пре 1 месец
  ct 97dd8eee4a 上传套餐包封面图处理 пре 1 месец
  yfh e1644b25cd 在职转接,离职继承问题处理 пре 1 месец
  yfh ae737291a4 在职转接,离职继承问题处理 пре 1 месец
  yfh f6b75ebe3a 迁移协助客户功能菜单 пре 1 месец
  wjj 15dd1f01dd 好友欢迎语-->新增企微账号搜索 пре 1 месец
  Long 85692c853c 中康配置 пре 1 месец
  yjwang 31b414264f 新增云联测试配置 пре 1 месец
100 измењених фајлова са 13508 додато и 1093 уклоњено
  1. 2 2
      .env.prod-bjyjb
  2. 1 1
      .env.prod-hdt
  3. 22 0
      .env.prod-hyt
  4. 23 0
      .env.prod-jnlzjk
  5. 1 1
      .env.prod-jnmy
  6. 3 3
      .env.prod-kyt
  7. 22 0
      .env.prod-nmgyt
  8. 22 0
      .env.prod-syysy
  9. 19 0
      .env.prod-ylrz
  10. 22 0
      .env.prod-zkzh
  11. 7 1
      package.json
  12. 27 0
      src/api/company/companyUser.js
  13. 27 0
      src/api/company/firstDiagnosis.js
  14. 47 0
      src/api/course/coursePlaySourceConfig.js
  15. 62 0
      src/api/crm/assist.js
  16. 7 0
      src/api/crm/customer.js
  17. 9 0
      src/api/crm/customerLevel.js
  18. 9 0
      src/api/doctor/doctor.js
  19. 62 0
      src/api/fastGpt/fastGptKeywordSend.js
  20. 70 0
      src/api/fastGpt/fastgptEventLogTotal.js
  21. 28 0
      src/api/qw/externalContact.js
  22. 17 0
      src/api/qw/sop.js
  23. 9 0
      src/api/qw/sopUserLogsInfo.js
  24. 7 0
      src/api/qw/user.js
  25. 59 0
      src/api/store/coupon.js
  26. 143 0
      src/api/store/doctor.js
  27. 71 0
      src/api/store/healthTongue.js
  28. 72 0
      src/api/store/storeOrderOffline.js
  29. 66 0
      src/api/store/userCoupon copy.js
  30. 9 0
      src/api/user/fsUser.js
  31. 6 6
      src/api/users/user.js
  32. BIN
      src/assets/logo/hcl.png
  33. BIN
      src/assets/logo/hyt.png
  34. BIN
      src/assets/logo/jnlzjk.png
  35. BIN
      src/assets/logo/kyt.jpg
  36. BIN
      src/assets/logo/nmgyt.jpg
  37. BIN
      src/assets/logo/syysy.png
  38. BIN
      src/assets/logo/zkzh_logo.png
  39. 1031 0
      src/components/course/userCoursePeriod.vue
  40. 11 9
      src/views/company/companyDept/index.vue
  41. 1 0
      src/views/company/companyRecharge/index.vue
  42. 414 46
      src/views/company/companyUser/index.vue
  43. 93 0
      src/views/components/healthTongueDetails.vue
  44. 426 0
      src/views/course/coursePlaySourceConfig/index.vue
  45. 4 0
      src/views/course/courseUserStatistics/index.vue
  46. 531 151
      src/views/course/courseUserStatistics/qw/index.vue
  47. 4 0
      src/views/course/courseUserStatistics/qw/statistics.vue
  48. 4 0
      src/views/course/courseUserStatistics/statistics.vue
  49. 3 3
      src/views/course/courseWatchLog/deptWatchLog.vue
  50. 177 8
      src/views/course/courseWatchLog/index.vue
  51. 4 4
      src/views/course/courseWatchLog/statistics.vue
  52. 154 39
      src/views/course/courseWatchLog/watchLog.vue
  53. 662 0
      src/views/crm/components/assistUser.vue
  54. 817 0
      src/views/crm/customer/assist.vue
  55. 113 0
      src/views/fastGpt/fastGptKeywordSend/fastGptKeyWordDetails.vue
  56. 532 0
      src/views/fastGpt/fastGptKeywordSend/index.vue
  57. 333 0
      src/views/fastGpt/fastgptEventLogTotal/index.vue
  58. 1 1
      src/views/hisStore/components/addOrder.vue
  59. 3 3
      src/views/hisStore/storeOrder/list.vue
  60. 0 8
      src/views/member/list.vue
  61. 35 1
      src/views/member/mylist.vue
  62. 389 364
      src/views/qw/QwWorkTask/qw/index.vue
  63. 24 9
      src/views/qw/externalContact/deptIndex.vue
  64. 142 3
      src/views/qw/externalContact/index.vue
  65. 277 3
      src/views/qw/externalContact/myExternalContact.vue
  66. 5 1
      src/views/qw/externalContactTransfer/index.vue
  67. 6 2
      src/views/qw/externalContactUnassigned/index.vue
  68. 2 2
      src/views/qw/friendWelcome/indexNew.vue
  69. 164 0
      src/views/qw/qwUserDelLossStatistics/index.vue
  70. 148 133
      src/views/qw/qwUserVoiceLogTotal/index.vue
  71. 5 5
      src/views/qw/sop/addSop.vue
  72. 3 1
      src/views/qw/sop/deptSop.vue
  73. 3 1
      src/views/qw/sop/mySop.vue
  74. 56 5
      src/views/qw/sop/sop.vue
  75. 1 2
      src/views/qw/sop/updateSop.vue
  76. 3 1
      src/views/qw/sopLogs/sopLogsList.vue
  77. 15 9
      src/views/qw/sopTemp/addSopTemp.vue
  78. 4 15
      src/views/qw/sopTemp/index.vue
  79. 18 37
      src/views/qw/sopTemp/updateSopTemp.vue
  80. 1 0
      src/views/qw/sopTemp/updateSopTemp2.vue
  81. 148 102
      src/views/qw/sopUserLogs/sopUserLogsSchedule.vue
  82. 583 0
      src/views/qw/sopUserLogs/sopUserLogsScheduleOld.vue
  83. 14 9
      src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue
  84. 751 0
      src/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue
  85. 139 62
      src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue
  86. 1400 0
      src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetailsOld.vue
  87. 10 0
      src/views/qw/user/cuDeptIdIndex.vue
  88. 24 2
      src/views/qw/user/index.vue
  89. 152 0
      src/views/qw/user/selectDoctor.vue
  90. 6 1
      src/views/statistics/section/channel.vue
  91. 6 1
      src/views/statistics/section/index.vue
  92. 5 1
      src/views/statistics/section/inline.vue
  93. 7 3
      src/views/statistics/section/today.vue
  94. 735 0
      src/views/store/components/addOrder.vue
  95. 313 0
      src/views/store/components/addOrderOffline.vue
  96. 152 0
      src/views/store/components/couponDetails.vue
  97. 568 0
      src/views/store/coupon/index.vue
  98. 459 0
      src/views/store/healthTongue/index.vue
  99. 428 0
      src/views/store/myHealthTongue/index.vue
  100. 38 32
      src/views/store/package/index.vue

+ 2 - 2
.env.prod-bjyjb

@@ -3,9 +3,9 @@ VUE_APP_TITLE =医健宝SCRM销售端
 # 公司名称
 VUE_APP_COMPANY_NAME = 医健宝智慧(北京)医药科技有限公司
 # ICP备案号
-VUE_APP_ICP_RECORD =
+VUE_APP_ICP_RECORD =京ICP备2025133930号-2
 # ICP网站访问地址
-VUE_APP_ICP_URL =
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
 # 网站LOG
 VUE_APP_LOG_URL =@/assets/logo/bjyjb.jpg
 

+ 1 - 1
.env.prod-hdt

@@ -16,7 +16,7 @@ ENV = 'production'
 VUE_APP_BASE_API = '/prod-api'
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 2
+VUE_APP_COURSE_DEFAULT = 1
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 22 - 0
.env.prod-hyt

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE =宏医堂SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =易行健和泰(湖北)健康咨询有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =鄂ICP备2025116549号-1
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/hyt.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 23 - 0
.env.prod-jnlzjk

@@ -0,0 +1,23 @@
+# 页面标题
+VUE_APP_TITLE =联志健康SCRM销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =济南联志健康
+# ICP备案号
+VUE_APP_ICP_RECORD =渝ICP备2024031984号-2
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/jnlzjk.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 1 - 1
.env.prod-jnmy

@@ -16,7 +16,7 @@ ENV = 'production'
 VUE_APP_BASE_API = '/prod-api'
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 1
+VUE_APP_COURSE_DEFAULT = 2
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 3 - 3
.env.prod-kyt

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE =互联网医院管理系统
+VUE_APP_TITLE =宽益堂SCRM销售端
 # 公司名称
 VUE_APP_COMPANY_NAME =云联融智互联网医院有限公司
 # ICP备案号
@@ -7,7 +7,7 @@ VUE_APP_ICP_RECORD =渝ICP备2024031984号-1
 # ICP网站访问地址
 VUE_APP_ICP_URL =https://beian.miit.gov.cn
 # 网站LOG
-VUE_APP_LOG_URL =@/assets/logo/ylrz.png
+VUE_APP_LOG_URL =@/assets/logo/kyt.jpg
 
 # 生产环境配置
 ENV = 'production'
@@ -16,7 +16,7 @@ ENV = 'production'
 VUE_APP_BASE_API = '/prod-api'
 
 #默认 1、会员 2、企微
-VUE_APP_COURSE_DEFAULT = 1
+VUE_APP_COURSE_DEFAULT = 2
 
 # 路由懒加载
 VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 22 - 0
.env.prod-nmgyt

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE =内蒙古一贴医药
+# 公司名称
+VUE_APP_COMPANY_NAME =内蒙古好药师蒙一堂大药房有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =蒙ICP备2023002294号
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/nmgyt.jpg
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 2
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 22 - 0
.env.prod-syysy

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE =互联网医院管理系统
+# 公司名称
+VUE_APP_COMPANY_NAME =沈阳铁西益寿缘中医院有限责任公司
+# ICP备案号
+VUE_APP_ICP_RECORD = 辽ICP备2024035076号-17
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/syysy.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 19 - 0
.env.prod-ylrz

@@ -0,0 +1,19 @@
+# 页面标题
+VUE_APP_TITLE =云联融智销售端
+# 公司名称
+VUE_APP_COMPANY_NAME =云联融智医药有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD =
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/ylrz.png
+
+# 生产环境配置
+ENV = 'production'
+
+# FS管理系统/开发环境
+VUE_APP_BASE_API = '/prod-api'
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true

+ 22 - 0
.env.prod-zkzh

@@ -0,0 +1,22 @@
+# 页面标题
+VUE_APP_TITLE = 中康SCRM管理系统
+# 公司名称
+VUE_APP_COMPANY_NAME = 陕西中康智慧药房有限公司
+# ICP备案号
+VUE_APP_ICP_RECORD = 陕ICP备2024048690号-2
+# ICP网站访问地址
+VUE_APP_ICP_URL =https://beian.miit.gov.cn
+# 网站LOG
+VUE_APP_LOG_URL =@/assets/logo/zkzh_logo.png
+
+# 生产环境配置
+ENV = 'production'
+
+#FS管理系统/生产环境
+VUE_APP_BASE_API = '/prod-api'
+
+# 路由懒加载
+VUE_CLI_BABEL_TRANSPILE_MODULES = true
+
+#默认 1、会员 2、企微
+VUE_APP_COURSE_DEFAULT = 1

+ 7 - 1
package.json

@@ -7,6 +7,7 @@
   "scripts": {
     "dev": "vue-cli-service serve",
     "build:prod": "vue-cli-service build",
+    "build:prod-ylrz": "vue-cli-service build --mode prod-ylrz",
     "build:stage": "vue-cli-service build --mode staging",
     "build:prod-jz": "vue-cli-service build --mode prod-jz",
     "build:prod-hzyy": "vue-cli-service build --mode prod-hzyy",
@@ -19,20 +20,25 @@
     "build:prod-yzt": "vue-cli-service build --mode prod-yzt",
     "build:prod-xfk": "vue-cli-service build --mode prod-xfk",
     "build:prod-myhk": "vue-cli-service build --mode prod-myhk",
+    "build:prod-fzbt": "vue-cli-service build --mode prod-fzbt",
     "build:prod-sft": "vue-cli-service build --mode prod-sft",
-    "build:prod-fcky": "vue-cli-service build --mode prod-fcky",
     "build:prod-zsjk": "vue-cli-service build --mode prod-zsjk",
     "build:prod-lmjy": "vue-cli-service build --mode prod-lmjy",
     "build:prod-bnkc": "vue-cli-service build --mode prod-bnkc",
     "build:prod-whhm": "vue-cli-service build --mode prod-whhm",
     "build:prod-drk": "vue-cli-service build --mode prod-drk",
+    "build:prod-zkzh": "vue-cli-service build --mode prod-zkzh",
+    "build:prod-nmgyt": "vue-cli-service build --mode prod-nmgyt",
     "build:prod-qdtst": "vue-cli-service build --mode prod-qdtst",
     "build:prod-bjczwh": "vue-cli-service build --mode prod-bjczwh",
+    "build:prod-jnlzjk": "vue-cli-service build --mode prod-jnlzjk",
     "build:prod-jkj": "vue-cli-service build --mode prod-jkj",
     "build:prod-cqxzt": "vue-cli-service build --mode prod-cqxzt",
     "build:prod-bjyjb": "vue-cli-service build --mode prod-bjyjb",
     "build:prod-kyt": "vue-cli-service build --mode prod-kyt",
     "build:prod-fby": "vue-cli-service build --mode prod-fby",
+    "build:prod-syysy": "vue-cli-service build --mode prod-syysy",
+    "build:prod-hyt": "vue-cli-service build --mode prod-hyt",
     "preview": "node build/index.js --preview",
     "lint": "eslint --ext .js,.vue src",
     "test:unit": "jest --clearCache && vue-cli-service test:unit",

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

@@ -87,6 +87,16 @@ export function addUser(data) {
   })
 }
 
+//创建二维码
+export function addCodeUrl(data) {
+  return request({
+    url: '/company/user/addCodeUrl',
+    method: 'post',
+    data: data
+  })
+}
+
+
 // 修改用户
 export function updateUser(data) {
   return request({
@@ -271,3 +281,20 @@ export function isAllowedAllRegister(status, data) {
     data: data
   })
 }
+
+// 绑定医生
+export function bindDoctorId(data) {
+  return request({
+    url: '/company/user/bindDoctorId',
+    method: 'post',
+    data: data
+  })
+}
+
+//解绑医生
+export function unBindDoctorId(userId) {
+  return request({
+    url: '/company/user/unBindDoctorId/'+userId,
+    method: 'get'
+  })
+}

+ 27 - 0
src/api/company/firstDiagnosis.js

@@ -0,0 +1,27 @@
+import request from '@/utils/request'
+
+// 新增初诊单
+export function addFsFirstDiagnosis(data) {
+  return request({
+    url: '/his/diagnosis',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改初诊单
+export function updateFsFirstDiagnosis(data) {
+  return request({
+    url: '/his/diagnosis',
+    method: 'put',
+    data: data
+  })
+}
+
+// 查询初诊单详细
+export function getFsFirstDiagnosis(userId) {
+  return request({
+    url: '/his/diagnosis/' + userId,
+    method: 'get'
+  })
+}

+ 47 - 0
src/api/course/coursePlaySourceConfig.js

@@ -0,0 +1,47 @@
+import request from '@/utils/request'
+
+export function list(query) {
+  return request({
+    url: '/course/playSourceConfig/list',
+    method: 'get',
+    params: query
+  })
+}
+
+export function get(id) {
+  return request({
+    url: '/course/playSourceConfig/' + id,
+    method: 'get'
+  })
+}
+
+export function add(data) {
+  return request({
+    url: '/course/playSourceConfig',
+    method: 'post',
+    data: data
+  })
+}
+
+export function update(data) {
+  return request({
+    url: '/course/playSourceConfig',
+    method: 'put',
+    data: data
+  })
+}
+
+export function del(id) {
+  return request({
+    url: '/course/playSourceConfig/' + id,
+    method: 'delete'
+  })
+}
+
+export function updateIsTownOn(query) {
+  return request({
+    url: '/course/playSourceConfig/updateIsTownOn',
+    method: 'get',
+    params: query
+  })
+}

+ 62 - 0
src/api/crm/assist.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询客户员工协作列表
+export function listAssist(query) {
+  return request({
+    url: '/crm/assist/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询客户员工协作详细
+export function getAssist(id) {
+  return request({
+    url: '/crm/assist/' + id,
+    method: 'get'
+  })
+}
+
+// 新增客户员工协作
+export function addAssist(data) {
+  return request({
+    url: '/crm/assist',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改客户员工协作
+export function updateAssist(data) {
+  return request({
+    url: '/crm/assist',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除客户员工协作
+export function delAssist(id) {
+  return request({
+    url: '/crm/assist/' + id,
+    method: 'delete'
+  })
+}
+
+// 删除客户员工协作
+export function remove(data) {
+  return request({
+    url: '/crm/assist/remove',
+    method: 'post',
+    data: data
+  })
+}
+
+// 导出客户员工协作
+export function exportAssist(query) {
+  return request({
+    url: '/crm/assist/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -189,3 +189,10 @@ export function updateCustomerSource(data) {
     data: data
   })
 }
+export function getMyAssistList(query) {
+  return request({
+    url: '/crm/customer/getMyAssistList',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
src/api/crm/customerLevel.js

@@ -0,0 +1,9 @@
+import request from "@/utils/request";
+
+export const customerLevelOptions = (query) => {
+  return request({
+    url: "/crm/customerLevel/getCustomerLevelOption",
+    method: "get",
+    params: query,
+  });
+};

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

@@ -141,3 +141,12 @@ export function exportDoctor(query) {
     params: query
   })
 }
+
+// 查询医生管理列表
+export function listDoctorVO(query) {
+  return request({
+    url: '/his/doctor/getDocVoList',
+    method: 'get',
+    params: query
+  })
+}

+ 62 - 0
src/api/fastGpt/fastGptKeywordSend.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询Ai指令关键字列表
+export function keywordList(query) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend/keywordList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询Ai指令列表
+export function listFastGptKeywordSend(query) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询Ai指令详细
+export function getFastGptKeywordSend(id) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend/' + id,
+    method: 'get'
+  })
+}
+
+// 新增Ai指令
+export function addFastGptKeywordSend(data) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改Ai指令
+export function updateFastGptKeywordSend(data) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除Ai指令
+export function delFastGptKeywordSend(id) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出Ai指令
+export function exportFastGptKeywordSend(query) {
+  return request({
+    url: '/fastGpt/fastGptKeywordSend/export',
+    method: 'get',
+    params: query
+  })
+}

+ 70 - 0
src/api/fastGpt/fastgptEventLogTotal.js

@@ -0,0 +1,70 @@
+import request from '@/utils/request'
+
+// 查询ai事件埋点统计列表
+/*export function listFastgptEventLogTotal(query) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal/list',
+    method: 'get',
+    params: query
+  })
+}*/
+
+export function listFastgptEventLogTotal(data) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal/list',
+    method: 'post',
+    data: data
+  })
+}
+
+
+// 查询ai事件埋点统计详细
+export function getFastgptEventLogTotal(id) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal/' + id,
+    method: 'get'
+  })
+}
+
+// 新增ai事件埋点统计
+export function addFastgptEventLogTotal(data) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改ai事件埋点统计
+export function updateFastgptEventLogTotal(data) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除ai事件埋点统计
+export function delFastgptEventLogTotal(id) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出ai事件埋点统计
+export function exportFastgptEventLogTotal(query) {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal/export',
+    method: 'get',
+    params: query
+  })
+}
+
+
+export function getFastGptRoleAppKeyList() {
+  return request({
+    url: '/fastGpt/fastgptEventLogTotal/getFastGptRoleAppKeyList',
+    method: 'get'
+  })
+}

+ 28 - 0
src/api/qw/externalContact.js

@@ -269,3 +269,31 @@ export function getCustomerCourseSop(query) {
     params: query
   })
 }
+
+
+export function batchUpdateExternalContactNotes(data) {
+  return request({
+    url: '/qw/externalContact/batchUpdateExternalContactNotes',
+    method: 'post',
+    data: data
+  })
+}
+
+// 查询企业微信客户流失删除统计列表
+export function delLossStatistics(query) {
+  return request({
+    url: '/qw/externalContact/delLossStatistics',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 导出企业微信客户
+export function delLossStatisticsExport(query) {
+  return request({
+    url: '/qw/externalContact/delLossStatisticsExport',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -9,6 +9,15 @@ export function listSop(query) {
   })
 }
 
+// 查询所有的企微sop列表信息
+export function infoSop(query) {
+  return request({
+    url: '/qw/sop/info',
+    method: 'get',
+    params: query
+  })
+}
+
 export function listMySop(query) {
   return request({
     url: '/qw/sop/myList',
@@ -96,6 +105,14 @@ export function delSop(id) {
   })
 }
 
+// 删除企微sop
+export function delSopLogs(id) {
+  return request({
+    url: '/qw/sop/delSopLogs/' + id,
+    method: 'delete'
+  })
+}
+
 //批量执行企微sop
 export function executeSop(ids) {
   return request({

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

@@ -77,3 +77,12 @@ export function sendMsgSopType(data) {
     data: data
   })
 }
+
+//一键群发(最外层)
+export function sendMsg(data) {
+  return request({
+    url: '/qwSop/sopUserLogsInfo/sendUserLogsInfoMsgSop',
+    method: 'post',
+    data: data
+  })
+}

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

@@ -175,6 +175,13 @@ export function getQwIpad(data) {
     data: data
   })
 }
+export function changeVideoStatus(id) {
+  return request({
+    url: '/qw/user/changeVideoStatus',
+    method: 'get',
+    params: {id}
+  })
+}
 export function delQwIpad(data) {
   return request({
     url: '/qw/user/delQwIpad',

+ 59 - 0
src/api/store/coupon.js

@@ -0,0 +1,59 @@
+import request from '@/utils/request'
+
+// 查询优惠券列表
+export function listCoupon(query) {
+  return request({
+    url: '/store/coupon/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询优惠券详细
+export function getCoupon(couponId) {
+  return request({
+    url: '/store/coupon/' + couponId,
+    method: 'get'
+  })
+}
+
+export function allList() {
+  return request({
+    url: '/store/coupon/allList',
+    method: 'get'
+  })
+}
+// 新增优惠券
+export function addCoupon(data) {
+  return request({
+    url: '/store/coupon',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改优惠券
+export function updateCoupon(data) {
+  return request({
+    url: '/store/coupon',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除优惠券
+export function delCoupon(couponId) {
+  return request({
+    url: '/store/coupon/' + couponId,
+    method: 'delete'
+  })
+}
+
+// 导出优惠券
+export function exportCoupon(query) {
+  return request({
+    url: '/store/coupon/export',
+    method: 'get',
+    params: query
+  })
+}

+ 143 - 0
src/api/store/doctor.js

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

+ 71 - 0
src/api/store/healthTongue.js

@@ -0,0 +1,71 @@
+import request from '@/utils/request'
+
+// 查询归属公司会员舌苔列表
+export function listHealthTongue(query) {
+  return request({
+    url: '/store/healthTongue/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询归属我的会员舌苔列表
+export function myListHealthTongue(query) {
+  return request({
+    url: '/store/healthTongue/myList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询舌苔详细
+export function getHealthTongue(id) {
+  return request({
+    url: '/store/healthTongue/' + id,
+    method: 'get'
+  })
+}
+
+// 新增舌苔
+export function addHealthTongue(data) {
+  return request({
+    url: '/store/healthTongue',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改舌苔
+export function updateHealthTongue(data) {
+  return request({
+    url: '/store/healthTongue',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除舌苔
+export function delHealthTongue(id) {
+  return request({
+    url: '/store/healthTongue/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出舌苔
+export function exportHealthTongue(query) {
+  return request({
+    url: '/store/healthTongue/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 导出舌苔
+export function myExportHealthTongue(query) {
+  return request({
+    url: '/store/healthTongue/myExport',
+    method: 'get',
+    params: query
+  })
+}

+ 72 - 0
src/api/store/storeOrderOffline.js

@@ -0,0 +1,72 @@
+import request from '@/utils/request'
+
+// 查询线下订单列表
+export function listStoreOrderOffline(query) {
+  return request({
+    url: '/store/storeOrderOffline/list',
+    method: 'get',
+    params: query
+  })
+}
+
+
+// 查询线下订单列表
+export function myOrderList(query) {
+  return request({
+    url: '/store/storeOrderOffline/myList',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询线下订单详细
+export function getStoreOrderOffline(orderId) {
+  return request({
+    url: '/store/storeOrderOffline/' + orderId,
+    method: 'get'
+  })
+}
+
+// 新增线下订单
+export function createOrder(data) {
+  return request({
+    url: '/store/storeOrderOffline/createOrder',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改线下订单
+export function updateStoreOrderOffline(data) {
+  return request({
+    url: '/store/storeOrderOffline',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除线下订单
+export function delStoreOrderOffline(orderId) {
+  return request({
+    url: '/store/storeOrderOffline/' + orderId,
+    method: 'delete'
+  })
+}
+
+// 导出线下订单
+export function exportStoreOrderOffline(query) {
+  return request({
+    url: '/store/storeOrderOffline/export',
+    method: 'get',
+    params: query
+  })
+}
+
+// 上传凭证
+export function uploadCredentials(data) {
+  return request({
+    url: '/store/storeOrderOffline/uploadCredentials',
+    method: 'post',
+    data: data
+  })
+}

+ 66 - 0
src/api/store/userCoupon copy.js

@@ -0,0 +1,66 @@
+import request from '@/utils/request'
+
+// 查询会员优惠券列表
+export function listUserCoupon(query) {
+  return request({
+    url: '/store/userCoupon/list',
+    method: 'get',
+    params: query
+  })
+}
+export function getListUserCoupon(query) {
+  return request({
+    url: '/store/userCoupon/getList',
+    method: 'get',
+    params: query
+  })
+}
+// 查询会员优惠券详细
+export function getUserCoupon(id) {
+  return request({
+    url: '/store/userCoupon/' + id,
+    method: 'get'
+  })
+}
+
+// 新增会员优惠券
+export function addUserCoupon(data) {
+  return request({
+    url: '/store/userCoupon',
+    method: 'post',
+    data: data
+  })
+}
+export function sendCoupon(data) {
+  return request({
+    url: '/store/userCoupon/sendCoupon',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改会员优惠券
+export function updateUserCoupon(data) {
+  return request({
+    url: '/store/userCoupon',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除会员优惠券
+export function delUserCoupon(id) {
+  return request({
+    url: '/store/userCoupon/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出会员优惠券
+export function exportUserCoupon(query) {
+  return request({
+    url: '/store/userCoupon/export',
+    method: 'get',
+    params: query
+  })
+}

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

@@ -94,3 +94,12 @@ export function getQwRepeatData(data){
     data: data
   })
 }
+
+// 批量发送IM
+export function batchSendCourse(data) {
+  return request({
+    url: '/user/fsUser/batchSendCourse',
+    method: 'post',
+    data: data
+  })
+}

+ 6 - 6
src/api/users/user.js

@@ -2,21 +2,21 @@ import request from '@/utils/request'
 
 export function list(query) {
   return request({
-    url: '/users/user/list',
+    url: '/store/user/list',
     method: 'get',
     params: query
   })
 }
 export function myList(query) {
   return request({
-    url: '/users/user/myList',
+    url: '/store/user/myList',
     method: 'get',
     params: query
   })
 }
 export function getUser(userId) {
   return request({
-    url: '/users/user/' + userId,
+    url: '/store/user/' + userId,
     method: 'get'
   })
 }
@@ -40,7 +40,7 @@ export function transferUser(data) {
 }
 export function getUserList(query) {
   return request({
-    url: '/users/user/getUserList',
+    url: '/store/user/getUserList',
     method: 'get',
     params: query
   })
@@ -49,7 +49,7 @@ export function getUserList(query) {
 // 新增用户
 export function addUser(data) {
   return request({
-    url: '/users/user',
+    url: '/store/user',
     method: 'post',
     data: data
   })
@@ -58,7 +58,7 @@ export function addUser(data) {
 // 修改用户
 export function updateUser(data) {
   return request({
-    url: '/users/user',
+    url: '/store/user',
     method: 'put',
     data: data
   })

BIN
src/assets/logo/hcl.png


BIN
src/assets/logo/hyt.png


BIN
src/assets/logo/jnlzjk.png


BIN
src/assets/logo/kyt.jpg


BIN
src/assets/logo/nmgyt.jpg


BIN
src/assets/logo/syysy.png


BIN
src/assets/logo/zkzh_logo.png


+ 1031 - 0
src/components/course/userCoursePeriod.vue

@@ -0,0 +1,1031 @@
+<template>
+    <div class="app-container">
+        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+            <el-form-item label="营期名称" prop="periodName">
+                <el-input v-model="queryParams.periodName" placeholder="请输入营期名称" clearable size="small"
+                    @keyup.enter.native="handleQuery" />
+            </el-form-item>
+            <el-form-item label="公司" prop="companyIdList">
+                <el-select v-model="queryParams.companyIdList" placeholder="请选择公司" clearable size="small" multiple>
+                    <el-option v-for="item in companyOptions" :key="item.companyId" :label="item.companyName"
+                        :value="item.companyId" />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="开营日期开始" prop="periodStartingTime" label-width="120px">
+                <el-date-picker clearable size="small" style="width: 200px" v-model="queryParams.periodStartingTime"
+                    type="date" value-format="yyyy-MM-dd" placeholder="请选择开营日期开始时间">
+                </el-date-picker>
+            </el-form-item>
+            <el-form-item label="开营日期结束" prop="periodEndTime" label-width="120px">
+                <el-date-picker clearable size="small" style="width: 300px" v-model="queryParams.periodEndTime"
+                    type="date" value-format="yyyy-MM-dd" placeholder="请选择开营日期结束时间">
+                </el-date-picker>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery"
+                    v-hasPermi="['course:period:list']">搜索</el-button>
+                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+            </el-form-item>
+        </el-form>
+
+
+
+        <el-table v-loading="loading" :data="periodList" @selection-change="handleSelectionChange" border>
+            <el-table-column label="营期名称" align="center" prop="periodName" />
+            <el-table-column label="公司名称" align="center" prop="companyName" />
+            <el-table-column label="营期状态" align="center" prop="periodStatus" width="100"
+                :formatter="periodStatusFormatter" />
+            <el-table-column label="营期线" align="center" prop="periodLine" width="180" />
+            <el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180" />
+            <el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180" />
+            <el-table-column label="创建时间" align="center" prop="createTime" width="180" />
+            <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-setting"
+                        @click="handlePeriodSettings(scope.row)">选择课节</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+
+        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
+            :limit.sync="queryParams.pageSize" @pagination="getList" />
+
+
+
+
+
+
+
+
+
+
+
+        <!-- 营期相关设置抽屉 -->
+        <el-drawer title="营期相关设置" :visible.sync="periodSettingsVisible" direction="rtl" size="74%"
+            :destroy-on-close="true" append-to-body custom-class="period-settings-drawer">
+            <div class="drawer-content" style="margin-left: 25px">
+                <el-tabs v-model="activeTab" @tab-click="handleTabClick">
+                    <el-tab-pane label="课程管理" name="course">
+                        <el-table ref="courseTable" v-loading="course.loading" :data="course.list"
+                            @selection-change="handleSelectionCourseChange" border>
+                            <el-table-column label="课程" align="center" prop="courseName" width="180" />
+                            <el-table-column label="小节" align="center" prop="videoName" />
+                            <el-table-column label="开课状态" align="center" prop="status" width="100"
+                                :formatter="courseStatusFormatter" />
+                            <el-table-column label="营期时间" align="center" prop="dayDate" width="100" />
+                            <el-table-column label="开始时间" align="center" prop="startDateTime" width="100">
+                                <!--              <template slot-scope="scope">-->
+                                <!--                <el-tag>{{scope.row.startDateTime}}</el-tag>-->
+                                <!--              </template>-->
+                            </el-table-column>
+                            <el-table-column label="结束时间" align="center" prop="endDateTime" width="100">
+                                <!--              <template slot-scope="scope">-->
+                                <!--                <el-tag type="success">{{parseTime(scope.row.endDateTime, '{h}:{i}:{s}')}}</el-tag>-->
+                                <!--              </template>-->
+                            </el-table-column>
+                            <el-table-column label="领取红包时间" align="center" prop="lastJoinTime" width="160">
+                                <template slot-scope="scope">
+                                    <el-tag type="danger">{{ scope.row.lastJoinTime }}</el-tag>
+                                </template>
+                            </el-table-column>
+                            <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+                                <template slot-scope="scope">
+                                    <el-button size="mini" type="text" @click="handleSend(scope.row)"
+                                        v-hasPermi="['course:period:courseMove']">发送</el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                        <pagination v-show="course.total > 0" :total="course.total"
+                            :page.sync="course.queryParams.pageNum" :limit.sync="course.queryParams.pageSize"
+                            @pagination="getCourseList" style="height: 40px" />
+                    </el-tab-pane>
+
+                </el-tabs>
+            </div>
+        </el-drawer>
+
+        <el-dialog title="IM发送" :visible.sync="imOpen" width="800px" append-to-body>
+            <el-form ref="imSendForm" :model="imSendForm" :rules="imRules" label-width="220px">
+                <el-form-item label="标题" prop="title">
+                    <el-input v-model="imSendForm.title" placeholder="请输入标题" />
+                </el-form-item>
+                <el-form-item label="发送消息时间" prop="sendTime">
+                    <el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="imSendForm.sendTime" type="datetime"
+                        placeholder="选择日期时间">
+                    </el-date-picker>
+                </el-form-item>
+                <el-form-item label="有效时长(分钟)" prop="effectiveDuration">
+                    <el-input-number v-model="imSendForm.effectiveDuration" :min="0"
+                        label="链接有效时长(分钟)"></el-input-number>
+                </el-form-item>
+            </el-form>
+            <div slot="footer" class="dialog-footer">
+                <el-button type="primary" @click="imSubmit">确 定</el-button>
+                <el-button @click="imCancel">取 消</el-button>
+            </div>
+        </el-dialog>
+
+    </div>
+</template>
+
+
+<script>
+import { addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, delPeriodDay, updateCourseTime, updateCourseDate, updateListCourseData, periodCourseMove, closePeriod } from "@/api/course/userCoursePeriod";
+import { getCompanyList } from "@/api/company/company";
+import { batchSendCourse } from "@/api/user/fsUser";
+import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
+import { courseList, videoList } from '@/api/course/courseRedPacketLog'
+import Da from "element-ui/src/locale/lang/da";
+import { getConfigByKey } from '@/api/system/config'
+export default {
+    props: {
+        userIds: {
+            type: Array,
+            default: () => []
+        },
+        companyId: {
+            type: Number,
+            default: 0
+        },
+        companyUserId: {
+            type: Number,
+            default: 0
+        }
+    },
+    name: "Period",
+    components: {
+    },
+    data() {
+        return {
+            imSendForm: {
+
+            },
+            imOpen: false,
+            // 遮罩层
+            loading: true,
+            updateDateOpen: false,
+            // 左侧遮罩层
+            leftLoading: true,
+            // 选中数组
+            ids: [],
+            // 非单个禁用
+            single: true,
+            // 非多个禁用
+            multiple: true,
+            // 显示搜索条件
+            showSearch: true,
+            // 总条数
+            total: 0,
+            // 左侧总条数
+            leftTotal: 0,
+            // 会员营期表格数据
+            periodList: [],
+            // 左侧列表数据
+            leftList: [],
+            videoList: [],
+            // 弹出层标题
+            title: "",
+            isDisabledDateRange: false, //是否禁用开营日期
+            // 是否显示弹出层
+            open: false,
+            // 查询参数
+            queryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                periodName: null,
+                periodStartingTime: null,
+                periodEndTime: null,
+                companyIdList: []
+            },
+            // 左侧查询参数
+            leftQueryParams: {
+                pageNum: 1,
+                pageSize: 10,
+                hasNextPage: false,
+                scs: 'order_number(desc),training_camp_id(desc)',
+                trainingCampName: null
+            },
+            // 表单参数
+            form: {},
+            // 课程相关数据
+            course: {
+                open: false,
+                row: {},
+                list: [],
+                queryParams: {
+                    pageNum: 1,
+                    pageSize: 10,
+                },
+                loading: true,
+                total: 0,
+                addOpen: false,
+                form: {},
+            },
+            //修改营期时间参数
+            updatePeriodDate: {
+                open: false,
+                loading: true,
+                ids: [],
+                form: {},
+            },
+            joinTimeSwitch: true,
+            updateCourse: {
+                open: false,
+                loading: true,
+                ids: [],
+                form: {
+                    timeRange: null,
+                    joinTime: null
+                },
+            },
+            imRules: {
+                title: [
+                    { required: true, message: "发送标题不能为空", trigger: "blur" }
+                ],
+            },
+            // 表单校验
+            rules: {
+                periodName: [
+                    { required: true, message: '营期名称不能为空', trigger: 'blur' }
+                ],
+                companyId: [
+                    { required: true, message: '公司不能为空', trigger: 'change' }
+                ],
+                courseStyle: [
+                    { required: true, message: '课程风格不能为空', trigger: 'change' }
+                ],
+                // redPacketGrantMethod: [
+                //   { required: true, message: '红包发放方式不能为空', trigger: 'change' }
+                // ],
+                periodType: [
+                    { required: true, message: '营期类型不能为空', trigger: 'change' }
+                ],
+                maxViewNum: [
+                    { required: true, message: '销售可查看天数不能为空', trigger: 'blur' }
+                ],
+                periodStartingTime: [
+                    { required: true, message: '开营日期不能为空', trigger: 'change' }
+                ]
+            },
+            // 公司选项
+            companyOptions: [],
+            // 训练营列表
+            campList: [],
+            // 激活的训练营索引
+            activeCampIndex: null,
+            // 训练营对话框是否显示
+            campDialogVisible: false,
+            courseList: false,
+            // 训练营表单
+            campForm: {
+                trainingCampId: null,
+                trainingCampName: ''
+            },
+            // 训练营表单校验
+            campRules: {
+                trainingCampName: [
+                    { required: true, message: '训练营名称不能为空', trigger: 'blur' },
+                    { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' }
+                ]
+            },
+            // 添加课程表单校验
+            courseAddRules: {
+                courseId: [
+                    { required: true, message: '请选择课程', trigger: 'change' }
+                ],
+                videoIds: [
+                    { required: true, message: '请选择小节', trigger: 'change' },
+                    { type: 'array', min: 1, message: '请至少选择一个小节', trigger: 'change' }
+                ]
+            },
+            // 修改看课时间表单校验
+            courseUpdateRules: {
+                timeRange: [
+                    {
+                        required: true,
+                        validator: (rule, value, callback) => {
+                            if (!value || !Array.isArray(value) || value.length !== 2) {
+                                callback(new Error('请选择完整的看课时间范围'));
+                            } else {
+                                // 检查时间格式是否正确(yyyy-MM-dd HH:mm:ss)
+                                const timeRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
+                                if (!timeRegex.test(value[0]) || !timeRegex.test(value[1])) {
+                                    callback(new Error('时间格式不正确'));
+                                } else if (value[0] >= value[1]) {
+                                    callback(new Error('结束时间必须大于开始时间'));
+                                } else {
+                                    callback();
+                                }
+                            }
+                        },
+                        trigger: 'change'
+                    }
+                ],
+                joinTime: [
+                    {
+                        required: true,
+                        validator: (rule, value, callback) => {
+                            if (!value) {
+                                callback(new Error('请选择领取红包时间'));
+                            } else {
+                                // 检查时间格式是否正确(yyyy-MM-dd HH:mm:ss)
+                                const timeRegex = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/;
+                                if (!timeRegex.test(value)) {
+                                    callback(new Error('时间格式不正确'));
+                                } else {
+                                    // 检查领取红包时间是否在看课时间范围内
+                                    const timeRange = this.updateCourse.form.timeRange;
+                                    if (timeRange && Array.isArray(timeRange) && timeRange.length === 2) {
+                                        if (value < timeRange[0] || value > timeRange[1]) {
+                                            callback(new Error('领取红包时间必须在看课时间范围内'));
+                                        } else {
+                                            callback();
+                                        }
+                                    } else {
+                                        callback();
+                                    }
+                                }
+                            }
+                        },
+                        trigger: 'change'
+                    }
+                ]
+            },
+            // 滚动节流标志
+            scrollThrottle: false,
+            // 加载更多状态
+            loadingMore: false,
+            // 设置红包对话框
+            redPacketVisible: false,
+            periodCompanyList: [],
+            currentRedPacketData: {
+                periodId: '',
+                videoId: ''
+            },
+            // 营期相关设置抽屉
+            periodSettingsVisible: false,
+            activeTab: 'course',
+            periodSettingsData: {},
+            companyList: [],
+            courseDialogVisible: false,
+            redPacketList: [],
+            currentCompany: null,
+            // 选中的营期数据
+            selectedPeriods: [],
+            // 批量设置红包按钮是否禁用
+            batchSetRedPacketDisabled: true,
+
+        };
+    },
+    created() {
+        courseList().then(response => {
+            this.courseList = response.list;
+        });
+        // this.getList();
+        this.getLeftList();
+        this.getCompanyList();
+
+    },
+    methods: {
+        imSubmit() {
+            console.log("imSendForm:", this.imSendForm)
+            this.$refs["imSendForm"].validate(valid => {
+                if (valid) {
+                    batchSendCourse(this.imSendForm).then(res => {
+                        if (res.errCode == 0) {
+                            this.imCancel();
+                            this.$message.success(res.errMsg)
+                        }
+                    })
+                }
+
+            });
+        },
+        handleSend(row) {
+            this.imOpen = true;
+            this.imSendForm = {
+                userIds: this.userIds,
+                companyUserId: this.companyUserId,
+                companyId: this.companyId,
+                id: row.id,
+                periodId: row.periodId,
+                courseId: row.courseId,
+                videoId: row.videoId,
+                projectId: row.projectId,
+            }
+        },
+        imCancel() {
+            this.imOpen = false;
+            this.imRest();
+        },
+        imRest() {
+            this.imSendForm = {
+                userIds: [],
+                companyUserId: null,
+                companyId: null,
+                periodId: null,
+                courseId: null,
+                videoId: null,
+                tagIds: [],
+                sendTime: null,
+                title: null,
+                effectiveDuration: null,
+                id: null,
+                projectId: null,
+            };
+            this.resetForm("imSendForm")
+        },
+        /** 删除按钮操作 */
+        async handleDeleteCourse(row) {
+            const periodDayIds = row.id || this.updateCourse.ids;
+            try {
+                await this.$confirm('是否确认删除该课程?', "提示", {
+                    confirmButtonText: "确定",
+                    cancelButtonText: "取消",
+                    type: "warning"
+                });
+
+                const res = await delPeriodDay(periodDayIds);
+
+                if (res && res.code === 200) {
+                    this.getCourseList();// 刷新列表
+                    this.$message.success('删除成功');
+                } else {
+                    this.$message.error(res.msg);
+                }
+            } catch (error) {
+
+            }
+        },
+        /** 查询会员营期列表 */
+        getList() {
+            this.loading = true;
+            const params = { ...this.queryParams };
+            params.trainingCampId = null,
+                pagePeriod(params).then(response => {
+                    this.periodList = response.rows;
+                    this.total = response.total;
+                    this.loading = false;
+                });
+        },
+        /** 查询左侧列表 */
+        getLeftList() {
+            this.leftLoading = true;
+            // 重置页码和加载更多状态
+            this.leftQueryParams.pageNum = 1;
+            this.loadingMore = false;
+
+            // 训练营数据
+            listCamp(this.leftQueryParams).then(response => {
+                if (response && response.code === 200) {
+                    this.campList = response.data.list || [];
+                    this.leftQueryParams.hasNextPage = response.data.hasNextPage;
+                    this.activeCampIndex = this.campList.length > 0 ? 0 : null;
+                    this.selectCamp(this.activeCampIndex);
+                    // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
+                    this.$nextTick(() => {
+                        const scrollEl = this.$refs.campList;
+                        if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
+                            this.loadMoreCamps();
+                        }
+                    });
+                } else {
+                    this.$message.error(response.msg || '获取训练营列表失败');
+                    this.campList = [];
+                    this.leftQueryParams.hasNextPage = false;
+                }
+                this.leftLoading = false;
+            }).catch(error => {
+                console.error('获取训练营列表失败:', error);
+                this.$message.error('获取训练营列表失败');
+                this.campList = [];
+                this.leftQueryParams.hasNextPage = false;
+                this.leftLoading = false;
+            });
+        },
+        /** 搜索按钮操作 */
+        handleQuery() {
+            this.queryParams.pageNum = 1;
+            this.getList();
+        },
+        /** 左侧搜索按钮操作 */
+        handleLeftQuery() {
+            // 重置页码和列表
+            this.leftQueryParams.pageNum = 1;
+            this.campList = [];
+            this.getLeftList();
+        },
+        /** 重置按钮操作 */
+        resetQuery() {
+            this.resetForm("queryForm");
+            this.queryParams.companyIdList = [];
+            this.handleQuery();
+        },
+        /** 多选框选中数据 */
+        handleSelectionChange(selection) {
+            this.ids = selection.map(item => item.periodId)
+            this.single = selection.length !== 1
+            this.multiple = !selection.length
+            // 更新批量设置红包相关数据
+            this.selectedPeriods = selection;
+            this.batchSetRedPacketDisabled = selection.length === 0;
+        },
+        handleSelectionCourseChange(selection) {
+            this.updateCourse.ids = selection.map(item => item.id)
+        },
+
+
+
+
+
+
+
+        /** 获取公司下拉列表*/
+        getCompanyList() {
+            this.loading = true;
+            getCompanyList().then(response => {
+                this.companyOptions = response.data;
+                this.loading = false;
+            });
+        },
+        // 取消按钮
+        cancel() {
+            this.open = false;
+            this.reset();
+        },
+        // 表单重置
+        reset() {
+            this.form = {
+                periodId: null,
+                periodName: null,
+                companyId: null,
+                courseId: null,
+                videoId: null,
+                trainingCampId: null,
+                createTime: null,
+                updateTime: null,
+                courseStyle: null,
+                liveRoomStyle: null,
+                redPacketGrantMethod: 1,
+                periodType: 1,
+                periodStartingTime: null,
+                dateRange: [],
+                date: null,
+                days: [],
+                maxViewNum: 0,
+                periodEndTime: null,
+                timeRange: [], // 看课时间范围
+                viewStartTime: null, // 看课开始时间
+                viewEndTime: null, // 看课结束时间
+                lastJoinTime: null // 领取红包时间
+            };
+            this.resetForm("form");
+        },
+
+
+
+
+        /** 重置训练营表单 */
+        resetCampForm() {
+            this.campForm = {
+                trainingCampId: null,
+                trainingCampName: ''
+            };
+            // 如果表单已经创建,则重置校验结果
+            if (this.$refs.campForm) {
+                this.$refs.campForm.resetFields();
+            }
+        },
+
+
+
+        /** 选中训练营 */
+        selectCamp(index) {
+            if (index == null || index == undefined) return;
+            this.activeCampIndex = index;
+            // 加载对应的训练营营期数据
+            const selectedCamp = this.campList[index];
+            this.queryParams.trainingCampId = selectedCamp.trainingCampId;
+            this.getList();
+        },
+        /** 处理滚动事件,实现滚动到底部加载更多 */
+        handleScroll() {
+            // 如果正在节流中或者正在加载中,则不处理
+            if (this.scrollThrottle || this.loadingMore) return;
+
+            // 设置节流,200ms内不再处理滚动事件
+            this.scrollThrottle = true;
+            setTimeout(() => {
+                this.scrollThrottle = false;
+            }, 200);
+
+            const scrollEl = this.$refs.campList;
+            if (!scrollEl) return;
+
+            // 判断是否滚动到底部:滚动高度 + 可视高度 >= 总高度 - 30(添加30px的容差,提前触发加载)
+            const isBottom = scrollEl.scrollTop + scrollEl.clientHeight >= scrollEl.scrollHeight - 30;
+
+            // 如果滚动到底部,且有下一页数据,且当前不在加载中,则加载更多
+            if (isBottom && this.leftQueryParams.hasNextPage && !this.leftLoading && !this.loadingMore) {
+                this.loadMoreCamps();
+            }
+        },
+        /** 加载更多训练营数据 */
+        loadMoreCamps() {
+            // 已在加载中,防止重复加载
+            if (this.leftLoading || this.loadingMore) return;
+
+            // 设置加载状态
+            this.loadingMore = true;
+
+            // 页码加1
+            this.leftQueryParams.pageNum += 1;
+
+            // 加载下一页数据
+            listCamp(this.leftQueryParams).then(response => {
+                if (response && response.code === 200) {
+                    // 将新数据追加到列表中
+                    const newList = response.data.list || [];
+                    if (newList.length > 0) {
+                        this.campList = [...this.campList, ...newList];
+                    }
+
+                    // 更新是否有下一页的标志
+                    this.leftQueryParams.hasNextPage = response.data.hasNextPage;
+
+                    // 如果当前显示的列表高度不足以触发滚动,但还有更多数据,自动加载下一页
+                    this.$nextTick(() => {
+                        const scrollEl = this.$refs.campList;
+                        if (scrollEl && this.leftQueryParams.hasNextPage && scrollEl.scrollHeight <= scrollEl.clientHeight) {
+                            // 延迟一点再加载下一页,避免过快加载
+                            setTimeout(() => {
+                                this.loadMoreCamps();
+                            }, 300);
+                        }
+                    });
+                } else {
+                    this.$message.error(response.msg || '加载更多训练营失败');
+                }
+                this.loadingMore = false;
+            }).catch(error => {
+                console.error('加载更多训练营失败:', error);
+                this.$message.error('加载更多训练营失败');
+                this.loadingMore = false;
+            });
+        },
+        timeChange(type) {
+            if (type == 1) {
+                this.form.periodStartingTime = this.form.dateRange[0];
+                this.form.periodEndTime = this.form.dateRange[1];
+                if (!Array.isArray(this.form.days)) {
+                    this.form.days = [];
+                }
+                this.form.days = [];
+                let days = this.getDiff(this.form.periodStartingTime, this.form.periodEndTime);
+                for (let i = 0; i < days; i++) {
+                    this.form.days.push({ lesson: i + 1 });
+                }
+            }
+            if (type == 2) {
+                this.form.periodStartingTime = this.form.date;
+                this.form.periodEndTime = this.form.date;
+                this.form.days = [];
+            }
+        },
+        getDiff(start, end) {
+            if (start == null || start == undefined || start == '') return 0;
+            if (end == null || end == undefined || end == '') return 0;
+            if (start == end) 1;
+            const startDate = this.getUTCDate(start);
+            const endDate = this.getUTCDate(end);
+
+            const timeDiff = endDate - startDate;
+            return (Math.floor(timeDiff / (1000 * 3600 * 24))) + 1; // 直接取整
+        },
+        getUTCDate(dateStr) {
+            const [year, month, day] = dateStr.split('-').map(Number);
+            return new Date(Date.UTC(year, month - 1, day)); // 月份从0开始
+        },
+
+        getCourseList() {
+            this.course.loading = true;
+            getDays(this.course.queryParams).then(e => {
+                this.course.list = e.rows;
+                this.course.total = e.total;
+                this.course.loading = false;
+            });
+        },
+
+
+
+
+
+
+
+
+
+        handlePeriodSettings(row) {
+            console.log("公司id:", this.companyId, this.companyUserId)
+            this.periodSettingsData = row;
+            this.periodSettingsVisible = true;
+            // 初始化课程列表
+            this.course.queryParams.periodId = row.periodId;
+            // 根据当前激活的tab加载对应数据
+            this.handleTabClick({ name: this.activeTab });
+        },
+
+
+        /** 处理tab切换 */
+        handleTabClick(tab) {
+            if (tab.name === 'course') {
+                this.getCourseList();
+            } else if (tab.name === 'company') {
+                this.redPacketVisible = true;
+            }
+        },
+
+
+        /** 营期状态格式化 */
+        periodStatusFormatter(row) {
+            const statusMap = {
+                1: '未开始',
+                2: '进行中',
+                3: '已结束'
+            };
+            return statusMap[row.periodStatus] || '未知状态';
+        },
+        /** 开课状态格式化 */
+        courseStatusFormatter(row) {
+            const statusMap = {
+                0: '未开始',
+                1: '进行中',
+                2: '已结束'
+            };
+            return statusMap[row.status] || '未知状态';
+        },
+
+
+
+
+
+    },
+};
+</script>
+
+<style scoped>
+.left-aside {
+    background-color: #fff;
+    border-right: 1px solid #EBEEF5;
+    padding: 0;
+    display: flex;
+    flex-direction: column;
+    height: 800px;
+}
+
+.left-header {
+    padding: 10px;
+    border-bottom: 1px solid #EBEEF5;
+}
+
+.left-header-top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 10px;
+}
+
+.search-btn {
+    width: 50%;
+    height: 36px;
+    background-color: #409EFF;
+    color: white;
+    border: none;
+}
+
+.search-input-wrapper {
+    margin-bottom: 10px;
+}
+
+.sort-wrapper {
+    display: flex;
+    align-items: center;
+    margin-bottom: 10px;
+}
+
+.sort-label {
+    width: 70px;
+    font-size: 14px;
+    font-weight: 600;
+    color: #909399;
+}
+
+.sort-select {
+    margin-left: 10px;
+    width: 280px;
+}
+
+.color-wrapper {
+    display: flex;
+    align-items: center;
+    margin-bottom: 10px;
+}
+
+.color-label {
+    width: 70px;
+    color: #606266;
+}
+
+.color-hint {
+    margin-left: 10px;
+    color: #606266;
+    font-size: 12px;
+}
+
+.color-help {
+    margin-left: 5px;
+    color: #909399;
+    cursor: pointer;
+}
+
+.hint-text {
+    color: #606266;
+    font-size: 12px;
+    margin-top: 5px;
+}
+
+.camp-list {
+    flex: 1;
+    overflow-y: auto;
+    padding: 3px;
+}
+
+.camp-item {
+    margin-bottom: 5px;
+    padding: 15px;
+    background-color: #ffffff;
+    position: relative;
+    cursor: pointer;
+    display: flex;
+    justify-content: space-between;
+    border: 1px solid #eaedf2;
+}
+
+.camp-item:last-child {
+    margin-bottom: 0;
+}
+
+.camp-item:hover {
+    background-color: #f5f9ff;
+}
+
+.camp-item.active {
+    background-color: #eaf4ff;
+    border-left: 1px solid #75b8fc;
+}
+
+.camp-content {
+    flex: 1;
+    padding-right: 10px;
+}
+
+.camp-title {
+    font-weight: bold;
+    font-size: 16px;
+    margin-bottom: 8px;
+    color: #333;
+    display: flex;
+    align-items: center;
+}
+
+.camp-icon {
+    font-size: 16px;
+    margin-right: 6px;
+    color: #409EFF;
+}
+
+.camp-info {
+    display: flex;
+    justify-content: space-between;
+    margin-bottom: 8px;
+    font-size: 12px;
+    color: #c4c1c1;
+    line-height: 1.5;
+}
+
+.camp-stats {
+    display: flex;
+    justify-content: space-between;
+    font-size: 12px;
+    color: #666;
+    background-color: #f5f9ff;
+    padding: 6px 10px;
+    border-radius: 4px;
+    line-height: 1.5;
+}
+
+.stat-item {
+    display: flex;
+    align-items: center;
+}
+
+.stat-item i {
+    margin-right: 4px;
+    font-size: 14px;
+    color: #409EFF;
+}
+
+.camp-actions {
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    align-items: flex-end;
+    gap: 8px;
+    border-left: 1px dashed #eaedf2;
+    padding-left: 12px;
+    min-width: 50px;
+}
+
+.action-btn {
+    padding: 2px 5px;
+    font-size: 12px;
+    border-radius: 4px;
+    transition: all 0.2s;
+}
+
+.action-btn:hover {
+    background-color: rgba(255, 255, 255, 0.8);
+}
+
+.delete-btn {
+    color: #f56c6c;
+}
+
+.delete-btn:hover {
+    background-color: rgba(245, 108, 108, 0.1);
+}
+
+.copy-btn {
+    color: #409EFF;
+}
+
+.copy-btn:hover {
+    background-color: rgba(64, 158, 255, 0.1);
+}
+
+.warning-icon {
+    color: #E6A23C;
+    font-size: 16px;
+    margin-left: 5px;
+}
+
+.el-main {
+    padding: 10px;
+}
+
+/* 添加训练营表单样式 */
+.drawer-footer {
+    /* position: absolute; */
+    bottom: 0;
+    left: 0;
+    right: 0;
+    padding: 20px;
+    background: #fff;
+    text-align: right;
+    border-top: 1px solid #e8e8e8;
+}
+
+.el-input-number {
+    width: 100%;
+}
+
+/* 加载更多样式 */
+.loading-more {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 12px 0;
+    color: #909399;
+    font-size: 14px;
+}
+
+.loading-more i {
+    margin-right: 5px;
+    font-size: 16px;
+}
+
+/* 无更多数据提示 */
+.no-more-data {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    padding: 12px 0;
+    color: #c0c4cc;
+    font-size: 13px;
+}
+
+.no-more-data span {
+    position: relative;
+    display: flex;
+    align-items: center;
+}
+</style>

+ 11 - 9
src/views/company/companyDept/index.vue

@@ -48,6 +48,8 @@
       default-expand-all
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
+
+      <el-table-column prop="deptId" label="部门编号" width="260"></el-table-column>
       <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
       <el-table-column prop="orderNum" label="排序" width="200"></el-table-column>
       <el-table-column prop="status" label="状态" :formatter="statusFormat" width="100"></el-table-column>
@@ -58,17 +60,17 @@
       </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" 
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['company:dept:edit']"
           >修改</el-button>
-          <el-button 
-            size="mini" 
-            type="text" 
-            icon="el-icon-plus" 
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-plus"
             @click="handleAdd(scope.row)"
             v-hasPermi="['company:dept:add']"
           >新增</el-button>
@@ -319,4 +321,4 @@ export default {
     }
   }
 };
-</script>
+</script>

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

@@ -44,6 +44,7 @@
           type="primary"
           icon="el-icon-edit"
           @click="handleRecharge"
+          v-hasPermi="['company:companyRecharge:Recharge']"
         >充值</el-button>
       </el-col>
 	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>

+ 414 - 46
src/views/company/companyUser/index.vue

@@ -49,9 +49,9 @@
           <el-col :span="1.5">
             <el-button  plain type="danger" icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['company:user:remove']">删除</el-button>
           </el-col>
-          <!-- <el-col :span="1.5">
+          <el-col :span="1.5">
             <el-button  plain type="info" icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['company:user:import']">导入</el-button>
-          </el-col> -->
+          </el-col>
           <el-col :span="1.5">
             <el-button  plain type="warning" icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['company:user:export']">导出</el-button>
           </el-col>
@@ -80,7 +80,7 @@
               size="mini"
               :disabled="multiple"
               @click="handerCompanyUserAreaList"
-            >批量设置销售所属区域(原有的暂用)</el-button>
+            >批量设置销售所属区域</el-button>
           </el-col>
           <el-col :span="1.5">
             <el-button
@@ -100,6 +100,14 @@
               @click="handleAllowedAllRegister"
             >允许注册会员开关</el-button>
           </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="primary"
+              plain
+              size="mini"
+              @click="handleBindCompanyUserCode"
+            >生成注册/绑定销售二维码</el-button>
+          </el-col>
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
         </el-row>
 
@@ -110,6 +118,37 @@
           <el-table-column label="员工后台昵称" align="center" prop="nickName" :show-overflow-tooltip="true" 员工后台  width="100"/>
           <el-table-column label="部门" align="center" prop="deptName" :show-overflow-tooltip="true" />
           <el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
+          <el-table-column label="二维码" align="center" prop="qrCodeWeixin">
+            <template slot-scope="scope">
+              <!-- 显示已上传的二维码 -->
+              <el-image
+                v-if="scope.row.qrCodeWeixin"
+                style="width: 80px; height: 80px; margin-bottom: 5px; display: block; margin-left: auto; margin-right: auto;"
+                :src="scope.row.qrCodeWeixin"
+                :preview-src-list="[scope.row.qrCodeWeixin]"
+                fit="contain">
+                <div slot="error" class="image-slot">
+                  <i class="el-icon-picture-outline"></i>
+                </div>
+              </el-image>
+              <!-- 上传组件 -->
+              <el-upload
+                class="avatar-uploader"
+                action="#"
+                :show-file-list="false"
+                :http-request="(options) => handleCustomUpload(options, scope.row)"
+                :before-upload="(file) => beforeImageUpload(file, scope.row)"
+              >
+                <el-button size="small" type="primary" :loading="scope.row.uploading">
+                  {{ scope.row.qrCodeWeixin ? '更换图片' : '上传图片' }}
+                  <i class="el-icon-upload el-icon--right"></i>
+                </el-button>
+              </el-upload>
+              <div v-if="scope.row.uploadError" class="el-upload__tip" style="color: red;">
+                {{ scope.row.uploadError }}
+              </div>
+            </template>
+          </el-table-column>
           <el-table-column label="状态" align="center">
             <template slot-scope="scope">
               <el-switch v-model="scope.row.status" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
@@ -146,6 +185,30 @@
           </el-table-column>
           <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
             <template slot-scope="scope">
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-connection"
+                plain
+                v-if="scope.row.doctorId!=null"
+                @click="handleUpdateDoctor(scope.row)"
+              >换绑医生</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                plain
+                icon="el-icon-link"
+                v-else
+                @click="handleUpdateDoctor(scope.row)"
+              >绑定医生</el-button>
+              <el-button
+                size="mini"
+                type="text"
+                icon="el-icon-unlock"
+                plain
+                v-if="scope.row.doctorId!=null"
+                @click="handleUnBindUserId(scope.row)"
+              >解绑医生</el-button>
               <el-button
                 v-if="scope.row.qwStatus == 0"
                 size="mini"
@@ -347,7 +410,7 @@
 <!--            </el-form-item>-->
 <!--          </el-col>-->
 <!--        </el-row>-->
-        <el-row>
+<!--        <el-row>
           <el-col :span="24">
             <el-form-item label="看课域名">
               <el-input
@@ -360,7 +423,7 @@
               <el-button type="primary" style="margin-left: 20px" @click="generateDomain">生成域名</el-button>
             </el-form-item>
           </el-col>
-        </el-row>
+        </el-row>-->
         <el-row>
           <el-col :span="24">
             <el-form-item label="备注">
@@ -375,25 +438,60 @@
       </div>
     </el-dialog>
 
-<!--    &lt;!&ndash; 用户导入对话框 &ndash;&gt;-->
-<!--    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>-->
-<!--      <el-upload ref="upload" :limit="1" accept=".xlsx, .xls" :headers="upload.headers" :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading" :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>-->
-<!--        <i class="el-icon-upload"></i>-->
-<!--        <div class="el-upload__text">-->
-<!--          将文件拖到此处,或-->
-<!--          <em>点击上传</em>-->
-<!--        </div>-->
-<!--        <div class="el-upload__tip" slot="tip">-->
-<!--          <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
-<!--          <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>-->
-<!--        </div>-->
-<!--        <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>-->
-<!--      </el-upload>-->
-<!--      <div slot="footer" class="dialog-footer">-->
-<!--        <el-button type="primary" @click="submitFileForm">确 定</el-button>-->
-<!--        <el-button @click="upload.open = false">取 消</el-button>-->
-<!--      </div>-->
-<!--    </el-dialog>-->
+    <el-dialog :title="title" :visible.sync="bindCompanyOpen" width="700px" append-to-body>
+      <el-form ref="formBindCompany" :model="formBindCompany" :rules="bindCompanyRules" label-width="80px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="企微主体" prop="corpId">
+              <el-select v-model="formBindCompany.corpId" placeholder="企微主体" size="small">
+                <el-option
+                  v-for="dict in myQwCompanyList"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="归属部门" prop="deptId">
+              <treeselect v-model="formBindCompany.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="角色" prop="roleIds">
+              <el-select v-model="formBindCompany.roleIds" multiple placeholder="请选择">
+                <el-option v-for="item in roleOptions" :key="item.roleId" :label="item.roleName" :value="item.roleId "></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="销售区域" prop="addressId">
+              <el-select v-model="formBindCompany.addressId"  filterable placeholder="请选择所属销售的区域" style="width: 200px;">
+                <el-option
+                  v-for="item in citysAreaList"
+                  :key="item.cityId"
+                  :label="item.cityName"
+                  :value="item.cityId"
+                ></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitBingCompanyForm">确 定</el-button>
+        <el-button @click="cancelBind">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-dialog :title="user.title" :visible.sync="user.open" width="1000px" append-to-body>
       <selectUser ref="selectUser" @bindQwUser="bindQwUser"></selectUser>
     </el-dialog>
@@ -439,6 +537,48 @@
         <el-button @click="allowedAllRegisterOpen = false">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog :title="bindCompanyUrl.title" v-if="bindCompanyUrl.open"  :visible.sync="bindCompanyUrl.open" width="450px"  append-to-body>
+      <div style="padding-bottom:15px;" >
+        <img :src="bindCompanyUrl.url" width="400px">
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="downloadImage(bindCompanyUrl.url, bindCompanyUrl.name+'.png')">下载二维码</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
+      <el-upload
+        ref="upload"
+        :limit="1"
+        accept=".xlsx, .xls"
+        :headers="upload.headers"
+        :action="upload.url + '?updateSupport=' + upload.updateSupport"
+        :disabled="upload.isUploading"
+        :on-progress="handleFileUploadProgress"
+        :on-success="handleFileSuccess"
+        :auto-upload="false"
+        drag
+      >
+        <i class="el-icon-upload"></i>
+        <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
+        <div class="el-upload__tip text-center" slot="tip">
+          <div class="el-upload__tip" slot="tip">
+          </div>
+          <span>仅允许导入xls、xlsx格式文件。</span>
+          <el-link type="primary" :underline="false" style="font-size:12px;vertical-align: baseline;" @click="importTemplate">下载模板</el-link>
+        </div>
+      </el-upload>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitFileForm">确 定</el-button>
+        <el-button @click="upload.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <el-dialog :title="doctor.title" :visible.sync="doctor.open" width="800px" append-to-body>
+      <selectDoctor ref="selectDoctor" @bindCompanyUserDoctorId="bindCompanyUserDoctorId"></selectDoctor>
+    </el-dialog>
+
   </div>
 </template>
 
@@ -457,7 +597,7 @@ import {
   generateSubDomain,
   setIsRegisterMember,
   updateCompanyUserAreaList,
-  isAllowedAllRegister
+  isAllowedAllRegister, unBindDoctorId, bindDoctorId
 } from "@/api/company/companyUser";
 import { getToken } from "@/utils/auth";
 import { treeselect } from "@/api/company/companyDept";
@@ -468,11 +608,23 @@ import { syncDept } from '@/api/qw/qwDept';
 import { getMyQwUserList,getMyQwCompanyList } from "@/api/qw/user";
 import  selectUser  from "@/views/company/components/selectQwUser.vue";
 import { getConfigByKey } from "@/api/company/companyConfig";
+import axios from "axios";
+import {addCodeUrl} from "../../../api/company/companyUser";
+import selectDoctor from "@/views/qw/user/selectDoctor.vue";
 export default {
   name: "User",
-  components: { Treeselect ,selectUser},
+  components: {selectDoctor, Treeselect ,selectUser},
   data() {
     return {
+      doctor: {
+        open: false,
+        title: '绑定医生'
+      },
+      doctorForm: {
+        userId: null,
+        doctorId: null
+      },
+      uploadUrl: process.env.VUE_APP_BASE_API+"/company/user/common/uploadOSS",
       // 遮罩层
       loading: false,
       qwUserList:[],
@@ -505,6 +657,7 @@ export default {
       deptOptions: undefined,
       // 是否显示弹出层
       open: false,
+      bindCompanyOpen: false,
       qwOpen:false,
       // 部门名称
       deptName: undefined,
@@ -536,26 +689,35 @@ export default {
       citysAreaList:[],
       // 表单参数
       form: {},
+      formBindCompany: {},
+
+      bindCompanyUrl:{
+        open:false,
+        title:"绑定/注册销售二维码",
+        name:null,
+        url:null,
+      },
+
       form1: {},
       defaultProps: {
         children: "children",
         label: "label",
       },
-      // // 用户导入参数
-      // upload: {
-      //   // 是否显示弹出层(用户导入)
-      //   open: false,
-      //   // 弹出层标题(用户导入)
-      //   title: "",
-      //   // 是否禁用上传
-      //   isUploading: false,
-      //   // 是否更新已经存在的用户数据
-      //   updateSupport: 0,
-      //   // 设置上传的请求头部
-      //   headers: { Authorization: "Bearer " + getToken() },
-      //   // 上传的地址
-      //   url: process.env.VUE_APP_BASE_API + "/system/user/importData",
-      // },
+      // 用户导入参数
+      upload: {
+        // 是否显示弹出层(用户导入)
+        open: false,
+        // 弹出层标题(用户导入)
+        title: "",
+        // 是否禁用上传
+        isUploading: false,
+        // 是否更新已经存在的用户数据
+        updateSupport: 0,
+        // 设置上传的请求头部
+        headers: { Authorization: "Bearer " + getToken() },
+        // 上传的地址
+        url: process.env.VUE_APP_BASE_API + "/company/user/importCompanyUser",
+      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -613,6 +775,21 @@ export default {
           },
         ],
       },
+      // 表单校验
+      bindCompanyRules: {
+        deptId: [
+          { required: true, message: "归属部门不能为空", trigger: "blur" },
+        ],
+        addressId: [
+          { required: true, message: "销售所属区域不能为空", trigger: "blur" },
+        ],
+        roleIds: [
+          { required: true, message: "角色不能为空", trigger: "blur" },
+        ],
+        corpId: [
+          { required: true, message: "角色不能为空", trigger: "blur" },
+        ],
+      },
       // 是否允许注册会员开关
       allowedAllRegisterOpen: false,
       allowedAllRegisterForm: {
@@ -738,6 +915,10 @@ export default {
       this.open = false;
       this.reset();
     },
+    cancelBind(){
+      this.bindCompanyOpen=false;
+      this.resetBindCompany();
+    },
 
     submitFormArea(address){
       const uIds = this.ids;
@@ -787,6 +968,15 @@ export default {
       };
       this.resetForm("form");
     },
+
+    resetBindCompany() {
+      this.formBindCompany = {
+        deptId: null,
+        addressId: null,
+        roleIds: [],
+      };
+      this.resetForm("formBindCompany");
+    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.page = 1;
@@ -817,6 +1007,17 @@ export default {
         console.log(" this.form1 ", this.form1)
       });
     },
+
+    handleBindCompanyUserCode(){
+      this.reset();
+      this.getTreeselect();
+      getUser().then((response) => {
+        this.postOptions = response.posts;
+        this.roleOptions = response.roles;
+        this.bindCompanyOpen = true;
+        this.title = "创建 新增/绑定销售 的二维码";
+      });
+    },
     qwBind(row){
       this.qwUser=[];
       this.qwUserList=[];
@@ -927,6 +1128,39 @@ export default {
         }
       });
     },
+
+    downloadImage(imageSrc, fileName) {
+      const link = document.createElement('a');
+      link.href = imageSrc;
+      link.download = fileName || '绑定或新增销售.png';
+      document.body.appendChild(link);
+      link.click();
+      document.body.removeChild(link);
+    },
+
+    submitBingCompanyForm: function () {
+
+      this.$refs["formBindCompany"].validate((valid) => {
+        if (valid) {
+
+          let loadingRock = this.$loading({
+            lock: true,
+            text: '生成二维码中~~请不要刷新页面!!',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+            addCodeUrl(this.formBindCompany).then((response) => {
+              this.bindCompanyOpen=false;
+              this.bindCompanyUrl.url=response.data.url
+              this.bindCompanyUrl.open=true;
+              this.bindCompanyUrl.name="绑定或新增 销售二维码";
+            }).finally(res=>{
+              loadingRock.close();
+            })
+        }
+      });
+    },
     /**
     * 同步企业微信员工
     */
@@ -1039,11 +1273,11 @@ export default {
         })
         .catch(function () {});
     },
-    // /** 导入按钮操作 */
-    // handleImport() {
-    //   this.upload.title = "用户导入";
-    //   this.upload.open = true;
-    // },
+    /** 导入按钮操作 */
+    handleImport() {
+      this.upload.title = "用户导入";
+      this.upload.open = true;
+    },
     /** 下载模板操作 */
     importTemplate() {
       importTemplate().then((response) => {
@@ -1108,7 +1342,141 @@ export default {
         }
       });
     },
+    /**
+     * 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise且被 reject,则停止上传。
+     * @param {File} file - 用户选择的文件对象
+     * @param {Object} row - 当前行的数据对象
+     */
+    beforeImageUpload(file, row) {
+      // 清除之前的错误信息
+      this.$set(row, 'uploadError', '');
+      const isJPG = file.type === 'image/jpeg';
+      const isPNG = file.type === 'image/png';
+      const isGIF = file.type === 'image/gif'; // 根据需要添加更多格式
+      const isValidFormat = isJPG || isPNG || isGIF;
+      const isLt2M = file.size / 1024 / 1024 < 2; // 限制图片大小为 2MB
+      if (!isValidFormat) {
+        const errorMsg = '上传二维码图片只能是 JPG/PNG/GIF 格式!';
+        this.$message.error(errorMsg);
+        this.$set(row, 'uploadError', errorMsg); // 在行内显示错误
+        return false;
+      }
+      if (!isLt2M) {
+        const errorMsg = '上传二维码图片大小不能超过 2MB!';
+        this.$message.error(errorMsg);
+        this.$set(row, 'uploadError', errorMsg); // 在行内显示错误
+        return false;
+      }
+      return true; // 校验通过,允许上传
+    },
+    /**
+     * 自定义上传方法
+     * @param {Object} options - Element UI upload 组件传递的参数,包含 file, onSuccess, onError, onProgress 等
+     * @param {Object} row - 当前行的数据对象
+     */
+    async handleCustomUpload(options, row) {
+
+      const file = options.file;
+      const formData = new FormData();
+      formData.append('file', file);
 
+      formData.append('userId',row.userId)
+
+      this.$set(row, 'uploading', true);
+      this.$set(row, 'uploadError', '');
+      try {
+        const response = await axios.post(this.uploadUrl, formData, {
+          headers: {
+            'Content-Type': 'multipart/form-data',
+          },
+          onUploadProgress: progressEvent => {
+            const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total);
+            console.log(`上传进度: ${percentCompleted}%`);
+          }
+        });
+        if (response.data && (response.data.url || (response.data.data && response.data.data.url))) {
+          const imageUrl = response.data.url || response.data.data.url;
+          this.$set(row, 'qrCodeWeixin', imageUrl); // 更新行数据中的图片URL
+          this.$message.success('图片上传成功!');
+          options.onSuccess(response.data, file); // 通知el-upload上传成功 (虽然我们自定义了,但调用一下也无妨)
+        } else {
+          const errorMsg = response.data.message || '图片上传失败,服务器未返回有效URL';
+          this.$message.error(errorMsg);
+          this.$set(row, 'uploadError', errorMsg);
+          options.onError(new Error(errorMsg), file); // 通知el-upload上传失败
+        }
+      } catch (error) {
+        console.error('上传失败:', error);
+        let errorMsg = '图片上传失败';
+        if (error.response && error.response.data && error.response.data.message) {
+          errorMsg = error.response.data.message;
+        } else if (error.message) {
+          errorMsg = error.message;
+        }
+        this.$message.error(errorMsg);
+        this.$set(row, 'uploadError', errorMsg);
+        options.onError(error, file); // 通知el-upload上传失败
+      } finally {
+        this.$set(row, 'uploading', false); // 无论成功失败,结束上传状态
+      }
+    },
+    requestUpload() {
+    },
+    beforeUpload(){
+      console.log(file.type)
+      const isPic =
+        file.type === 'image/jpeg' ||
+        file.type === 'image/png' ||
+        file.type === 'image/gif' ||
+        file.type === 'image/jpg' ||
+        file.type === 'audio/mpeg'
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!isPic) {
+        this.$message.error('上传图片只能是 JPG、JPEG、PNG、GIF 格式!')
+        return false
+      }
+      if (!isLt2M) {
+        this.$message.error('上传头像图片大小不能超过 2MB!')
+      }
+      return isPic && isLt2M
+    },
+    handleUpdateDoctor(row){
+      this.doctor.title="绑定医生"
+      this.doctor.open=true;
+      this.doctorForm.userId=row.userId;
+    },
+    bindCompanyUserDoctorId(row){
+      console.log(row)
+      this.doctorForm.doctorId=row;
+      bindDoctorId(this.doctorForm).then(res=>{
+        if (res.code==200){
+          this.$message.success('绑定成功')
+        }else {
+          this.$message.error('绑定失败:',res.msg)
+        }
+        this.getList()
+        this.doctor.open=false;
+      })
+    },
+    handleUnBindUserId(val){
+      this.$confirm(
+        '确认解绑医生:<span style="color: green;">' + val.nickName + '' +
+        '</span> 的医生?',
+        {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+          dangerouslyUseHTMLString: true // 允许使用 HTML 字符串
+        }
+      ).then(() => {
+        return unBindDoctorId(val.userId);
+      }).then(response => {
+        this.getList();
+        this.msgSuccess("解绑成功");
+      }).finally(res=>{
+        this.getList();
+      })
+    },
   },
 };
 </script>

+ 93 - 0
src/views/components/healthTongueDetails.vue

@@ -0,0 +1,93 @@
+<template>
+    <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
+      <div style="padding: 20px; background-color: #fff;">
+       舌苔检测详情
+      </div>
+<div class="contentx" >
+  <div class="desct"> 检测信息</div>
+ <el-descriptions title="" :column="3" border>
+            <el-descriptions-item label="姓名" ><span v-if="item!=null">{{item.name}}</span></el-descriptions-item>
+            <el-descriptions-item label="年龄" ><span v-if="item!=null">{{item.age}}</span></el-descriptions-item>
+            <el-descriptions-item label="性别" ><span v-if="item!=null"><dict-tag :options="sexOptions" :value="item.sex"/></span></el-descriptions-item>
+            <el-descriptions-item label="体质" ><span v-if="item!=null">{{item.typeName}}</span></el-descriptions-item>
+            <el-descriptions-item label="剥苔" ><span v-if="item!=null"><dict-tag :options="orOptions" :value="item.botai"/></span></el-descriptions-item>
+            <el-descriptions-item label="剥苔详细" ><span v-if="item!=null">{{item.botaiDesc}}</span></el-descriptions-item>
+            <el-descriptions-item label="齿痕" ><span v-if="item!=null"><dict-tag :options="orOptions" :value="item.chihen"/></span></el-descriptions-item>
+            <el-descriptions-item label="齿痕详细" ><span v-if="item!=null">{{item.chihenDesc}}</span></el-descriptions-item>
+            <el-descriptions-item label="裂纹" ><span v-if="item!=null"><dict-tag :options="orOptions" :value="item.liewen"/></span></el-descriptions-item>
+            <el-descriptions-item label="裂纹详细" ><span v-if="item!=null">{{item.liewenDesc}}</span></el-descriptions-item>
+            <el-descriptions-item label="舌脉" ><span v-if="item!=null">{{item.shemianName}}</span></el-descriptions-item>
+            <el-descriptions-item label="舌脉详细" ><span v-if="item!=null">{{item.shemianDesc}}</span></el-descriptions-item>
+            <el-descriptions-item label="苔色" ><span v-if="item!=null">{{item.taiseName}}</span></el-descriptions-item>
+            <el-descriptions-item label="苔色详细" ><span v-if="item!=null"> {{item.taiseDesc}}</span></el-descriptions-item>
+            <el-descriptions-item label="舌苔图片" ><span v-if="item!=null"> <img :src="item.tongueUrl" style="max-width: 150px;"></span></el-descriptions-item>
+  </el-descriptions>
+
+ </div>
+ <div class="contentx" v-if="conditioningPlanJson!=null">
+        <div class="desct"> 体质解析</div>
+        <el-descriptions title="" :column="1" border >
+            <el-descriptions-item :label="form.name" v-for=" form in conditioningPlanJson" ><span >{{form.value}}</span></el-descriptions-item>
+        </el-descriptions>
+  </div>
+    </div>
+</template>
+
+<script>
+import { listHealthTongue, getHealthTongue, delHealthTongue, addHealthTongue, updateHealthTongue, exportHealthTongue } from "@/api/store/healthTongue";
+
+  export default {
+    name: "healthTongueDetail",
+    data() {
+      return {
+        item:null,
+        orOptions:[],
+        sexOptions:[],
+        conditioningPlanJson:null,
+      }
+    },
+    created() {
+      this.getDicts("sys_company_or").then(response => {
+        this.orOptions = response.data;
+      });
+      this.getDicts("sys_sex").then(response => {
+        this.sexOptions = response.data;
+      });
+    },
+    methods: {
+      getDetails(orderId) {
+        this.item=null;
+        getHealthTongue(orderId).then(response => {
+          this.item = response.data;
+          if(response.data.typeJson!=null){
+            this.conditioningPlanJson=JSON.parse(response.data.typeJson)
+          };
+        });
+      },
+    }
+  }
+</script>
+<style>
+
+  .contentx{
+      height: 100%;
+      background-color: #fff;
+      padding: 0px 20px 20px;
+
+
+      margin: 20px;
+  }
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+  .el-descriptions-item__content {
+    max-width: 150px;
+    min-width: 100px;
+  }
+  .desct{
+      padding-top: 20px;
+      padding-bottom: 20px;
+      color: #524b4a;
+      font-weight: bold;
+    }
+</style>

+ 426 - 0
src/views/course/coursePlaySourceConfig/index.vue

@@ -0,0 +1,426 @@
+<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="appid" prop="appid">
+        <el-input
+          v-model="queryParams.appid"
+          placeholder="请输入appid"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['course:playSourceConfig:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['course:playSourceConfig:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['course:playSourceConfig:remove']"
+        >删除</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <!-- 开关配置对话框 -->
+    <el-dialog title="开关配置" :visible.sync="switchDialogVisible" width="500px" class="switch-dialog">
+      <el-form :model="switchForm" label-width="100px">
+        <el-form-item label="AppId">
+          <el-input v-model="switchForm.appId" :disabled="true"></el-input>
+        </el-form-item>
+        <el-form-item label="开关状态">
+          <el-switch
+            v-model="switchForm.switchStatus"
+            active-text="开启"
+            inactive-text="关闭"
+            active-value="001"
+            inactive-value="002">
+          </el-switch>
+        </el-form-item>
+        <el-form-item label="配置信息" v-if="switchForm.configInfo">
+          <el-input
+            type="textarea"
+            :rows="4"
+            v-model="switchForm.configInfo"
+            :disabled="true">
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+                <el-button @click="switchDialogVisible = false">取 消</el-button>
+                <el-button type="primary" @click="submitSwitchConfig">确 定</el-button>
+            </span>
+    </el-dialog>
+
+    <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="ID" align="center" prop="id" />
+      <el-table-column label="名称" align="center" prop="name" />
+      <el-table-column label="图标" align="center" prop="img">
+        <template slot-scope="scope">
+          <el-image
+            style="width: 80px; height: 80px"
+            :src="scope.row.img"
+            :preview-src-list="[scope.row.img]">
+          </el-image>
+        </template>
+      </el-table-column>
+      <el-table-column label="原始ID" align="center" prop="originalId" />
+      <el-table-column label="appId" align="center" prop="appid" />
+      <el-table-column label="secret" align="center" prop="secret" />
+      <el-table-column label="token" align="center" prop="token" />
+      <el-table-column label="aesKey" align="center" prop="aesKey" />
+      <el-table-column label="msgDataFormat" align="center" prop="msgDataFormat" />
+      <el-table-column label="类型" align="center" prop="type">
+        <template slot-scope="scope">
+          <dict-tag  :options="typesOptions" :value="scope.row.type"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="修改时间" align="center" prop="updateTime" />
+      <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:playSourceConfig:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['course:playSourceConfig:remove']"
+          >删除</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-setting"
+            @click="handleSwitchConfig(scope.row)"
+          >是否展示销售</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改点播配置对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
+        <el-form-item label="名称" prop="name">
+          <el-input v-model="form.name" placeholder="请输入名称" />
+        </el-form-item>
+        <el-form-item label="图标" prop="img">
+          <image-upload v-model="form.img" :file-type='["png", "jpg", "jpeg"]' :limit="1"/>
+        </el-form-item>
+        <el-form-item label="类型" prop="type">
+          <el-select
+            v-model="form.type"
+            placeholder="请选择类型">
+            <el-option
+              v-for="item in typesOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="原始id" prop="originalId">
+          <el-input v-model="form.originalId" placeholder="请输入原始id" />
+        </el-form-item>
+        <el-form-item label="appid" prop="appid">
+          <el-input v-model="form.appid" placeholder="请输入appid" />
+        </el-form-item>
+        <el-form-item label="secret" prop="secret">
+          <el-input v-model="form.secret" placeholder="请输入secret" />
+        </el-form-item>
+        <el-form-item label="token" prop="token">
+          <el-input v-model="form.token" placeholder="请输入token" />
+        </el-form-item>
+        <el-form-item label="aesKey" prop="aesKey">
+          <el-input v-model="form.aesKey" placeholder="请输入aesKey" />
+        </el-form-item>
+        <el-form-item label="msgDataFormat" prop="msgDataFormat">
+          <el-input v-model="form.msgDataFormat" placeholder="请输入msgDataFormat" />
+        </el-form-item>
+
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {list, get, update, add, del, updateIsTownOn} from '@/api/course/coursePlaySourceConfig'
+
+export default {
+  name: 'CoursePlaySourceConfig',
+  data() {
+    return {
+      switchDialogVisible: false,
+      switchForm: {
+        appId: '',
+        switchStatus: '001',
+      },
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        name: null,
+        appid: null
+      },
+      showSearch: true,
+      single: true,
+      multiple: true,
+      ids: [],
+      loading: false,
+      list: [],
+      total: 0,
+      typesOptions: [],
+      title: null,
+      open: false,
+      form: {},
+      rules: {
+        name: [
+          { required: true, message: "名称不能为空", trigger: "blur" }
+        ],
+        appid: [
+          { required: true, message: "appid不能为空", trigger: "blur" }
+        ],
+        img: [
+          { required: true, message: "图标不能为空", trigger: "blur" }
+        ],
+        type: [
+          { required: true, message: "类型不能为空", trigger: "blur" }
+        ],
+        originalId: [
+          { required: true, message: "原始id不能为空", trigger: "blur" }
+        ],
+        secret: [
+          { required: true, message: "secret不能为空", trigger: "blur" }
+        ],
+        token: [
+          { required: true, message: "token不能为空", trigger: "blur" }
+        ],
+        aesKey: [
+          { required: true, message: "aesKey不能为空", trigger: "blur" }
+        ],
+        msgDataFormat: [
+          { required: true, message: "msgDataFormat不能为空", trigger: "blur" }
+        ]
+      }
+    }
+  },
+  created() {
+    this.getDicts("play_source_type").then(response => {
+      this.typesOptions = response.data.map(item =>  {
+        return {
+        ...item,
+        listClass: 'primary'}
+      })
+    });
+    this.getList();
+  },
+  methods: {
+
+
+    // 处理开关配置
+    handleSwitchConfig(row) {
+      this.switchForm.appId = row.appid;
+      this.switchForm.switchStatus = "001"; // 默认关闭状态
+
+      // 调用接口获取开关状态
+      this.getSwitchConfig(row.appid);
+      this.switchDialogVisible = true;
+    },
+
+    // 获取开关配置
+    getSwitchConfig(appId) {
+      const params = {
+        appId: this.switchForm.appId
+      };
+      updateIsTownOn(params).then(response=>{
+        if (response.code === 200) {
+          if ( response.date){
+            this.switchForm.switchStatus = response.date;
+          }
+        } else {
+          this.$message.error('获取配置失败: ' + response.msg);
+        }
+      }).catch(error => {
+        this.$message.error('请求失败: ' + error.message);
+      });
+    },
+
+    // 提交开关配置
+    submitSwitchConfig() {
+      const params = {
+        appId: this.switchForm.appId,
+        bock: this.switchForm.switchStatus
+      };
+      updateIsTownOn(params).then(response=>{
+        if (response.code === 200) {
+          this.$message.success('配置更新成功');
+          this.switchDialogVisible = false;
+        } else {
+          this.$message.error('更新失败: ' + response.msg);
+        }
+      })
+    },
+
+
+    getList() {
+      this.loading = true;
+      list(this.queryParams).then(response => {
+        this.list = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.getList();
+    },
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = "添加点播配置"
+    },
+    handleUpdate(row) {
+      this.reset()
+      const id = row.id || this.ids
+      get(id).then(response => {
+        this.form = {
+          ...response.data,
+          type: response.data.type.toString()
+        }
+        this.open = true
+        this.title = "修改点播配置"
+      })
+    },
+    handleDelete(row) {
+      const id = row.id || this.ids
+      this.$confirm('是否确认删除点播配置编号为"' + id + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return del(id);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            update(this.form).then(response => {
+              const {code, msg} = response
+              if (code !== 200) {
+                this.msgError(msg)
+                return
+              }
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            add(this.form).then(response => {
+              const {code, msg} = response
+              if (code !== 200) {
+                this.msgError(msg)
+                return
+              }
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    reset() {
+      this.form = {
+        id: null,
+        name: null,
+        appid: null,
+        secret: null,
+        img: null,
+        originalId: null,
+        token: 'cbnd7lJvkripVOpyTFAna6NAWCxCrvC',
+        aesKey: 'HlEiBB55eaWUaeBVAQO3cWKWPYv1vOVQSq7nFNICw4E',
+        msgDataFormat: 'JSON',
+        type: '1'
+      }
+      this.resetForm("form");
+    }
+  },
+}
+</script>
+
+<style scoped>
+
+</style>

+ 4 - 0
src/views/course/courseUserStatistics/index.vue

@@ -311,6 +311,10 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择添加时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 531 - 151
src/views/course/courseUserStatistics/qw/index.vue

@@ -1,6 +1,43 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
+      <el-form-item label="部门" prop="type">
+        <treeselect
+          style="width: 220px"
+          :clearable="false"
+          v-model="queryParams.deptId"
+          :options="deptOptions"
+          clearable
+          :show-count="true"
+          placeholder="请选择归属部门"
+        />
+      </el-form-item>
+      <el-form-item label="所属客服" prop="companyUserId">
+        <el-select
+          v-model="queryParams.companyUserId"
+          clearable
+          filterable
+          remote
+          placeholder="请输入关键词"
+          :remote-method="loadCompanyUserOptions"
+          v-select-load-more="loadMoreCompanyUserOptions"
+          :loading="companyUserOptionsLoading"
+        >
+          <el-option
+            v-for="item in companyUserOptions"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="企微昵称" prop="nickName">
         <el-input
           v-model="queryParams.nickName"
@@ -10,144 +47,353 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+
       <el-form-item label="添加时间" prop="createTime">
-        <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
+        <el-date-picker
+          v-model="createTime"
+          size="small"
+          style="width: 220px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="change"
+        ></el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-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-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary height="600">
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['course:courseRedPacketLog:export']"
+          >导出</el-button
+        >
+      </el-col>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
+    </el-row>
+    <el-table
+      border
+      v-loading="loading"
+      :data="courseWatchLogList"
+      @selection-change="handleSelectionChange"
+      show-summary
+      :summary-method="getSummaries"
+      ref="table1"
+    >
       <el-table-column type="selection" width="55" align="center" />
-        <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
+      <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
+
+      <!-- 发课时间 -->
+      <el-table-column label="进线时间" align="center" prop="createTime" />
+      <!-- 进线数 -->
+      <el-table-column label="进线数" align="center" prop="line" />
+
+      <!-- 先导课上线 -->
+      <el-table-column label="先导课上线" align="center" prop="firstOnline">
+        <template slot-scope="scope">
+          <span>{{ scope.row.firstOnline }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor(
+                (scope.row.firstOnline / scope.row.line) * 100
+              ),
+            }"
+          >
+            ({{ ((scope.row.firstOnline / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 发课时间 -->
-            <el-table-column label="进线时间" align="center" prop="createTime"/>
-            <!-- 进线数 -->
-            <el-table-column label="进线数" align="center" prop="line" />
+      <!-- 先导课完课 -->
+      <el-table-column label="先导课完课" align="center" prop="firstOver">
+        <template slot-scope="scope">
+          <span>{{ scope.row.firstOver }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor(
+                (scope.row.firstOver / scope.row.line) * 100
+              ),
+            }"
+          >
+            ({{ ((scope.row.firstOver / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 先导课上线 -->
-            <el-table-column label="先导课上线" align="center" prop="firstOnline">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.firstOnline }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.firstOnline / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- 首日上线 -->
+      <el-table-column label="首日上线" align="center" prop="d1Online">
+        <template slot-scope="scope">
+          <span>{{ scope.row.d1Online }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor(
+                (scope.row.d1Online / scope.row.line) * 100
+              ),
+            }"
+          >
+            ({{ ((scope.row.d1Online / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 先导课完课 -->
-            <el-table-column label="先导课完课" align="center" prop="firstOver">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.firstOver }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.firstOver / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- 首日完课 -->
+      <el-table-column label="首日完课" align="center" prop="d1Over">
+        <template slot-scope="scope">
+          <span>{{ scope.row.d1Over }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor(
+                (scope.row.d1Over / scope.row.line) * 100
+              ),
+            }"
+          >
+            ({{ ((scope.row.d1Over / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 首日上线 -->
-            <el-table-column label="首日上线" align="center" prop="d1Online">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.d1Online }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.d1Online / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- 综合报名数 -->
+      <el-table-column label="综合报名数" align="center" prop="sign">
+        <template slot-scope="scope">
+          <span>{{ scope.row.sign }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor(
+                (scope.row.sign / scope.row.line) * 100
+              ),
+            }"
+          >
+            ({{ ((scope.row.sign / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 首日完课 -->
-            <el-table-column label="首日完课" align="center" prop="d1Over">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.d1Over }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.d1Over / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- 互动数 -->
+      <el-table-column label="互动数" align="center" prop="interact">
+        <template slot-scope="scope">
+          <span>{{ scope.row.interact }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor(
+                (scope.row.interact / scope.row.line) * 100
+              ),
+            }"
+          >
+            ({{ ((scope.row.interact / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 综合报名数 -->
-            <el-table-column label="综合报名数" align="center" prop="sign">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.sign }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.sign / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- A级客户 -->
+      <el-table-column label="A级客户" align="center" prop="a">
+        <template slot-scope="scope">
+          <span>{{ scope.row.a }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.a / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.a / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 互动数 -->
-            <el-table-column label="互动数" align="center" prop="interact">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.interact }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.interact / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- B级客户 -->
+      <el-table-column label="B级客户" align="center" prop="b">
+        <template slot-scope="scope">
+          <span>{{ scope.row.b }}</span>
 
-            <!-- A级客户 -->
-            <el-table-column label="A级客户" align="center" prop="a">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.a }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.a / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.b / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.b / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- B级客户 -->
-            <el-table-column label="B级客户" align="center" prop="b">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.b }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.b / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- C级客户 -->
+      <el-table-column label="C级客户" align="center" prop="c">
+        <template slot-scope="scope">
+          <span>{{ scope.row.c }}</span>
 
-            <!-- C级客户 -->
-            <el-table-column label="C级客户" align="center" prop="c">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.c }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.c / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.c / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.c / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- D级客户 -->
-            <el-table-column label="D级客户" align="center" prop="d">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.d }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.d / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- D级客户 -->
+      <el-table-column label="D级客户" align="center" prop="d">
+        <template slot-scope="scope">
+          <span>{{ scope.row.d }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.d / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.d / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 流失数 -->
-            <el-table-column label="流失数" align="center" prop="los">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.los }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.los / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- E级客户 -->
+      <el-table-column label="E级客户" align="center" prop="e">
+        <template slot-scope="scope">
+          <span>{{ scope.row.e }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.e / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.e / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
+      <!-- 流失数 -->
+      <el-table-column label="拉黑数" align="center" prop="black">
+        <template slot-scope="scope">
+          <span>{{ scope.row.black }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.black / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.black / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
 
-            <!-- 删除数 -->
-            <el-table-column label="删除数" align="center" prop="del">
-                <template slot-scope="scope">
-                    <span>{{ scope.row.del }}</span>
-                    <span style="font-size: 12px; color: #959595;margin-left: 5px;">({{ ((scope.row.del / scope.row.line) * 100).toFixed(2) }}%)</span>
-                </template>
-            </el-table-column>
+      <!-- 流失数 -->
+      <!--<el-table-column label="流失数" align="center" prop="los">
+        <template slot-scope="scope">
+          <span>{{ scope.row.los }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.los / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.los / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>-->
+
+      <!-- 删除数 -->
+      <el-table-column label="删除数" align="center" prop="del">
+        <template slot-scope="scope">
+          <span>{{ scope.row.del }}</span>
+          <span
+            :style="{
+              'font-size': '12px',
+              'margin-left': '5px',
+              color: getPercentageColor((scope.row.del / scope.row.line) * 100),
+            }"
+          >
+            ({{ ((scope.row.del / scope.row.line) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
     </el-table>
 
-    <pagination
-      v-show="total>0"
+    <pagination-more
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-
   </div>
 </template>
 
 <script>
-import { listCourseWatchLog, getCourseWatchLog, delCourseWatchLog, addCourseWatchLog, updateCourseWatchLog, exportCourseWatchLog,statisticsList,qwWatchLogStatisticsList } from "@/api/course/qw/courseWatchLog";
-import { courseList,videoList } from '@/api/course/courseRedPacketLog'
+import {
+  listCourseWatchLog,
+  getCourseWatchLog,
+  delCourseWatchLog,
+  addCourseWatchLog,
+  updateCourseWatchLog,
+  exportCourseWatchLog,
+  statisticsList,
+  qwWatchLogStatisticsList,
+  exportWatchLogStatistics
+} from "@/api/course/qw/courseWatchLog";
+import { courseList, videoList } from "@/api/course/courseRedPacketLog";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { getCompanyUserListLikeName } from "@/api/company/companyUser";
+import { getTask } from "@/api/common";
 export default {
   name: "CourseWatchLog",
+  components: { Treeselect },
   data() {
     return {
-      activeName:"00",
-      createTime:null,
-      courseLists:[],
-      videoList:[],
-      logTypeOptions:[],
+      activeName: "00",
+      createTime: null,
+      courseLists: [],
+      companyUserOptionsParams: {
+        name: undefined,
+        hasNextPage: false,
+        pageNum: 1,
+        pageSize: 10,
+      },
+      companyUserOptionsLoading: false,
+      companyUserOptions: [],
+      deptOptions: [],
+      videoList: [],
+      logTypeOptions: [],
       // 遮罩层
       loading: true,
       // 导出遮罩层
@@ -182,39 +428,136 @@ export default {
         companyUserId: null,
         companyId: null,
         courseId: null,
-        sTime:null,
-        eTime:null,
+        sTime: null,
+        eTime: null,
         scheduleStartTime: null,
         scheduleEndTime: null,
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      },
+      rules: {},
       scheduleTime: null,
     };
   },
   created() {
-    courseList().then(response => {
+    courseList().then((response) => {
       this.courseLists = response.list;
     });
-    this.getList();
-    this.getDicts("sys_course_watch_log_type").then(response => {
+
+    this.getDicts("sys_course_watch_log_type").then((response) => {
       this.logTypeOptions = response.data;
     });
+    this.getTreeselect();
+    this.getList();
   },
   methods: {
-    courseChange(row){
-      this.queryParams.videoId=null;
-      if(row === ''){
-        this.videoList=[];
-        return
+    getSummaries(param) {
+      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 (
+            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;
+    },
+    getPercentageColor(percentage) {
+      // HSL模式从黄色(60度)渐变到红色(0度)
+      const percent = Math.min(100, Math.max(0, parseFloat(percentage)));
+
+      // 调整色相范围:从深黄色(40°)渐变到红色(0°)
+      const hue = 40 - 40 * (percent / 100); // 初始 hue=40(深黄),终点 hue=0(红)
+
+      // 提高饱和度(100%),亮度保持 50%(鲜艳但不刺眼)
+      return `hsl(${hue}, 100%, 50%)`;
+    },
+    courseChange(row) {
+      this.queryParams.videoId = null;
+      if (row === "") {
+        this.videoList = [];
+        return;
       }
-      videoList(row).then(response => {
-        this.videoList=response.list
+      videoList(row).then((response) => {
+        this.videoList = response.list;
+      });
+    },
+    getTreeselect() {
+      var that = this;
+      var param = { companyId: this.companyId };
+      treeselect(param).then((response) => {
+        this.deptOptions = response.data;
+        console.log(this.deptOptions);
+        if (response.data != null && response.data.length > 0) {
+          //this.queryParams.deptId=response.data[0].id;
+        }
       });
     },
+    loadCompanyUserOptions(query) {
+      this.companyUserOptions = [];
+      if (query === "") {
+        return;
+      }
+
+      this.companyUserOptionsParams.pageNum = 1;
+      this.companyUserOptionsParams.name = query;
+      this.companyUserOptionsLoading = true;
+      this.getCompanyUserListLikeName();
+    },
+    getCompanyUserListLikeName() {
+      getCompanyUserListLikeName(this.companyUserOptionsParams).then(
+        (response) => {
+          this.companyUserOptions = [
+            ...this.companyUserOptions,
+            ...response.data.list,
+          ];
+          this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage;
+          this.companyUserOptionsLoading = false;
+        }
+      );
+    },
+    loadMoreCompanyUserOptions() {
+      if (!this.companyUserOptionsParams.hasNextPage) {
+        return;
+      }
+
+      this.companyUserOptionsParams.pageNum += 1;
+      this.getCompanyUserListLikeName();
+    },
     change() {
       if (this.createTime != null) {
         this.queryParams.sTime = this.createTime[0];
@@ -224,23 +567,28 @@ export default {
         this.queryParams.eTime = null;
       }
     },
-    handleClickX(tab,event){
-      this.activeName=tab.name;
-      if(tab.name=="00"){
-        this.queryParams.logType=null;
-      }else{
-        this.queryParams.logType=tab.name;
+    handleClickX(tab, event) {
+      this.activeName = tab.name;
+      if (tab.name == "00") {
+        this.queryParams.logType = null;
+      } else {
+        this.queryParams.logType = tab.name;
       }
-      this.getList()
+      this.getList();
     },
     /** 查询短链课程看课记录列表 */
     getList() {
       this.loading = true;
-      qwWatchLogStatisticsList(this.queryParams).then(response => {
+      qwWatchLogStatisticsList(this.queryParams).then((response) => {
         this.courseWatchLogList = response.rows;
         this.total = response.total;
         this.loading = false;
       });
+      this.$nextTick(() => {
+        setTimeout(() => {
+          this.$refs.table1?.doLayout();
+        }, 2000);
+      });
     },
     // 取消按钮
     cancel() {
@@ -261,12 +609,16 @@ export default {
         qwUserId: null,
         companyUserId: null,
         companyId: null,
-        courseId: null
+        courseId: null,
       };
       this.resetForm("form");
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择添加时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },
@@ -283,9 +635,9 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.logId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.logId);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -296,8 +648,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const logId = row.logId || this.ids
-      getCourseWatchLog(logId).then(response => {
+      const logId = row.logId || this.ids;
+      getCourseWatchLog(logId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改短链课程看课记录";
@@ -305,16 +657,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.logId != null) {
-            updateCourseWatchLog(this.form).then(response => {
+            updateCourseWatchLog(this.form).then((response) => {
               this.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addCourseWatchLog(this.form).then(response => {
+            addCourseWatchLog(this.form).then((response) => {
               this.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -326,31 +678,59 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const logIds = row.logId || this.ids;
-      this.$confirm('是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?', "警告", {
+      this.$confirm(
+        '是否确认删除短链课程看课记录编号为"' + logIds + '"的数据项?',
+        "警告",
+        {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
+          type: "warning",
+        }
+      )
+        .then(function () {
           return delCourseWatchLog(logIds);
-        }).then(() => {
+        })
+        .then(() => {
           this.getList();
           this.msgSuccess("删除成功");
-        }).catch(() => {});
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
+      let that = this;
       const queryParams = this.queryParams;
-      this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
+      this.$confirm("是否确认导出所有进线客户统计记录数据项?", "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
           this.exportLoading = true;
-          return exportCourseWatchLog(queryParams);
-        }).then(response => {
-          this.download(response.msg);
+          // return exportCourseWatchLog(queryParams);
+         return  exportWatchLogStatistics(queryParams);
+        })
+        .then((response) => {
+          console.log(response);
+          if (response.code == 200) {
+            that.msgSuccess(response.msg);
+            that.taskId = response.data;
+            that.time = setInterval(function () {
+              //查订单
+              getTask(that.taskId).then((res) => {
+                if (res.data.status == 1) {
+                  that.exportLoading = false;
+                  clearTimeout(that.time);
+                  that.time = null;
+                  that.download(res.data.fileUrl);
+                }
+              });
+            }, 10000);
+          }
+        })
+        .catch(() => {
           this.exportLoading = false;
-        }).catch(() => {});
+        });
     },
     handleScheduleTimeChange(val) {
       if (val) {
@@ -361,6 +741,6 @@ export default {
         this.queryParams.scheduleEndTime = null;
       }
     },
-  }
+  },
 };
 </script>

+ 4 - 0
src/views/course/courseUserStatistics/qw/statistics.vue

@@ -581,6 +581,10 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+    if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择添加时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 4 - 0
src/views/course/courseUserStatistics/statistics.vue

@@ -626,6 +626,10 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if (!this.queryParams.sTime || !this.queryParams.eTime) {
+        this.$message.warning("请选择添加时间");
+        return;
+      }
       this.queryParams.pageNum = 1;
       this.getList();
     },

+ 3 - 3
src/views/course/courseWatchLog/deptWatchLog.vue

@@ -35,9 +35,9 @@
                    :loading="companyUserOptionsLoading">
           <el-option
             v-for="item in companyUserOptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value">
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue">
           </el-option>
         </el-select>
       </el-form-item>

+ 177 - 8
src/views/course/courseWatchLog/index.vue

@@ -11,7 +11,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="会员昵称" prop="nickName">
+      <el-form-item label="会员昵称" prop="nickName" v-if="queryParams.sendType == 1">
         <el-input
           v-model="queryParams.nickName"
           placeholder="请输入会员昵称"
@@ -20,19 +20,19 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="企微客户昵称" prop="nickName" >
+      <el-form-item label="会员id" prop="userId" v-if="queryParams.sendType == 1">
         <el-input
-          v-model="queryParams.externalUserName"
-          placeholder="请输入企微客户昵称"
+          v-model="queryParams.userId"
+          placeholder="请输入会员昵称"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="所属销售" prop="companyUserName">
+      <el-form-item label="企微客户昵称" prop="nickName" v-if="queryParams.sendType == 2">
         <el-input
-          v-model="queryParams.companyUserName"
-          placeholder="请输入所属销售"
+          v-model="queryParams.externalUserName"
+          placeholder="请输入企微客户昵称"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
@@ -58,6 +58,40 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="所属销售" prop="companyUserId">
+        <el-select v-model="queryParams.companyUserId" clearable filterable remote
+                   placeholder="请输入关键词" :remote-method="loadCompanyUserOptions"
+                   v-select-load-more="loadMoreCompanyUserOptions"
+                   :loading="companyUserOptionsLoading">
+          <el-option
+            v-for="item in companyUserOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue">
+          </el-option>
+        </el-select>
+      </el-form-item>
+    <!-- sop名称 -->
+    <el-form-item label="SOP名称" prop="sopId" v-if="queryParams.sendType == 2">
+      <el-autocomplete
+        v-model="sopSearchText"
+        :fetch-suggestions="querySopAsync"
+        placeholder="请输入SOP名称"
+        clearable
+        size="small"
+        style="width: 200px"
+        @select="handleSopSelect"
+        @clear="handleSopClear"
+        :trigger-on-focus="false"
+      >
+        <template slot-scope="{ item }">
+          <div class="sop-item">
+            <span class="sop-name">{{ item.name }}</span>
+          </div>
+        </template>
+      </el-autocomplete>
+    </el-form-item>
+
       <!-- 营期时间 -->
       <el-form-item label="营期时间" prop="scheduleTime">
         <el-input
@@ -122,6 +156,20 @@
           :key="qecCalendarKey"
         />
       </el-form-item>
+      <el-form-item label="是否为会员" prop="isVip">
+        <el-select
+          filterable
+          v-model="queryParams.isVip"
+          placeholder="请选择是否为会员"
+          clearable size="small">
+          <el-option
+            v-for="dict in isVipList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
 
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -442,6 +490,8 @@ import {searchTags} from "../../../api/qw/tag";
 import {addTagByWatch, delTagByWatch} from "../../../api/qw/externalContact";
 import Vue from 'vue'
 import Calendar from 'vue-mobile-calendar'
+import {infoSop} from "@/api/qw/sop";
+import {getCompanyUserListLikeName} from "../../../api/company/companyUser";
 Vue.use(Calendar)
 
 export default {
@@ -565,6 +615,14 @@ export default {
         pageSize: 10,
       },
 
+      isVipList: [
+        { dictLabel: '是', dictValue: 1 },
+        { dictLabel: '否', dictValue: 0 }
+      ],
+
+      // SOP搜索相关
+      sopSearchText: '', // SOP搜索框显示的文本
+      selectedSopId: null, // 选中的SOP ID
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -589,12 +647,23 @@ export default {
         scheduleStartTime: null,
         scheduleEndTime: null,
         sendType:process.env.VUE_APP_COURSE_DEFAULT,
+        isVip: null,
+        sopId: null, // sopId
       },
       // 表单参数
       form: {},
       // 表单校验
       rules: {
       },
+      // 员工选项列表
+      companyUserOptionsParams: {
+        name: undefined,
+        hasNextPage: false,
+        pageNum: 1,
+        pageSize: 10
+      },
+      companyUserOptions: [],
+      companyUserOptionsLoading: false,
     };
   },
   created() {
@@ -603,10 +672,48 @@ export default {
     });
     this.getList();
     this.getDicts("sys_course_watch_log_type").then(response => {
-      this.logTypeOptions = response.data.filter(item => item.dictLabel !== "待看课");
+      this.logTypeOptions = response.data;
     });
   },
   methods: {
+    /**
+     * 根据名称模糊查询用户列表
+     * @param query 参数
+     */
+    loadCompanyUserOptions(query) {
+      this.companyUserOptions = [];
+      if (query === '') {
+        return;
+      }
+
+      this.companyUserOptionsParams.pageNum = 1
+      this.companyUserOptionsParams.name = query
+      this.companyUserOptionsLoading = true;
+      this.getCompanyUserListLikeName()
+    },
+    /**
+     * 加载更多员工选项
+     */
+    loadMoreCompanyUserOptions() {
+      if (!this.companyUserOptionsParams.hasNextPage) {
+        return;
+      }
+
+      this.companyUserOptionsParams.pageNum += 1
+      this.getCompanyUserListLikeName()
+    },
+
+    /**
+     * 获取员工列表
+     */
+    getCompanyUserListLikeName() {
+      getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
+        this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
+        this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
+        this.companyUserOptionsLoading = false;
+      });
+    },
+
     // 重置日历组件
     resetCalendars() {
       this.scheduleTime = [];
@@ -790,6 +897,10 @@ export default {
       this.queryParams.qecETime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
+      this.queryParams.sopId = null; // 重置SOP ID
+
+      // 重置SOP搜索
+      this.handleSopClear();
 
       // 统一重置日历组件
       this.resetCalendars();
@@ -1097,6 +1208,53 @@ export default {
       };
     },
 
+    /**
+     * 异步查询SOP列表
+     * @param {string} queryString - 查询字符串
+     * @param {function} callback - 回调函数
+     */
+    querySopAsync(queryString, callback) {
+      if (!queryString) {
+        callback([]);
+        return;
+      }
+
+      infoSop({ name: queryString }).then(response => {
+        if (response && response.rows) {
+          const suggestions = response.rows.map(item => ({
+            value: item.name,
+            id: item.id,
+            name: item.name
+          }));
+          callback(suggestions);
+        } else {
+          callback([]);
+        }
+      }).catch(error => {
+        console.error('通过sop查询失败:', error);
+        callback([]);
+      });
+    },
+
+    /**
+     * 选择SOP
+     * @param {object} item - 选中的SOP项
+     */
+    handleSopSelect(item) {
+      this.selectedSopId = item.id;
+      this.queryParams.sopId = item.id;
+      this.sopSearchText = item.name;
+    },
+
+    /**
+     * 清空SOP选择
+     */
+    handleSopClear() {
+      this.selectedSopId = null;
+      this.queryParams.sopId = null;
+      this.sopSearchText = '';
+    },
+
   }
 };
 </script>
@@ -1143,6 +1301,17 @@ export default {
   margin-left: 10px;
 }
 
+/* SOP搜索框样式 */
+.sop-item {
+  display: flex;
+  align-items: center;
+}
+
+.sop-name {
+  font-size: 14px;
+  color: #606266;
+}
+
 
 
 .button-new-tag {

+ 4 - 4
src/views/course/courseWatchLog/statistics.vue

@@ -21,10 +21,10 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="企微昵称" prop="nickName">
+      <el-form-item label="销售昵称" prop="nickName">
         <el-input
           v-model="queryParams.nickName"
-          placeholder="请输入企微昵称"
+          placeholder="请输入销售昵称"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
@@ -41,7 +41,7 @@
 
     <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange"  show-summary>
       <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
+      <el-table-column label="销售昵称" align="center" prop="qwUserName" />
       <el-table-column label="发课时间" align="center" prop="createTime"/>
       <el-table-column label="课程名称" align="center" prop="courseName" />
       <el-table-column label="小节名称" align="center" prop="videoName" />
@@ -49,7 +49,7 @@
       <el-table-column label="看课中" align="center" prop="type1" />
       <el-table-column label="已完课" align="center" prop="type2" />
       <el-table-column label="看课中断" align="center" prop="type4" />
-
+      <el-table-column label="上线数" align="center" prop="onLineNum" />
 
     </el-table>
 

+ 154 - 39
src/views/course/courseWatchLog/watchLog.vue

@@ -11,7 +11,7 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="企微账号" prop="qwUserId">
+      <el-form-item label="企微账号" prop="qwUserId" v-if="queryParams.sendType == 2">
         <el-select v-model="queryParams.qwUserId" placeholder="企微账号" clearable size="small"
                    @change="updateQwuser()">
           <el-option
@@ -22,34 +22,34 @@
           />
         </el-select>
       </el-form-item>
-      <el-form-item label="客户ID" prop="qwExternalContactId">
+      <el-form-item label="客户ID" prop="qwExternalContactId" v-if="queryParams.sendType == 2">
         <el-input
           v-model="queryParams.qwExternalContactId"
-          placeholder="请输入会员ID"
+          placeholder="请输入客户ID"
           clearable
           size="small"
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-<!--      <el-form-item label="会员ID" prop="userId">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.userId"-->
-<!--          placeholder="请输入会员ID"-->
-<!--          clearable-->
-<!--          size="small"-->
-<!--          @keyup.enter.native="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-<!--      <el-form-item label="会员昵称" prop="nickName">-->
-<!--        <el-input-->
-<!--          v-model="queryParams.nickName"-->
-<!--          placeholder="请输入会员昵称"-->
-<!--          clearable-->
-<!--          size="small"-->
-<!--          @keyup.enter.native="handleQuery"-->
-<!--        />-->
-<!--      </el-form-item>-->
-      <el-form-item label="企微客户昵称" prop="nickName">
+     <el-form-item label="会员ID" prop="userId" v-if="queryParams.sendType == 1">
+       <el-input
+         v-model="queryParams.userId"
+         placeholder="请输入会员ID"
+         clearable
+         size="small"
+         @keyup.enter.native="handleQuery"
+       />
+     </el-form-item>
+     <el-form-item label="会员昵称" prop="nickName" v-if="queryParams.sendType == 1">
+       <el-input
+         v-model="queryParams.nickName"
+         placeholder="请输入会员昵称"
+         clearable
+         size="small"
+         @keyup.enter.native="handleQuery"
+       />
+     </el-form-item>
+      <el-form-item label="企微客户昵称" prop="nickName" v-if="queryParams.sendType == 2">
         <el-input
           v-model="queryParams.externalUserName"
           placeholder="请输入企微客户昵称"
@@ -79,6 +79,27 @@
           />
         </el-select>
       </el-form-item>
+
+      <!-- sop名称 -->
+      <el-form-item label="SOP名称" prop="sopId" v-if="queryParams.sendType == 2">
+        <el-autocomplete
+          v-model="sopSearchText"
+          :fetch-suggestions="querySopAsync"
+          placeholder="请输入SOP名称"
+          clearable
+          size="small"
+          style="width: 200px"
+          @select="handleSopSelect"
+          @clear="handleSopClear"
+          :trigger-on-focus="false"
+        >
+          <template slot-scope="{ item }">
+            <div class="sop-item">
+              <span class="sop-name">{{ item.name }}</span>
+            </div>
+          </template>
+        </el-autocomplete>
+      </el-form-item>
       <!-- 营期时间 -->
       <el-form-item label="营期时间" prop="scheduleTime">
         <el-input
@@ -143,6 +164,20 @@
           :key="qecCalendarKey"
         />
       </el-form-item>
+      <el-form-item label="是否为会员" prop="isVip">
+        <el-select
+          filterable
+          v-model="queryParams.isVip"
+          placeholder="请选择是否为会员"
+          clearable size="small">
+          <el-option
+            v-for="dict in isVipList"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
 
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -191,26 +226,28 @@
     <el-table border v-loading="loading" :data="courseWatchLogList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center"/>
       <el-table-column label="记录编号" align="center" prop="logId"/>
-<!--      <el-table-column label="客户昵称" align="center" prop="externalUserName"/>-->
-
-<!--&lt;!&ndash;      <el-table-column label="会员ID" align="center" prop="userId"/>&ndash;&gt;-->
-<!--      <el-table-column label="客户头像" align="center" prop="externalUserAvatar">-->
-<!--        <template slot-scope="scope">-->
-<!--          <el-popover-->
-<!--            placement="right"-->
-<!--            title=""-->
-<!--            trigger="hover">-->
-<!--            <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">-->
-<!--            <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">-->
-<!--          </el-popover>-->
-<!--        </template>-->
-<!--      </el-table-column>-->
-      <el-table-column label="用户昵称" align="center">
+     <el-table-column label="客户昵称" align="center" prop="externalUserName" v-if="queryParams.sendType == 2"/>
+
+      &lt;!&ndash;
+      <el-table-column label="会员ID" align="center" prop="userId" v-if="queryParams.sendType == 1"/>
+      &ndash;&gt;
+     <el-table-column label="客户头像" align="center" prop="externalUserAvatar" v-if="queryParams.sendType == 2">
+       <template slot-scope="scope">
+         <el-popover
+           placement="right"
+           title=""
+           trigger="hover">
+           <img slot="reference" :src="scope.row.externalUserAvatar" style="width: 50px;height: 50px">
+           <img :src="scope.row.externalUserAvatar" style="max-width: 200px;max-height: 200px">
+         </el-popover>
+       </template>
+     </el-table-column>
+      <el-table-column label="用户昵称" align="center" v-if="queryParams.sendType == 1">
         <template slot-scope="scope">
           {{ queryParams.sendType=='1' ? scope.row.fsNickName : scope.row.externalUserName }}
         </template>
       </el-table-column>
-      <el-table-column label="头像" align="center">
+      <el-table-column label="头像" align="center" v-if="queryParams.sendType == 1">
         <template slot-scope="scope">
           <img v-if="queryParams.sendType=='1'" :src="scope.row.fsAvatar" style="width:50px;height:50px" />
           <img v-else :src="scope.row.externalUserAvatar" style="width:50px;height:50px" />
@@ -461,6 +498,7 @@ import {addTagByWatch, delTagByWatch} from "../../../api/qw/externalContact";
 import {allListTagGroup} from "../../../api/qw/tagGroup";
 import Vue from 'vue'
 import Calendar from 'vue-mobile-calendar'
+import {infoSop} from "@/api/qw/sop";
 Vue.use(Calendar)
 
 export default {
@@ -586,6 +624,14 @@ export default {
         corpId:null,
       },
 
+      isVipList: [
+        { dictLabel: '是', dictValue: 1 },
+        { dictLabel: '否', dictValue: 0 }
+      ],
+
+      // SOP搜索相关
+      sopSearchText: '', // SOP搜索框显示的文本
+      selectedSopId: null, // 选中的SOP ID
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -610,6 +656,8 @@ export default {
         scheduleStartTime: null,
         scheduleEndTime: null,
         sendType:process.env.VUE_APP_COURSE_DEFAULT,
+        isVip: null,
+        sopId: null, // sopId
       },
       // 表单参数
       form: {},
@@ -623,7 +671,7 @@ export default {
     });
     this.getList();
     this.getDicts("sys_course_watch_log_type").then(response => {
-      this.logTypeOptions = response.data.filter(item => item.dictLabel !== "待看课");
+      this.logTypeOptions = response.data;
     });
 
     this.getDicts("sys_company_or").then(response => {
@@ -634,6 +682,11 @@ export default {
     });
   },
   methods: {
+
+    handleSendTypeChange() {
+      this.handleQuery(); // 重新查询列表
+    },
+
     // 重置日历组件
     resetCalendars() {
       this.scheduleTime = [];
@@ -824,6 +877,10 @@ export default {
       this.queryParams.qecETime = null;
       this.queryParams.scheduleStartTime = null;
       this.queryParams.scheduleEndTime = null;
+      this.queryParams.sopId = null; // 重置SOP ID
+
+      // 重置SOP搜索
+      this.handleSopClear();
       // 统一重置日历组件
       this.resetCalendars();
 
@@ -1124,6 +1181,53 @@ export default {
         tagIds:[]
       };
     },
+
+    /**
+     * 异步查询SOP列表
+     * @param {string} queryString - 查询字符串
+     * @param {function} callback - 回调函数
+     */
+    querySopAsync(queryString, callback) {
+      if (!queryString) {
+        callback([]);
+        return;
+      }
+
+      infoSop({ name: queryString }).then(response => {
+        if (response && response.rows) {
+          const suggestions = response.rows.map(item => ({
+            value: item.name,
+            id: item.id,
+            name: item.name
+          }));
+          callback(suggestions);
+        } else {
+          callback([]);
+        }
+      }).catch(error => {
+        console.error('通过sop查询失败:', error);
+        callback([]);
+      });
+    },
+
+    /**
+     * 选择SOP
+     * @param {object} item - 选中的SOP项
+     */
+    handleSopSelect(item) {
+      this.selectedSopId = item.id;
+      this.queryParams.sopId = item.id;
+      this.sopSearchText = item.name;
+    },
+
+    /**
+     * 清空SOP选择
+     */
+    handleSopClear() {
+      this.selectedSopId = null;
+      this.queryParams.sopId = null;
+      this.sopSearchText = '';
+    },
   }
 };
 </script>
@@ -1199,4 +1303,15 @@ export default {
   background: rgba(0, 0, 0, 0.2);
   border-radius: 3px;
 }
+
+/* SOP搜索框样式 */
+.sop-item {
+  display: flex;
+  align-items: center;
+}
+
+.sop-name {
+  font-size: 14px;
+  color: #606266;
+}
 </style>

+ 662 - 0
src/views/crm/components/assistUser.vue

@@ -0,0 +1,662 @@
+<template>
+    <div>
+        <el-form label-position="left" ref="assistForm" :model="assistForm"  label-width="120px" v-if="!flag">
+            <el-form-item label="未添加协作客户" >
+                <span>{{this.noAssistCount}}个</span>
+            </el-form-item>
+            <el-form-item label="未添加协作客户" >
+                <span>{{this.assistCount}}个</span>
+            </el-form-item>
+
+            <el-form-item label="协作人" prop="users" label-width="60px">
+                <el-row :gutter="10" class="mb8">
+                    <el-col :span="1.5">
+                        <el-button @click="handleUserSelect">添加协作人</el-button>
+                    </el-col>
+                </el-row>
+            </el-form-item>
+            <el-form-item  label-width="0">
+                <el-table border  :data="users">
+                    <el-table-column label="ID" align="center" prop="userId"/>
+                    <el-table-column label="员工帐号" align="center" prop="userName" width="100px"/>
+                    <el-table-column label="员工姓名" align="center" prop="nickName" />
+                    <el-table-column label="所属部门" align="center" prop="deptName"/>
+                    <el-table-column label="添加数量" align="center"  prop="count" width="150px" v-if="!flag">
+                        <template slot-scope="scope">
+                            <div>
+                                <el-input-number ref="stepTxtNum" :min="0" v-model="scope.row.count"  @change="changeVal(scope.row)"   size="mini"   ></el-input-number>
+                            </div>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="操作"   align="center" fixed="right"  width="60px" class-name="small-padding fixed-width">
+                        <template slot-scope="scope">
+                            <el-button
+                            size="mini"
+                            type="text"
+                            @click="handleRemoveUser(scope.row.$index)"
+                            >删除</el-button>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </el-form-item>
+        </el-form>
+        <div   class="footer" v-if="!flag">
+            <el-button type="primary" @click="submitAssistForm">确 定</el-button>
+        </div>
+        <el-dialog :title="userSelect.title" :visible.sync="userSelect.open" width="1000px" append-to-body>
+            <user-select ref="userSelects" @selectUser="selectUser"  ></user-select>
+        </el-dialog>
+
+        <!-- 手动分佣模式 -->
+        <el-form label-position="left" ref="assistForm2" :model="assistForm2"  label-width="120px" v-if="flag">
+            <el-form-item  label-width="0">
+                <div v-for="(customer, customerIndex) in customers" :key="customer.customerId || customerIndex" class="customer-section">
+                    <el-card class="customer-card" shadow="hover">
+                        <div slot="header" class="customer-header">
+                            <span class="customer-title">
+                                <strong>{{ customer.customerName }}</strong>
+                                <span class="customer-code">({{ customer.customerCode }})</span>
+                            </span>
+                            <el-button
+                                size="mini"
+                                type="primary"
+                                @click="handleAddCollaborator(customerIndex)"
+                                icon="el-icon-plus">
+                                添加协作人
+                            </el-button>
+                        </div>
+
+                        <div class="collaborator-content">
+                            <el-table
+                                :data="customer.collaborators"
+                                border
+                                size="small"
+                                v-if="customer.collaborators && customer.collaborators.length > 0">
+                                <el-table-column label="员工姓名" align="center" prop="companyUserName" width="100px"/>
+                                <el-table-column label="员工ID" align="center" prop="companyUserId" width="80px"/>
+                                <el-table-column label="分佣比例(%)" align="center" width="160px">
+                                    <template slot-scope="scope">
+                                        <el-input-number
+                                            v-model="scope.row.rate"
+                                            :min="0"
+                                            :max="100"
+                                            size="mini"
+                                            @input="handleRateChange(customerIndex, scope.$index, scope.row)">
+                                        </el-input-number>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column label="状态" align="center" width="80px">
+                                    <template slot-scope="scope">
+                                        <el-tag :type="scope.row.isNew ? 'success' : 'info'" size="mini">
+                                            {{ scope.row.isNew ? '新增' : '原有' }}
+                                        </el-tag>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column label="操作" align="center" width="80px">
+                                    <template slot-scope="scope">
+                                        <el-button
+                                            size="mini"
+                                            type="text"
+                                            @click="handleRemoveCollaborator(customerIndex, scope.$index)">
+                                            删除
+                                        </el-button>
+                                    </template>
+                                </el-table-column>
+                            </el-table>
+
+                            <div v-else class="no-collaborator">
+                                <i class="el-icon-user" style="font-size: 48px; color: #ddd;"></i>
+                                <p>暂无协作人员</p>
+                            </div>
+
+                            <!-- 分佣比例汇总 -->
+                            <div class="rate-summary-container">
+                                <div class="rate-summary">
+                                    <div class="rate-item">
+                                        <span class="rate-label">协作人员总分佣比例:</span>
+                                        <span :class="getTotalRateClass(customerIndex)">
+                                            {{ getTotalRate(customerIndex) }}%
+                                        </span>
+                                        <span v-if="getTotalRate(customerIndex) > 100" class="rate-warning">
+                                            (超出100%,请调整)
+                                        </span>
+                                    </div>
+                                    <div class="rate-item owner-rate">
+                                        <span class="rate-label">本人佣金比例:</span>
+                                        <span :class="getOwnerRateClass(customerIndex)">
+                                            {{ getOwnerRate(customerIndex) }}%
+                                        </span>
+                                        <span v-if="getOwnerRate(customerIndex) < 0" class="rate-warning">
+                                            (协作人员分佣超出100%,请调整)
+                                        </span>
+                                    </div>
+                                    <div class="rate-item total-check" v-if="customer.collaborators && customer.collaborators.length > 0">
+                                        <span class="rate-label">总计:</span>
+                                        <span class="rate-total">
+                                            {{ getTotalRate(customerIndex) + getOwnerRate(customerIndex) }}%
+                                        </span>
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+                    </el-card>
+                </div>
+            </el-form-item>
+        </el-form>
+
+        <div class="footer" v-if="flag">
+            <el-button @click="$emit('close')">取 消</el-button>
+            <el-button type="primary" @click="submitAssistForm2" :loading="submitLoading">确 定</el-button>
+        </div>
+    </div>
+</template>
+
+<script>
+import { assistToUser,selectByCustomerIds,allOperation } from "@/api/crm/customer";
+import userSelect from '../../company/components/userSelect.vue';
+export default {
+    components: {userSelect },
+    name: "visit",
+    data() {
+        return {
+            originalCollaborators: {}, // 确保初始化为空对象
+            flag:false,
+            noAssistCount:0,
+            assistCount:0,
+            customerIds:[],
+            currentCustomerIndex: -1,
+            submitLoading: false,
+            userSelect:{
+                title:"选择员工",
+                open:false,
+            },
+            assistForm: {
+            },
+            assistForm2:{},
+            // 表单校验
+            assistRules: {
+
+            },
+            users:[],
+            customers:[]
+
+        };
+    },
+    created() {
+
+    },
+    methods: {
+         // 检查并更新所有协作者的操作状态
+         checkAndUpdateOperations() {
+            // 确保 originalCollaborators 存在
+            if (!this.originalCollaborators) {
+                this.originalCollaborators = {};
+            }
+            this.customers.forEach(customer => {
+                if (customer.collaborators) {
+                    customer.collaborators.forEach(collaborator => {
+                        if (collaborator.id && (!collaborator.operation || collaborator.operation === 'NONE')) {
+                            const originalKey = `${collaborator.customerId}_${collaborator.companyUserId}`;
+                            const originalCollaborator = this.originalCollaborators[originalKey];
+
+                            if (originalCollaborator &&
+                                (originalCollaborator.rate !== collaborator.rate ||
+                                 originalCollaborator.remark !== (collaborator.remark || ''))) {
+                                collaborator.operation = 'UPDATE';
+                            } else if (!originalCollaborator && collaborator.id) {
+                                // 如果找不到原始数据但有ID,说明可能是数据加载问题,标记为UPDATE
+                                collaborator.operation = 'UPDATE';
+                            }
+                        }
+                    });
+                }
+            });
+        },
+         // 处理分佣比例变化
+         handleRateChange(customerIndex, collaboratorIndex, collaborator) {
+            // 确保 originalCollaborators 存在
+            if (!this.originalCollaborators) {
+                this.originalCollaborators = {};
+            }
+            // 如果是原有协作者且分佣比例发生变化,标记为UPDATE
+            if (collaborator.operation === 'NONE' || !collaborator.operation) {
+                const originalKey = `${collaborator.customerId}_${collaborator.companyUserId}`;
+                const originalCollaborator = this.originalCollaborators[originalKey];
+
+
+
+                if (originalCollaborator) {
+                    // 检查分佣比例或备注是否发生变化
+                    if (originalCollaborator.rate !== collaborator.rate ||
+                        originalCollaborator.remark !== (collaborator.remark || '')) {
+                        collaborator.operation = 'UPDATE';
+                    }
+                } else {
+                    // 如果找不到原始数据,但有id,说明是原有数据,标记为UPDATE
+                    if (collaborator.id) {
+                        collaborator.operation = 'UPDATE';
+                    }
+                }
+            }
+
+            this.validateTotalRate(customerIndex);
+        },
+        validateTotalRate(customerIndex) {
+            const total = this.getTotalRate(customerIndex);
+            const ownerRate = this.getOwnerRate(customerIndex);
+
+            if(total > 100) {
+                this.$message.warning(`客户 ${this.customers[customerIndex].customerName} 的协作人员总分佣比例不能超过100%`);
+            } else if(ownerRate < 10) {
+                this.$message.warning(`客户 ${this.customers[customerIndex].customerName} 的本人佣金比例过低,建议调整协作人员分佣比例`);
+            }
+        },
+        // 获取本人佣金比例(100% - 协作人员总分佣比例)
+        getOwnerRate(customerIndex) {
+            const collaboratorTotalRate = this.getTotalRate(customerIndex);
+            return Math.max(0, 100 - collaboratorTotalRate);
+        },
+        // 获取本人佣金比例的样式类
+        getOwnerRateClass(customerIndex) {
+            const ownerRate = this.getOwnerRate(customerIndex);
+            if(ownerRate < 0) return 'rate-error';
+            if(ownerRate === 0) return 'rate-warning';
+            return 'rate-success';
+        },
+        getTotalRateClass(customerIndex) {
+            const total = this.getTotalRate(customerIndex);
+            if(total > 100) return 'rate-error';
+            if(total === 100) return 'rate-success';
+            return 'rate-normal';
+        },
+        handleAddCollaborator(customerIndex) {
+            // 为特定客户添加协作人
+            this.currentCustomerIndex = customerIndex;
+            var that = this;
+            this.userSelect.open = true;
+            setTimeout(() => {
+                that.$refs.userSelects.getList();
+            }, 500);
+        },
+        handleRemoveCollaborator(customerIndex, collaboratorIndex) {
+            const customer = this.customers[customerIndex];
+            const collaborator = customer.collaborators[collaboratorIndex];
+            if (collaborator.operation === 'ADD') {
+                // 如果是新增的协作者,直接从列表中移除
+                customer.collaborators.splice(collaboratorIndex, 1);
+            } else {
+                // 如果是原有的协作者,标记为删除但不从列表中移除
+                collaborator.operation = 'DELETE';
+                // 可以选择隐藏已删除的项目或者用特殊样式显示
+                // 这里我们从界面上移除,但在提交时会包含删除操作
+                customer.collaborators.splice(collaboratorIndex, 1);
+
+                // 将删除的协作者添加到待删除列表中
+                if (!customer.deletedCollaborators) {
+                    this.$set(customer, 'deletedCollaborators', []);
+                }
+                customer.deletedCollaborators.push(collaborator);
+            }
+        },
+        getTotalRate(customerIndex) {
+            const customer = this.customers[customerIndex];
+            if(!customer.collaborators) return 0;
+
+            return customer.collaborators.reduce((total, collaborator) => {
+                // 只计算未删除的协作者
+                if (collaborator.operation !== 'DELETE') {
+                    return total + (collaborator.rate || 0);
+                }
+                return total;
+            }, 0);
+        },
+        async loadCustomerCollaborators() {
+            // 确保 originalCollaborators 存在
+            if (!this.originalCollaborators) {
+                this.originalCollaborators = {};
+            }
+
+            // 加载每个客户的协作者信息
+            let customerIds = this.customers.map(customer => customer.customerId || null);
+            this.customerIds = customerIds;
+
+            if(customerIds && customerIds.length > 0){
+                try {
+                    //查询用户分佣信息
+                    selectByCustomerIds(customerIds).then(response => {
+                        if(response && response.code == 200){
+                            // 清空原始数据
+                            this.originalCollaborators = {};
+
+                            // 遍历每个客户,匹配对应的协作者数据
+                            this.customers.forEach(customer => {
+                                // 查找当前客户的协作者数据
+                                const customerData = response.data.find(item => item.customerId === customer.customerId);
+
+                                if(customerData && customerData.assistList && customerData.assistList.length > 0) {
+                                    // 将协作者数据转换为组件需要的格式
+                                    const collaborators = customerData.assistList.map(item => {
+                                        const collaborator = {
+                                            id: item.id,
+                                            companyId: item.companyId,
+                                            companyUserId: item.companyUserId,
+                                            companyUserName: item.companyUserName,
+                                            customerId: item.customerId,
+                                            rate: item.rate || 0,
+                                            remark: item.remark || '',
+                                            operation: 'NONE' // 标记为原有数据,无变化
+                                        };
+
+                                        // 保存原始数据用于对比
+                                        const originalKey = `${item.customerId}_${item.companyUserId}`;
+                                        this.originalCollaborators[originalKey] = {
+                                            id: item.id,
+                                            rate: item.rate || 0,
+                                            remark: item.remark || ''
+                                        };
+
+
+                                        return collaborator;
+                                    });
+
+                                    // 设置客户的协作者列表
+                                    this.$set(customer, 'collaborators', collaborators);
+                                    // 初始化删除列表
+                                    this.$set(customer, 'deletedCollaborators', []);
+                                } else {
+                                    // 如果没有协作者数据,设置为空数组
+                                    this.$set(customer, 'collaborators', []);
+                                    this.$set(customer, 'deletedCollaborators', []);
+                                }
+                            });
+
+                        } else {
+                            // 如果查询失败,确保 originalCollaborators 是空对象
+                            this.originalCollaborators = {};
+                        }
+                    }).catch(error => {
+                        this.originalCollaborators = {};
+                        this.$message.error("加载协作者数据失败,请重试");
+                    });
+                } catch(error) {
+                    // 异常情况下,确保 originalCollaborators 是空对象
+                    this.originalCollaborators = {};
+                    // 异常情况下,为所有客户设置空的协作者列表
+                    this.customers.forEach(customer => {
+                        this.$set(customer, 'collaborators', []);
+                        this.$set(customer, 'deletedCollaborators', []);
+                    });
+                    this.$message.error("加载协作者数据失败,请重试");
+                }
+            } else {
+                // 如果没有客户ID,确保 originalCollaborators 是空对象
+                this.originalCollaborators = {};
+            }
+        },
+        changeVal(row) {
+            this.$forceUpdate();//解决点击计数器失效问题
+            this.computeCount();
+            if(this.assistCount>this.customerIds.length){
+                this.$nextTick(() => {
+                        row.count=0;
+                        this.computeCount();
+                });
+
+            }
+        },
+        handleRemoveUser(index){
+            this.users.splice(index,1);
+            this.computeCount();
+            this.$refs.userSelects.delUser(index);
+        },
+        selectUser(data){
+            if(this.flag){
+                // 手动分佣模式 - 为特定客户添加协作人
+                if(this.currentCustomerIndex >= 0) {
+                    const customer = this.customers[this.currentCustomerIndex];
+                    if(!customer.collaborators) {
+                        this.$set(customer, 'collaborators', []);
+                    }
+                    data.forEach(user => {
+                        // 检查是否已存在
+                        const exists = customer.collaborators.some(c => c.userId === user.userId);
+                        const existsInDeleted = customer.deletedCollaborators &&
+                            customer.deletedCollaborators.some(c => c.companyUserId === user.userId);
+                        if(!exists && !existsInDeleted) {
+                            const collaborator = {
+                                companyUserId: user.userId,
+                                companyUserName: user.nickName,
+                                customerId: customer.customerId,
+                                rate: 0,
+                                remark: '',
+                                operation: 'ADD' // 标记为新增
+                            };
+                            customer.collaborators.push(collaborator);
+                        } else if (existsInDeleted) {
+                            // 如果在删除列表中存在,则恢复该协作者
+                            const deletedIndex = customer.deletedCollaborators.findIndex(c => c.companyUserId === user.userId);
+                            if (deletedIndex >= 0) {
+                                const restoredCollaborator = customer.deletedCollaborators[deletedIndex];
+                                restoredCollaborator.operation = 'NONE'; // 恢复为原有状态
+                                customer.collaborators.push(restoredCollaborator);
+                                customer.deletedCollaborators.splice(deletedIndex, 1);
+                            }
+                        }
+                    });
+                    this.userSelect.open=false;
+                }
+            } else{
+                var users=[];
+                var number=parseInt(this.customerIds.length/data.length);
+                data.forEach(element => {
+                    var user={
+                        userId:element.userId,
+                        userName:element.userName,
+                        nickName:element.nickName,
+                        deptName:element.dept.deptName,
+                        nowDayCustomerCount:element.nowDayCustomerCount,
+                        phonenumber:element.phonenumber,
+                        count:number,
+                    }
+                    users.push(user)
+                });
+                this.users=users;
+                this.userSelect.open=false;
+                this.computeCount()
+            }
+
+        },
+        computeCount(){
+            this.assistCount=0;
+            var that=this;
+            this.users.forEach(element => {
+                that.assistCount+=element.count;
+            });
+            this.noAssistCount=this.customerIds.length-this.assistCount
+        },
+        handleUserSelect(){
+            var that=this;
+            this.userSelect.open=true;
+            setTimeout(() => {
+                that.$refs.userSelects.getList();
+            }, 500);
+        },
+        async init(customerIds,flag){
+            this.flag = flag //是否设置分佣
+            if(flag){
+                this.customers = customerIds;
+                await this.loadCustomerCollaborators();
+            } else {
+                this.customerIds =  customerIds;
+                this.assistCount=0;
+                this.noAssistCount=this.customerIds.length;
+                this.users=[];
+            }
+
+        },
+        async submitAssistForm2(){
+            // 提交前检查并更新操作状态
+            this.checkAndUpdateOperations();
+            // 验证数据
+            let hasError = false;
+            for(let i = 0; i < this.customers.length; i++) {
+                const customer = this.customers[i];
+                const totalRate = this.getTotalRate(i);
+
+                if(totalRate > 100) {
+                    this.$message.error(`客户 ${customer.customerName} 的协作人员总分佣比例不能超过100%`);
+                    hasError = true;
+                    break;
+                }
+            }
+
+            if(hasError) return;
+
+            this.submitLoading = true;
+
+            try {
+                // 准备提交数据 - 包含所有操作类型
+                const submitData = {
+                    customerIds: this.customers.map(c => c.customerId), // 包含所有客户ID
+                    operations: []
+                };
+
+                this.customers.forEach(customer => {
+                    if(customer.collaborators && customer.collaborators.length > 0) {
+                        customer.collaborators.forEach(collaborator => {
+                            if (collaborator.operation !== 'DELETE') {
+                                 // 确保每个协作者都有正确的operation字段
+                                 let operation = collaborator.operation;
+                                 // 如果没有operation字段,根据是否有id来判断
+                                if (!operation) {
+                                    if (collaborator.id) {
+                                        // 有id说明是原有数据,检查是否有变化
+                                        const originalKey = `${collaborator.customerId}_${collaborator.companyUserId}`;
+                                        const originalCollaborator = this.originalCollaborators[originalKey];
+
+                                        if (originalCollaborator &&
+                                            (originalCollaborator.rate !== collaborator.rate ||
+                                             originalCollaborator.remark !== (collaborator.remark || ''))) {
+                                            operation = 'UPDATE';
+                                        } else {
+                                            operation = 'NONE';
+                                        }
+                                    } else {
+                                        // 没有id说明是新增数据
+                                        operation = 'ADD';
+                                    }
+                                }
+                                submitData.operations.push({
+                                    operation: operation, // ADD, UPDATE, NONE
+                                    id: collaborator.id || null,
+                                    companyId: collaborator.companyId,
+                                    companyUserId: collaborator.companyUserId,
+                                    companyUserName: collaborator.companyUserName,
+                                    customerId: customer.customerId,
+                                    rate: collaborator.rate,
+                                    remark: collaborator.remark || ''
+                                });
+                            }
+                        });
+                    }
+                    // 处理已删除的协作者
+                    if(customer.deletedCollaborators && customer.deletedCollaborators.length > 0) {
+                        customer.deletedCollaborators.forEach(collaborator => {
+                            submitData.operations.push({
+                                operation: 'DELETE',
+                                id: collaborator.id,
+                                companyUserId: collaborator.companyUserId,
+                                customerId: customer.customerId
+                            });
+                        });
+                    }
+
+                });
+
+                console.log("提交的完整分佣数据:", JSON.stringify(submitData, null, 2));
+
+                // 这里需要根据你的实际更新接口来调用
+                const response = await allOperation(submitData.operations);
+
+                if(response.code === 200) {
+                    this.$message.success("分佣设置保存成功");
+                    this.$emit('close');
+                } else {
+                    this.$message.error(response.msg || "保存失败");
+                }
+            } catch(error) {
+                this.$message.error("保存失败,请重试");
+            } finally {
+                this.submitLoading = false;
+            }
+        },
+        /** 提交按钮 */
+        submitAssistForm() {
+            var that=this;
+            this.$refs["assistForm"].validate(valid => {
+                if (valid) {
+                    var users=[];
+                    var customerIds=[];
+                    var idIndex=0;
+                    var totalAssistCount=0;
+                    console.log("qxj users",JSON.stringify(this.users));
+                    this.users.forEach(element => {
+                        if(element.count>0){
+                            var ids=that.customerIds.slice(idIndex,idIndex+element.count)
+                            console.log("qxj customerIds:"+that.customerIds+" count:"+element.count);
+                            console.log("qxj ids:"+ids);
+                            customerIds=customerIds.concat(ids);
+                            idIndex=idIndex+element.count;
+                            var data={companyUserId:element.userId,count:element.count};
+                            users.push(data);
+                            totalAssistCount+=element.count;
+                        }
+                    });
+                    if(users.length==0){
+                        this.msgError("请选择员工");
+                        return;
+                    }
+                    if(totalAssistCount>(this.assistCount+this.noAssistCount)){
+                        this.msgError("添加数量有误");
+                        return;
+                    }
+                    this.myloading = this.$loading({
+                        lock: true,
+                        text: '处理中...',
+                        spinner: 'el-icon-loading',
+                        background: 'rgba(0, 0, 0, 0.7)'
+                    });
+                    var data={customerIds:customerIds,users:users}
+                    console.log("qxj data:",JSON.stringify(data));
+                    assistToUser(data).then(response => {
+                        this.myloading.close()
+                        if (response.code === 200) {
+                            this.msgSuccess("操作成功");
+                            this.$emit('close');
+                        }
+                    });
+                }
+            });
+        },
+        closeAction(){
+            this.$refs.userSelects.users=[];
+        }
+    }
+};
+</script>
+<style lang="scss" scoped>
+.contents{
+    height: 100%;
+    background-color: #fff;
+    padding: 20px;
+
+}
+.footer{
+    display: flex;
+    align-items: center;
+    justify-content: flex-end;
+}
+</style>
+
+
+

+ 817 - 0
src/views/crm/customer/assist.vue

@@ -0,0 +1,817 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="客户编码" prop="customerCode">
+        <el-input
+          style="width:220px"
+          v-model="queryParams.customerCode"
+          placeholder="请输入客户编码"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户名称" prop="customerName">
+        <el-input
+          style="width:220px"
+          v-model="queryParams.customerName"
+          placeholder="请输入客户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="手机" prop="mobile">
+        <el-input
+        style="width:220px"
+          v-model="queryParams.mobile"
+          placeholder="请输入手机"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="跟进阶段" prop="status">
+        <el-select style="width:220px" multiple filterable  v-model="statusArr" placeholder="请选择跟进阶段" clearable size="small">
+           <el-option
+                v-for="item in statusOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="客户类型" prop="customerLevel">
+        <el-select style="width:220px" filterable  v-model="queryParams.customerLevel" placeholder="请选择客户类型" clearable size="small">
+           <el-option
+                v-for="item in customerLevelOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="客户标签" prop="tags">
+            <el-select style="width:220px" multiple  filterable v-model="tagIds" placeholder="请选择客户标签" clearable size="small">
+              <el-option
+                    v-for="item in tagsOptions"
+                    :key="item.dictLabel"
+                    :label="item.dictLabel"
+                    :value="item.dictLabel"
+                  />
+            </el-select>
+          </el-form-item>
+      <el-form-item label="客户来源" prop="source">
+        <el-select style="width:220px" multiple filterable  v-model="sourceArr" placeholder="请选择客户来源" clearable size="small">
+           <el-option
+                v-for="item in sourceOptions"
+                :key="item.dictValue"
+                :label="item.dictLabel"
+                :value="item.dictValue"
+              />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="创建时间" prop="createTimeRange">
+        <el-date-picker
+          style="width:205.4px"
+          clearable size="small"
+          v-model="createTimeRange"
+          type="daterange"
+          value-format="yyyy-MM-dd"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="领取时间" prop="receiveTime">
+        <el-date-picker
+              style="width:220px"
+              clearable size="small"
+              v-model="dateRange"
+              type="daterange"
+              value-format="yyyy-MM-dd"
+              start-placeholder="开始日期"
+              end-placeholder="结束日期">
+            </el-date-picker>
+      </el-form-item>
+      <el-form-item label="历史订单" prop="isHisOrder">
+          <el-select style="width:220px" filterable v-model="queryParams.isHisOrder" placeholder="请选择历史订单" clearable size="small">
+            <el-option key="1"  label="已下单" value="1" />
+            <el-option key="0"  label="未下单" value="0" />
+          </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="multiple"
+          @click="handleAssist"
+          v-hasPermi="['crm:customer:assistToUser']"
+        >客户协作</el-button>
+      </el-col>
+
+
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          size="mini"
+          :disabled="multiple"
+          @click="handleSendBatchSms"
+          v-hasPermi="['crm:customer:sendBatchSms']"
+        >批量发送短信</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-dropdown
+          @command="handleCommand"
+          trigger="click"
+          placement="bottom-start"
+        >
+          <el-dropdown-menu slot="dropdown" style="width: 120px;">
+            <el-dropdown-item
+              v-for="option in sysCreateType"
+              :key="option.dictValue"
+              :command="option.dictValue"
+            >
+              <i :class="option.iconClass" style="margin-right: 10px;"></i>
+              {{ option.dictLabel }}
+            </el-dropdown-item>
+          </el-dropdown-menu>
+          <!-- <span class="el-dropdown-link" >
+              <el-button  type="success"   size="mini" >
+                创建订单
+              </el-button>
+            </span> -->
+        </el-dropdown>
+
+<!--        <el-button-->
+<!--          type="success"-->
+<!--          size="mini"-->
+<!--          @click="addPackageOrder"-->
+<!--        >创建订单</el-button>-->
+      </el-col>
+
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-download"
+          size="mini"
+          @click="handleExport"
+          v-hasPermi="['crm:customer:export']"
+        >导出</el-button>
+      </el-col> -->
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table  height="500" border v-loading="loading" :data="customerList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="客户编码" align="center" prop="customerCode" />
+      <el-table-column  label="客户名称"   align="center" prop="customerName" :show-overflow-tooltip="true">
+        <template slot-scope="scope">
+          <el-link @click="handleShow(scope.row)" :underline="false" type="primary" >{{scope.row.customerName}}</el-link>
+        </template>
+      </el-table-column>
+      <el-table-column  label="手机" width="120px"  align="center" prop="mobile"   >
+        <template slot-scope="scope">
+          {{scope.row.mobile}}
+          <el-button type="text"    size="mini" @click="callNumber(scope.row.customerId,null)">拨号</el-button>
+          <el-button v-hasPermi="['crm:customer:addVisit']"  type="text" size="mini" @click="handleAddVisit(scope.row)">写跟进</el-button>
+          <el-button type="text"    size="mini" @click="addPackageOrder(scope.row)" style="margin-right: 15px;">创建订单</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column  label="客户来源" align="center" prop="source">
+        <template slot-scope="scope">
+            <el-tag prop="status" v-for="(item, index) in sourceOptions"    v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
+      <el-table-column  label="跟进阶段"  width="200" align="center" prop="visitStatus">
+        <template slot-scope="scope">
+            <el-tag prop="visitStatus" v-for="(item, index) in statusOptions"    v-if="scope.row.visitStatus==item.dictValue">{{item.dictLabel}}</el-tag><br/>
+            <el-button  v-hasPermi="['crm:customer:addVisitStatus']"  type="text" size="mini" @click="handleVisitStatus(scope.row)">修改</el-button>
+          </template>
+      </el-table-column>
+      <el-table-column  label="客户类型"  width="200" align="center" prop="customerLevel">
+        <template slot-scope="scope">
+            <el-tag prop="status" v-for="(item, index) in customerLevelOptions"    v-if="scope.row.customerLevel===item.dictValue">{{item.dictLabel}}</el-tag>
+            <el-button   v-hasPermi="['crm:customer:addCustomerType']"  type="text" size="mini" @click="handleCustomerType(scope.row)">修改</el-button>
+          </template>
+      </el-table-column>
+      <el-table-column  label="标签" width="120px"  align="center" prop="tags"   >
+        <template slot-scope="scope">
+          {{scope.row.tags}}
+          <el-button  v-hasPermi="['crm:customer:addTag']"  type="text" size="mini" @click="handleAddTag(scope.row)">打标签</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column  label="备注" width="150px"  align="center" prop="remark"   >
+        <template slot-scope="scope">
+          {{scope.row.remark}}
+          <el-button v-hasPermi="['crm:customer:addRemark']" type="text" size="mini" @click="handleAddRemark(scope.row)">修改备注</el-button>
+        </template>
+      </el-table-column>
+      <el-table-column  label="邀请人" width="150px" align="center" >
+        <template slot-scope="scope">
+          <div v-for="(user, index) in scope.row.assistUser" :key="index">
+            {{ user }}
+            <br v-if="index < scope.row.assistUser.length - 1"> <!-- 在最后一个元素之前添加换行 -->
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="进线客户详情" align="center" :show-overflow-tooltip="true" prop="registerDesc" />
+      <el-table-column label="最新跟进时间" align="center" prop="lastTime" />
+      <el-table-column label="领取时间" align="center" prop="receiveTime" />
+      <el-table-column label="进线客户提交日期" align="center" prop="registerSubmitTime" />
+      <el-table-column label="创建时间" align="center" prop="customerCreateTime" width="180">
+      </el-table-column>
+      <el-table-column label="操作"   align="center" fixed="right" width="120px" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleShow(scope.row)"
+            v-hasPermi="['crm:customer:query']"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleRecover(scope.row)"
+            v-hasPermi="['crm:customer:recover']"
+          >回收公海</el-button>
+
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+    <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
+        <customer-details  ref="customerDetails" />
+    </el-drawer>
+    <el-dialog :title="addSms.title" :visible.sync="addSms.open" width="1000px" append-to-body>
+       <add-batch-sms ref="sms" @close="closeSms()"></add-batch-sms>
+    </el-dialog>
+
+
+    <el-dialog :title="source.title" :visible.sync="source.open" width="1000px" append-to-body>
+       <edit-source ref="editSource" @close="closeSource()"></edit-source>
+    </el-dialog>
+
+    <el-dialog :title="visit.title" :visible.sync="visit.open" width="600px" append-to-body>
+      <add-visit @closeVisit="closeVisit"   ref="addVisit" />
+    </el-dialog>
+    <el-dialog :title="customer.title" :visible.sync="customer.open" width="1000px" append-to-body>
+       <add-or-edit-customer ref="customer" @close="closeCustomer()"></add-or-edit-customer>
+    </el-dialog>
+    <el-dialog :title="assign.title" :visible.sync="assign.open" width="800px" append-to-body>
+        <assign-user  ref="assignUser" @close="closeAssign"   />
+    </el-dialog>
+    <el-dialog :title="assist.title" :visible.sync="assist.open" width="800px" append-to-body>
+        <assist-user  ref="assistUser" @close="closeAssist"   />
+    </el-dialog>
+
+    <el-dialog :title="addTag.title" :visible.sync="addTag.open" width="600px" append-to-body>
+        <add-tag ref="tag" @close="closeTag()"></add-tag>
+    </el-dialog>
+    <el-dialog :title="addRemark.title" :visible.sync="addRemark.open" width="600px" append-to-body>
+        <add-remark ref="remark" @close="closeRemark()"></add-remark>
+    </el-dialog>
+    <el-dialog :title="addCustomerType.title" :visible.sync="addCustomerType.open" width="600px" append-to-body>
+        <add-customer-type ref="customerType" @close="closeCustomerType()"></add-customer-type>
+    </el-dialog>
+    <el-dialog :title="addVisitStatus.title" :visible.sync="addVisitStatus.open" width="600px" append-to-body>
+        <add-visit-status ref="visitStatus" @close="closeVisitStatus()"></add-visit-status>
+    </el-dialog>
+    <el-dialog title="创建线上订单" :visible.sync="addPackageOpen" width="1000px" append-to-body>
+      <addPackage  @closePackage="closePackage"   ref="addPackageVisit"  :customerId="customerId"/>
+    </el-dialog>
+    <el-dialog title="创建线下订单" :visible.sync="addOfflineOrder.open" width="1000px" append-to-body>
+      <add-order-offline @closeOrderOffline="closeOrderOffline"   ref="addOrderOffline" />
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getMyAssistList,recover,exportCustomer  } from "@/api/crm/customer";
+import { remove,listAssist, getAssist, delAssist, addAssist, updateAssist, exportAssist } from "@/api/crm/assist";
+import customerDetails from '../components/customerDetails.vue';
+import addVisit from '../components/addVisit.vue';
+import {getCitys} from "@/api/store/city";
+import addBatchSms from '../components/addBatchSms.vue';
+import editSource from '../components/editSource.vue';
+import addOrEditCustomer from '../components/addOrEditCustomer.vue';
+import assignUser from '../components/assignUser.vue';
+import assistUser from '../components/assistUser.vue';
+import addTag from '../components/addTag.vue';
+import addRemark from '../components/addRemark.vue';
+import addCustomerType from '../components/addCustomerType.vue';
+import addVisitStatus from '../components/addVisitStatus.vue';
+import addPackage from "@/views/store/components/addOrder";
+import addOrderOffline from "@/views/store/components/addOrderOffline";
+import {customerLevelOptions} from "@/api/crm/customerLevel";
+export default {
+  name: "Customer",
+  components: {addPackage,addOrderOffline,addVisitStatus,addCustomerType,addRemark,addTag,assignUser,assistUser,addOrEditCustomer,editSource, addBatchSms,customerDetails,addVisit },
+  data() {
+    return {
+      customerId:null,
+      addOfflineOrder:{
+        open:false,
+      },
+      sysCreateType:[
+        { dictLabel: "线下订单", dictValue: "1" },
+
+        { dictLabel: "线上订单", dictValue: "2" },
+      ],
+      addPackageOpen:false,
+      addVisitStatus:{
+          open:false,
+          title:"跟进阶段"
+      },
+      addCustomerType:{
+          open:false,
+          title:"客户类型"
+      },
+      addRemark:{
+          open:false,
+          title:"客户备注"
+      },
+      addTag:{
+          open:false,
+          title:"打标签"
+      },
+      tagIds:[],
+      statusArr:[],
+      ctsTypeArr:[],
+      sourceArr:[],
+      tagsOptions:[],
+      createTimeRange:[],
+      customer:{
+          open:false,
+          title:"新增客户"
+      },
+      users:[],
+      visit:{
+          open:false,
+          title:"写跟进"
+      },
+      source:{
+          open:false,
+          title:"修改客户来源"
+      },
+      assign:{
+        title:"分配客户",
+        open:false,
+      },
+      assist:{
+        title:"添加协作人",
+        open:false,
+      },
+      assignForm: {
+      },
+      // 表单校验
+      assignRules: {
+        // companyUserId: [
+        //   { required: true, message: "员工不能为空", trigger: "blur" }
+        // ],
+      },
+      dateRange:[],
+      addSms:{
+          open:false,
+          title:"批量发短信"
+      },
+      cityIds:[],
+      citys:[],
+      tags:[],
+      inputVisible: false,
+      inputValue: '',
+      statusOptions:[],
+      typeOptions:[],
+      sourceOptions:[],
+      sexOptions:[],
+      show:{
+        title:"客户详情",
+        open:false,
+      },
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 客户表格数据
+      customerList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        customerCode: null,
+        customerName: null,
+        mobile: null,
+        sex: null,
+        weixin: null,
+        userId: null,
+        createUserId: null,
+        receiveUserId: null,
+        customerUserId: null,
+        address: null,
+        location: null,
+        detailAddress: null,
+        lng: null,
+        lat: null,
+        status: null,
+        deptId: null,
+        isDel: null,
+        customerType: null,
+        receiveTime: null,
+        poolTime: null,
+        companyId: null,
+        isLine: null,
+        source: null,
+        tags: null,
+        customerLevel: null,
+      },
+      // 表单参数
+      form: {
+        province:null,
+        city:null,
+        district:null,
+      },
+      // 表单校验
+      rules: {
+        customerName: [
+          { required: true, message: "客户名称不能为空", trigger: "blur" }
+        ],
+        mobile: [
+          { required: true, message: "手机号不能为空", trigger: "blur" }
+        ],
+        sex: [
+          { required: true, message: "性别不能为空", trigger: "blur" }
+        ],
+        source: [
+          { required: true, message: "客户来源不能为空", trigger: "blur" }
+        ],
+      },
+      loading:null,
+      customerLevelOptions: []
+    };
+  },
+  created() {
+    this.getDicts("crm_customer_source").then((response) => {
+      this.sourceOptions = response.data;
+    });
+    this.getDicts("common_sex").then((response) => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("crm_customer_user_status").then((response) => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("crm_customer_type").then((response) => {
+      this.typeOptions = response.data;
+    });
+    this.getDicts("crm_customer_tag").then((response) => {
+        this.tagsOptions = response.data;
+    });
+    this.getCitys();
+    this.getList();
+    this.getCustomerLevelOptions()
+  },
+  methods: {
+    getCustomerLevelOptions(){
+      customerLevelOptions().then((response) => {
+        this.customerLevelOptions = response.data;
+      });
+    },
+    handleCommand(command){
+      if (command==="1"){
+        this.addOfflineOrder.open = true
+      }else {
+        this.addPackageOpen=true;
+      }
+    },
+    closeOrderOffline(){
+      this.addOfflineOrder.open = false
+    },
+    addPackageOrder(row){
+        this.customerId = row.customerId;
+       this.addPackageOpen=true;
+    },
+    closePackage(){
+      this.addPackageOpen=false;
+    },
+    closeVisitStatus(){
+        this.addVisitStatus.open=false;
+        this.getList();
+    },
+    handleVisitStatus(row){
+        this.addVisitStatus.open=true;
+        var that=this;
+        setTimeout(() => {
+            that.$refs.visitStatus.reset(row);
+        }, 500);
+
+    },
+    closeCustomerType(){
+        this.addCustomerType.open=false;
+        this.getList();
+    },
+    handleCustomerType(row){
+        this.addCustomerType.open=true;
+        var that=this;
+        setTimeout(() => {
+            that.$refs.customerType.reset(row);
+        }, 500);
+
+    },
+    closeRemark(){
+        this.addRemark.open=false;
+        this.getList();
+    },
+    handleAddRemark(row){
+        this.addRemark.open=true;
+        var that=this;
+        setTimeout(() => {
+            that.$refs.remark.reset(row);
+        }, 500);
+
+    },
+    closeTag(){
+        this.addTag.open=false;
+        this.getList();
+    },
+    handleAddTag(row){
+        this.addTag.open=true;
+        var that=this;
+        setTimeout(() => {
+            that.$refs.tag.reset(row);
+        }, 500);
+
+    },
+    handleShow(row){
+      this.show.open=true;
+      var that=this;
+      const tab = "visit";
+      setTimeout(() => {
+        that.$refs.customerDetails.getDetails(row.customerId);
+        that.$refs.customerDetails.handleClick(tab);
+
+      }, 200);
+    },
+    handleAdd() {
+      this.customer.open = true;
+      var that=this;
+      setTimeout(() => {
+        that.$refs.customer.handleAdd(2);
+      }, 200);
+    },
+    closeCustomer(){
+        this.customer.open=false;
+        this.getList();
+    },
+    closeVisit(){
+        this.visit.open=false;
+        this.getList();
+    },
+    handleAddVisit(row){
+        this.visit.open=true;
+        setTimeout(() => {
+            this.$refs.addVisit.reset(row.customerId);
+        }, 200);
+    },
+    handleAssist(){
+      var that=this;
+      var ids=this.ids;
+      that.assist.open=true;
+      setTimeout(() => {
+          that.$refs.assistUser.init(ids);
+      }, 200);
+    },
+    handleRemoveAllAssist(){
+      const ids = this.ids;
+      const data = {customerIds:ids,companyUserId:null}
+      this.$confirm('是否确认删除协作人?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return  remove(data);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    handleRemoveAssist(row,userName){
+      const match = userName.match(/\((\d+)\)/);
+      const companyUserId = match[1];
+      const data = {customerIds:[row.customerId],companyUserId:companyUserId}
+      this.$confirm('是否确认删除"' + userName + '"协作?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return  remove(data);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    handleAssign(){
+      var that=this;
+      var ids=this.ids;
+      that.assign.open=true;
+      setTimeout(() => {
+          that.$refs.assignUser.init(ids,3);
+      }, 200);
+    },
+    closeAssign(){
+      this.assign.open=false;
+      this.getList();
+    },
+    closeAssist(){
+      this.assist.open=false;
+      this.getList();
+    },
+    handleEditScource(){
+      this.source.open=true;
+      var that=this;
+      setTimeout(() => {
+        that.$refs.editSource.handleEdit(that.ids);
+      }, 200);
+
+    },
+    closeSource(){
+        this.source.open=false;
+        this.getList();
+    },
+    closeSms(){
+        this.addSms.open=false;
+    },
+    handleSendBatchSms(){
+      const customerIds =  this.ids;
+      this.addSms.open=true;
+      var that=this;
+      setTimeout(() => {
+          console.log(customerIds)
+          that.$refs.sms.reset(customerIds);
+      }, 500);
+
+    },
+    handleRecover(row) {
+      this.$confirm('是否确认回收客户"' + row.customerName + '"?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          var data={customerUserId:row.customerUserId}
+          return recover(data);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("操作成功");
+        }).catch(function() {});
+    },
+    handleCityChange(value) {
+      console.log(value);
+      var nodes=this.$refs.citySelect.getCheckedNodes();
+      this.form.address=nodes[0].pathLabels[0]+"-"+nodes[0].pathLabels[1]+"-"+nodes[0].pathLabels[2];
+      this.form.cityIds=value.toString();
+    },
+    getCitys(){
+        getCitys().then(res => {
+          this.loading = false;
+          this.citys=res.data;
+        })
+    },
+
+    /** 查询客户列表 */
+    getList() {
+      this.loading = true;
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.statusArr.length>0){
+        this.queryParams.status=this.statusArr.toString();
+      }
+      else{
+        this.queryParams.status=null
+      }
+
+      if(this.ctsTypeArr.length>0){
+        this.queryParams.customerType=this.ctsTypeArr.toString();
+      }
+      else{
+        this.queryParams.customerType=null
+      }
+
+      if(this.sourceArr.length>0){
+        this.queryParams.source=this.sourceArr.toString();
+      }
+      else{
+        this.queryParams.source=null
+      }
+
+      if(this.tagIds.length>0){
+        this.queryParams.tags=this.tagIds.toString();
+      }
+      else{
+        this.queryParams.tags=null
+      }
+      getMyAssistList(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        this.customerList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.customerId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+
+
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const customerIds = row.customerId || this.ids;
+      this.$confirm('是否确认删除客户编号为"' + customerIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delLineCustomer(customerIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(function() {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有客户数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportCustomer(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    },
+  }
+};
+</script>
+<style>
+  .el-tag + .el-tag {
+    margin-left: 10px;
+  }
+  .button-new-tag {
+    margin-left: 10px;
+    height: 32px;
+    line-height: 30px;
+    padding-top: 0;
+    padding-bottom: 0;
+  }
+  .input-new-tag {
+    width: 90px;
+    margin-left: 10px;
+    vertical-align: bottom;
+  }
+  .el-dialog__wrapper{
+    z-index: 100000;
+  }
+</style>

+ 113 - 0
src/views/fastGpt/fastGptKeywordSend/fastGptKeyWordDetails.vue

@@ -0,0 +1,113 @@
+<template>
+    <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
+      <div style="padding: 20px; background-color: #fff;">
+        营销指令内容
+      </div>
+      <!-- 使用 el-form 包裹表单项 -->
+      <el-form label-width="120px" style="padding: 20px;">
+        <!-- 发送文字内容 -->
+        <el-form-item label="发送文字内容" >
+          <div class="el-form-item__content readonly-field" style="line-height: 28px;">
+            {{ form.content || '-' }}
+          </div>
+        </el-form-item>
+
+        <!-- 图片访问地址 -->
+        <el-form-item label="图片访问地址">
+          <div class="el-form-item__content readonly-field">
+            <div v-if="form.contentType !== 0 && form.imgUrl && form.imgUrl.trim()">
+              <el-image
+                v-for="(url, index) in form.imgUrl.split(',')"
+                :key="index"
+                :src="url"              style="width: 100px; height: 100px; margin-right: 10px;"
+                fit="cover"
+              >
+                <div slot="error" class="image-slot">
+                  <i class="el-icon-picture-outline"></i>
+                </div>
+              </el-image>
+            </div>
+            <div v-else class="el-form-item__content" style="line-height: 28px;">-</div>
+          </div>
+        </el-form-item>
+      </el-form>
+    </div>
+</template>
+
+<script>
+
+import {getFastGptKeywordSend} from "@/api/fastGpt/fastGptKeywordSend";
+
+  export default {
+    name: "fastGptChatMsgDetails",
+    data() {
+      return {
+        open:false,
+        logsOpen:false,
+        roles:[],
+        msgList:[],
+        item:null,
+        form: {
+          content: '',
+          imgUrl: ''
+        },
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          keyword: null,
+          content: null,
+          contentType: null,
+          imgUrl: null,
+          status: null,
+          roleId: null,
+          createTime: null,
+        }
+      }
+    },
+
+    methods: {
+      getDetails(id) {
+        getFastGptKeywordSend(id).then(response => {
+          console.log(response);
+          this.form = response.data;
+        });
+      },
+
+      cancel(){
+          this.open = false;
+      }
+    }
+  }
+</script>
+<style>
+  .readonly-field {
+    background-color: #fafafa;
+    padding: 10px;
+    border-radius: 4px;
+  }
+  .contentx{
+      height: 100%;
+      background-color: #fff;
+      padding: 0px 20px 20px;
+
+
+      margin: 20px;
+  }
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+  .el-descriptions-item__content {
+    max-width: 150px;
+    min-width: 100px;
+  }
+  .desct{
+      padding-top: 20px;
+      padding-bottom: 20px;
+      color: #524b4a;
+      font-weight: bold;
+    }
+  .padding-a{
+    padding-right: 10px;
+
+  }
+</style>

+ 532 - 0
src/views/fastGpt/fastGptKeywordSend/index.vue

@@ -0,0 +1,532 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="88px">
+<!--      <el-form-item label="营销关键字" prop="keyword" style="white-space: nowrap;">
+        <el-input
+          v-model="queryParams.keyword"
+          placeholder="请输入营销关键字"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>-->
+      <el-form-item label="营销关键字" prop="keyword"  style="white-space: nowrap;">
+        <el-select v-model="queryParams.keyword" clearable placeholder="请选择营销关键字">
+          <el-option
+            v-for="dict in keywordOptions"
+            :key="dict.keyword"
+            :label="dict.keyword"
+            :value="dict.keyword"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+     <el-form-item label="发送文字内容" prop="content" style="white-space: nowrap;">
+        <el-input
+          v-model="queryParams.content"
+          placeholder="请输入发送文字内容"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="内容类型" prop="contentType">
+        <el-select v-model="queryParams.contentType" placeholder="请选择内容类型" clearable size="small">
+          <el-option
+            v-for="dict in contentTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="客服角色" prop="roleIds">
+        <el-select v-model="queryParams.roleIds" placeholder="请选择客服角色" clearable size="small">
+          <el-option
+            v-for="item in roles"
+            :key="item.roleId"
+            :label="item.roleName"
+            :value="item.roleId"
+          />
+        </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="['fastGpt:fastGptKeywordSend:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['fastGpt:fastGptKeywordSend:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['fastGpt:fastGptKeywordSend:remove']"
+        >删除</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['fastGpt:fastGptKeywordSend:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="fastGptKeywordSendList" @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="keyword"/>
+      <el-table-column label="内容类型" align="center" prop="contentType">
+        <template slot-scope="scope">
+          <dict-tag :options="contentTypeOptions" :value="scope.row.contentType"/>
+        </template>
+      </el-table-column>
+<!--      <el-table-column label="图片访问地址" align="center" prop="imgUrl" />-->
+      <el-table-column label="状态" align="center" prop="status">
+        <template slot-scope="scope">
+          <dict-tag :options="statusOptions" :value="scope.row.status"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="客服角色" align="center" prop="roleIds">
+        <template slot-scope="scope">
+          {{ getRoleNameById(scope.row.roleIds) }}
+        </template>
+      </el-table-column>
+
+      <el-table-column label="创建时间" align="center" prop="createTime" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            @click="handleDetails(scope.row)"
+          >查看</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['fastGpt:fastGptKeywordSend:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['fastGpt:fastGptKeywordSend:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改Ai指令对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+
+        <el-form-item label="营销关键字" prop="keyword">
+          <el-select v-model="form.keyword" placeholder="请选择营销关键字">
+            <el-option
+              v-for="dict in keywordOptions"
+              :key="dict.keyword"
+              :label="dict.keyword"
+              :value="dict.keyword"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="发送内容" prop="content">
+          <el-input
+            type="textarea"
+            :autosize="{ minRows: 2, maxRows: 4}"
+            placeholder="请输入发送内容"
+            v-model="form.content">
+          </el-input>
+        </el-form-item>
+        <el-form-item label="内容类型" prop="contentType">
+          <el-select v-model="form.contentType" placeholder="请选择内容类型">
+            <el-option
+              v-for="dict in contentTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="图片" prop="imgUrl" v-if="this.form.contentType !== 0">
+          <ImageUpload v-model="form.imgUrl"  type="image" :limit="1" :width="100" :height="100" />
+        </el-form-item>
+        <el-form-item label="状态">
+          <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="roleIds">
+          <el-select
+            v-model="form.roleIds"
+            placeholder="请选择客服角色"
+            size="small"
+            multiple
+            filterable
+            clearable
+            :filter-method="filterRoles"
+          >
+            <el-option
+              v-for="item in filteredRoles"
+              :key="item.roleId"
+              :label="item.roleName"
+              :value="item.roleId"/>
+          </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-drawer
+      :with-header="false"
+      size="75%"  @close="handleDrawerClose"
+      :title="show.title" :visible.sync="show.open">
+      <fastGptKeyWordDetails  ref="Details" />
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import {
+  listFastGptKeywordSend,
+  getFastGptKeywordSend,
+  delFastGptKeywordSend,
+  addFastGptKeywordSend,
+  updateFastGptKeywordSend,
+  exportFastGptKeywordSend,
+  keywordList
+} from "@/api/fastGpt/fastGptKeywordSend";
+import ImageUpload from "@/components/ImageUpload/index.vue";
+import fastGptKeyWordDetails from "@/views/fastGpt/fastGptKeywordSend/fastGptKeyWordDetails.vue";
+import { getAllRoleList } from "@/api/fastGpt/fastGptRole";
+
+export default {
+  name: "FastGptKeywordSend",
+  components: {fastGptKeyWordDetails, ImageUpload},
+  data() {
+    return {
+      show:{
+        title:"指令内容",
+        open:false,
+      },
+      roleMap:{},
+      roles:[],
+      filteredRoles: [], // 过滤后的角色数据
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // Ai指令表格数据
+      fastGptKeywordSendList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 关键字内容字典
+      keywordOptions: [],
+      // 内容类型字典
+      contentTypeOptions: [],
+      // 状态字典
+      statusOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        keyword: null,
+        content: null,
+        contentType: null,
+        imgUrl: null,
+        status: null,
+        roleIds: [],
+        createTime: null,
+      },
+      // 表单参数
+      form: {roleIds: [],},
+      // 表单校验
+      rules: {
+        keyword: [
+          { required: true, message: "营销关键字不能为空", trigger: "change" }
+        ],
+        content: [
+          // 如果 contentType 不是纯文本类型(比如图文混合),可以动态设置校验规则
+          // 这里假设纯文本内容不需要上传图片
+          { validator: (rule, value, callback) => {
+              const { contentType } = this.form;
+              if (contentType === 0 && !value) {
+                callback(new Error("发送文字内容不能为空"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "blur"
+          }
+        ],
+        imgUrl: [
+          { validator: (rule, value, callback) => {
+              const { contentType } = this.form;
+              if (contentType !== 0 && !value) {
+                callback(new Error("图片不能为空"));
+              } else {
+                callback();
+              }
+            },
+            trigger: "change"
+          }
+        ],
+        roleIds: [
+          { required: true, message: "至少选择一个客服角色", trigger: "change" }
+        ]
+      }
+    };
+  },
+  created() {
+    this.getList();
+    Promise.all([
+      keywordList().then(response => {
+        this.keywordOptions = response.data;
+      }),
+    this.getDicts("sys_fastgpt_keyword_file_type").then(response => {
+      this.contentTypeOptions = response.data;
+    }),
+    this.getDicts("sys_fastgpt_keyword_send_status").then(response => {
+      this.statusOptions = response.data;
+    }),
+      getAllRoleList().then(response => {
+        this.roles = response.data;
+        this.filteredRoles = response.data;
+        // 生成角色映射表
+        this.roleMap = response.data.reduce((map, role) => {
+          map[role.roleId] = role.roleName;
+          return map;
+        }, {});
+      })
+    ])
+  },
+  methods: {
+    /** 查询Ai指令列表 */
+    getList() {
+      this.loading = true;
+      listFastGptKeywordSend(this.queryParams).then(response => {
+        this.fastGptKeywordSendList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 添加过滤方法
+    filterRoles(query) {
+      this.filteredRoles = this.roles.filter(item =>
+        item.roleName.toLowerCase().includes(query.toLowerCase())
+      );
+    },
+    // 获取角色名
+    getRoleNameById(roleIds) {
+      if (!roleIds) return '-';
+
+      // 确保 roleIds 是数组
+      const idArray = Array.isArray(roleIds) ? roleIds : roleIds.split(',').map(id => id.trim());
+      return idArray
+        .map(id => this.roleMap[id])
+        .filter(name => name)
+        .join('、');
+    },
+    //查看按钮
+    handleDetails(row){
+      this.show.open=true;
+      setTimeout(() => {
+        this.$refs.Details.getDetails(row.id);
+      }, 500);
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      getAllRoleList().then(response => {
+        this.roles = response.data;
+        this.filteredRoles = response.data;
+      });
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        keyword: null,
+        content: null,
+        contentType: null,
+        imgUrl: null,
+        status: 0,
+        roleIds: [],
+        createTime: null
+      };
+      this.resetForm("form");
+
+    },
+    //关闭
+    handleDrawerClose(){
+      this.getList();
+    },
+    /** 搜索按钮操作 */
+    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 = "添加Ai指令";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids;
+      getFastGptKeywordSend(id).then(response => {
+        const data = response.data;
+        this.form = {
+          ...data,
+          roleIds: data.roleIds ? data.roleIds.split(',').map(Number) : [] // 确保转为 number[]
+        };
+        this.open = true;
+        this.title = "修改Ai指令";
+        this.$nextTick(() => {
+          this.$forceUpdate(); // 强制更新 el-select 的绑定
+        });
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          // 提取 roleIds 数组中的 roleId 字段组成字符串
+          this.form.roleIds = this.form.roleIds.join(',');
+          if (this.form.id != null) {
+            updateFastGptKeywordSend(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addFastGptKeywordSend(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除Ai指令编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delFastGptKeywordSend(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有Ai指令数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportFastGptKeywordSend(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+};
+</script>
+<style scoped>.el-form-item__content {
+  white-space: nowrap;
+}
+</style>

+ 333 - 0
src/views/fastGpt/fastgptEventLogTotal/index.vue

@@ -0,0 +1,333 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="公司名" prop="companyId">
+        <select-tree
+          v-model="selectedCompanyList"
+          :raw-data="deptList"
+          placeholder="请选择客服"
+          :parentSelectable="true"
+          :multiple="true"
+          component-width="300px"
+          :max-display-tags="3"
+          :check-strictly="false"
+          :return-leaf-only="false"
+          @change="handleMultiChange"
+        ></select-tree>
+      </el-form-item>
+      <el-form-item label="客服" prop="nickName" v-if="queryParams.companyId">
+        <el-select v-model="queryParams.companyUserId" remote
+                   placeholder="请选择"
+                   filterable clearable
+                   style="width: 100%;"
+                   @keyup.enter.native="handleQuery"
+                   @change="handleCompanyUserId"
+        >
+          <el-option
+            v-for="dict in companyUserList"
+            :key="`${dict.nickName} - ${dict.userName}`"
+            :label="`${dict.nickName} - ${dict.userName}`"
+            :value="dict.userId">
+          </el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="AppKey" prop="appKey">
+        <div style="display: flex; align-items: center;">
+          <tree-select
+            v-model="selectedAppKey"
+            :options="appKeyOptions"
+            :normalizer="normalizer"
+            :disable-branch-nodes="false"
+            placeholder="请选择 AppKey"      style="width: 300px;"
+            @input="handleAppKeyChange"
+          />
+        </div>
+      </el-form-item>
+
+      <el-form-item label="创建时间" prop="createTime">
+        <el-date-picker v-model="createTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"  @change="changeTime"></el-date-picker>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table border v-loading="loading" :data="fastgptEventLogTotalList" :row-class-name="() => 'fixed-bottom-row'"
+              @selection-change="handleSelectionChange" :max-height="600">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="角色名称" align="center" prop="roleName" />
+      <el-table-column label="时间" align="center" prop="statTime" />
+      <el-table-column
+        v-for="dict in typeOptions"
+        :key="dict.dictValue"
+        :label="dict.dictLabel"
+        align="center">
+        <template slot-scope="scope">
+          <span>{{ scope.row.typeCountMap ? scope.row.typeCountMap[dict.dictValue] : '' }}</span>
+          <span v-if="dict.dictValue !== '11'"
+                :style="{ fontSize: '12px', marginLeft: '5px',
+                color: getPercentageColor((scope.row.typeCountMap[dict.dictValue] / scope.row.typeCountMap[2]) * 100) }">
+            ({{ ((scope.row.typeCountMap[dict.dictValue] / scope.row.typeCountMap[2]) * 100).toFixed(2) }}%)
+          </span>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { listFastgptEventLogTotal, getFastgptEventLogTotal, delFastgptEventLogTotal, addFastgptEventLogTotal, updateFastgptEventLogTotal, exportFastgptEventLogTotal, getFastGptRoleAppKeyList} from "@/api/fastGpt/fastgptEventLogTotal";
+import SelectTree from "@/components/TreeSelect/index.vue";
+import {getDeptData} from "@/api/system/employeeStats";
+import TreeSelect from '@riophae/vue-treeselect'
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
+
+
+
+export default {
+  name: "FastgptEventLogTotal",
+  components: {SelectTree,TreeSelect},
+  data() {
+    return {
+      createTime:null,
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      selectedCompanyList: [],
+      deptList: [],
+      companyUserList: [],
+      selectedAppKey: null,
+      selectedAppKeyLabel: '',
+      appKeyOptions: [],
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // ai事件埋点统计表格数据
+      fastgptEventLogTotalList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      typeCountMap: null,
+      // 日志类型字典
+      typeOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        roleId: null,
+        count: null,
+        type: null,
+        companyId: null,
+        companyUserId: null,
+        qwUserId: null,
+        typeCountMap: null,
+        beginTime:null,
+        endTime:null,
+        appKey:null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("sys_fastgpt_event_log_type").then(response => {
+      this.typeOptions = response.data;
+    });
+
+    getDeptData().then(response => {
+      this.deptList = response.data;
+    });
+    getFastGptRoleAppKeyList().then(res => {
+      this.appKeyOptions = res.data.map(item => ({
+        id: `p_${item.roleId}`,
+        label: item.roleName,
+        children: (item.roleList || []).map(child => ({
+          id: `c_${child.roleId}`,
+          label: child.roleName,
+          parentId: `p_${item.roleId}`, // 记录父节点 ID
+          parentLabel: item.roleName,   // 记录父节点 label
+          disabled: true
+        }))
+      }));
+    });
+
+  },
+  methods: {
+    /** 查询ai事件埋点统计列表 */
+    getList() {
+      this.loading = true;
+      if(this.selectedCompanyList != null && this.selectedCompanyList.length > 0) {
+        this.queryParams.userIds = this.selectedCompanyList;
+      }else {
+        this.queryParams.userIds = [];
+      }
+
+      listFastgptEventLogTotal(this.queryParams).then(response => {
+        console.log(response)
+        this.fastgptEventLogTotalList = response.data.list;
+        this.total = response.data.total;
+        this.loading = false;
+      });
+    },
+    normalizer(node) {
+      return {
+        id: node.id,
+        label: node.label,
+        children: node.children,
+        disabled: node.disabled
+      }
+    },
+    handleAppKeyChange(value) {
+      const node = this.findNodeById(this.appKeyOptions, value);
+      if (!node) {
+        this.selectedAppKeyLabel = '';
+        return;
+      }
+
+      // 如果是子节点,则找父节点 label
+      if (node.parentLabel) {
+        this.queryParams.appKey = node.parentLabel;
+        this.selectedAppKeyLabel = node.parentLabel;
+        this.selectedAppKey = this.selectedAppKeyLabel;
+      } else {
+        this.queryParams.appKey = node.label;
+        this.selectedAppKeyLabel = node.label;
+        this.selectedAppKey = this.selectedAppKeyLabel;
+      }
+    },
+    findNodeById(nodes, id) {
+      for (const node of nodes) {
+        if (node.id === id) return node;
+        if (node.children) {
+          const found = this.findNodeById(node.children, id);
+          if (found) return found;
+        }
+      }
+      return null;
+    },
+    changeTime(){
+      console.log(this.createTime);
+      if(this.createTime!=null){
+        this.queryParams.beginTime=this.createTime[0];
+        this.queryParams.endTime=this.createTime[1];
+      }else{
+        this.queryParams.beginTime=null;
+        this.queryParams.endTime=null;
+      }
+      console.log(this.queryParams.beginTime);
+      console.log(this.queryParams.endTime);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    handleMultiChange(e){
+
+    },
+    handleCompanyUserId(val){
+      if(val == null || val === '') {
+        this.queryParams.companyUserId = null;
+        this.queryParams.userIds = [];
+      }
+      console.log(val);
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        roleId: null,
+        count: null,
+        type: null,
+        companyId: null,
+        companyUserId: null,
+        qwUserId: null,
+        statTime: null
+      };
+      this.resetForm("form");
+    },
+    getPercentageColor(percentage) {
+      // HSL模式从黄色(60度)渐变到红色(0度)
+      const percent = Math.min(100, Math.max(0, parseFloat(percentage)));
+
+      // 调整色相范围:从深黄色(40°)渐变到红色(0°)
+      const hue = 40 - 40 * (percent / 100); // 初始 hue=40(深黄),终点 hue=0(红)
+
+      // 提高饱和度(100%),亮度保持 50%(鲜艳但不刺眼)
+      return `hsl(${hue}, 100%, 50%)`;
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      console.log(this.selectedAppKey)
+      if(this.selectedAppKey === null || typeof this.selectedAppKey === 'undefined'){
+        this.queryParams.appKey = null;
+      }
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.selectedAppKey = null;
+      this.selectedAppKeyLabel = '';
+      this.selectedCompanyList = [];
+      this.queryParams.appKey = null;
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+
+      if(this.selectedCompanyList != null && this.selectedCompanyList.length > 0) {
+        this.queryParams.userIds = this.selectedCompanyList;
+      }else {
+        this.queryParams.userIds = [];
+      }
+      this.$confirm('是否确认导出所有ai事件埋点统计数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportFastgptEventLogTotal(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 1 - 1
src/views/hisStore/components/addOrder.vue

@@ -46,7 +46,7 @@
           <el-table border style="margin-top:5px;" v-loading="addressloading" :data="address">
             <el-table-column label="ID" align="center">
               <template slot-scope="scope">
-                <el-radio :label="scope.row.id"></el-radio>
+                <el-radio :label="scope.row.addressId"></el-radio>
               </template>
             </el-table-column>
             <el-table-column label="收货人姓名" align="center" prop="realName" />

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

@@ -362,7 +362,7 @@
               <el-table border  style="margin-top:5px;"  v-loading="addressloading" :data="address">
                 <el-table-column label="ID" align="center"  >
                     <template slot-scope="scope">
-                       <el-radio :label="scope.row.id"></el-radio>
+                       <el-radio :label="scope.row.addressId"></el-radio>
                     </template>
                 </el-table-column>
                 <el-table-column label="收货人姓名" align="center" prop="realName" />
@@ -435,10 +435,10 @@
               </el-select>
             </el-form-item>
             <el-form-item label="改价" prop="payPrice">
-              <el-input-number  v-model="form.payPrice" placeholder="修改商品总价" size="medium" :precision="2" min=0.01 :step="0.1" />
+              <el-input-number  v-model="form.payPrice" placeholder="修改商品总价" size="medium" :precision="2" :min=0.01 :step="0.1" />
             </el-form-item>
             <el-form-item label="物流代收" prop="amount" v-if="form.payType == '3'">
-              <el-input-number  v-model="form.amount" placeholder="平台支付价格" size="medium" :precision="2" min=0.01 :step="0.1" />
+              <el-input-number  v-model="form.amount" placeholder="平台支付价格" size="medium" :precision="2" :min=0.01 :step="0.1" />
             </el-form-item>
             <el-form-item label="订单备注" prop="mark">
               <el-input  type="textarea" rows="2" v-model="form.mark" placeholder="" />

+ 0 - 8
src/views/member/list.vue

@@ -213,14 +213,6 @@
             @click="handleAudit(scope.row)"
             v-if="scope.row.isCurrentCompanyUser === 1 && scope.row.status === 0"
           >审核会员</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['user:fsUser:edit']"
-          >修改</el-button>
-
           <el-button
             size="mini"
             type="text"

+ 35 - 1
src/views/member/mylist.vue

@@ -137,6 +137,16 @@
       <!--          v-hasPermi="['user:fsUser:export']"-->
       <!--        >导出</el-button>-->
       <!--      </el-col>-->
+            <el-col :span="1.5">
+              <el-button
+              type="success"
+              plain
+              icon="el-icon-edit"
+              size="mini"
+              :disabled="multiple"
+              @click="batchSend"
+              >批量IM发送</el-button>
+            </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -296,6 +306,16 @@
       <userDetails  ref="userDetails" />
     </el-drawer>
 
+    <el-dialog
+      title="营期"
+      :visible.sync="dialogVisible"
+      width="80%"
+      :before-close="handleClose">
+      <userCoursePeriod :userIds="ids" :companyId="companyId" :companyUserId="companyUserId"/>
+    </el-dialog>
+
+
+
   </div>
 </template>
 
@@ -304,11 +324,13 @@ import { listUser, getUser, addUser, updateUser, delUser, exportUser, auditUser
 import {transferUser} from "@/api/users/user";
 import {getUserList} from "@/api/company/companyUser";
 import userDetails from '@/views/store/components/userDetails.vue';
+import userCoursePeriod from '../../components/course/userCoursePeriod.vue'
 export default {
   name: "FsUser",
-  components: {userDetails},
+  components: {userDetails,userCoursePeriod},
   data() {
     return {
+
       show:{
         title:"会员详情",
         open:false,
@@ -317,6 +339,7 @@ export default {
         targetUserId: [{required: true, message: '请选择转移至销售', trigger: 'change'}],
         content: [{required: true, message: '请选择转移至销售', trigger: 'change'}]
       },
+      dialogVisible:false,
       companyUserList: [],
       openTransferDialog: false,
       transferForm: {
@@ -327,6 +350,8 @@ export default {
       loading: true,
       // 选中数组
       ids: [],
+      companyUserId:null,
+      companyId:null,
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -559,6 +584,8 @@ export default {
       this.ids = selection.map(item => item.userId);
       this.single = selection.length !== 1;
       this.multiple = !selection.length;
+      this.companyId = selection[0].companyId;
+      this.companyUserId = selection[0].companyUserId;
     },
 
     /** 新增按钮操作 */
@@ -663,6 +690,13 @@ export default {
     getProjectLabel(projectId) {
       return this.projectOptions.find(item => parseInt(item.dictValue) === projectId)?.dictLabel;
     },
+
+    batchSend(){
+      this.dialogVisible = true;
+    },
+    handleClose(){
+      this.dialogVisible = false;
+    }
   }
 };
 </script>

+ 389 - 364
src/views/qw/QwWorkTask/qw/index.vue

@@ -1,16 +1,31 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="企微账号" prop="qwUserId">
-        <el-select v-model="queryParams.qwUserId" placeholder="企微账号"  size="small" @change="updateQwuser()">
-          <el-option
-            v-for="dict in myQwUserList"
-            :key="dict.dictValue"
-            :label="dict.dictLabel+'('+dict.corpName+')'"
-            :value="dict.dictValue"
-          />
-        </el-select>
+	 <el-form-item label="部门" prop="type">
+	    <treeselect style="width: 220px" :clearable="false"  v-model="queryParams.deptId"  :options="deptOptions" clearable :show-count="true" placeholder="请选择归属部门"  />
+	 </el-form-item>
+     <el-form-item label="企微账号" prop="qwUserName">
+             <el-input
+               v-model="queryParams.qwUserName"
+               placeholder="请输入企微昵称"
+               clearable
+               size="small"
+               @keyup.enter.native="handleQuery"
+             />
       </el-form-item>
+	  <el-form-item label="所属客服" prop="companyUserId">
+	    <el-select v-model="queryParams.companyUserId" clearable filterable remote
+	               placeholder="请输入关键词" :remote-method="loadCompanyUserOptions"
+	               v-select-load-more="loadMoreCompanyUserOptions"
+	               :loading="companyUserOptionsLoading">
+	      <el-option
+	        v-for="item in companyUserOptions"
+	        :key="item.dictValue"
+	        :label="item.dictLabel"
+	        :value="item.dictValue">
+	      </el-option>
+	    </el-select>
+	  </el-form-item>
       <el-form-item label="类别" prop="type">
         <el-select v-model="queryParams.type" placeholder="请选择类别" clearable size="small">
           <el-option
@@ -22,17 +37,16 @@
         </el-select>
       </el-form-item>
 
-      <el-form-item label="处理状态" prop="trackType">
-        <el-select v-model="queryParams.trackType" placeholder="处理状态" clearable size="small">
-          <el-option
-            v-for="dict in trackTypeOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="dict.dictValue"
-          />
-        </el-select>
-      </el-form-item>
-
+	  <el-form-item label="处理状态" prop="trackType">
+	    <el-select v-model="queryParams.trackType" placeholder="处理状态" clearable size="small">
+	      <el-option
+	        v-for="dict in trackTypeOptions"
+	        :key="dict.dictValue"
+	        :label="dict.dictLabel"
+	        :value="dict.dictValue"
+	      />
+	    </el-select>
+	  </el-form-item>
       <el-form-item label="sop编号" prop="sopId">
         <el-input
           v-model="queryParams.sopId"
@@ -42,37 +56,46 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="标题" prop="title">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入标题"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="sm()">色盲模式</el-button>
-
+		<el-button icon="el-icon-refresh" size="mini" @click="sm()">色盲模式</el-button>
       </el-form-item>
     </el-form>
 
-    <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
-      <el-tab-pane v-for="(item,index) in statusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
-    </el-tabs>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+	<el-tabs type="card" v-model="actName" @tab-click="handleClickX">
+	  <el-tab-pane v-for="(item,index) in statusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
+	</el-tabs>
     <el-table border v-loading="loading" :data="QwWorkTaskList" @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="qwUserName" />
+	  <el-table-column label="企微昵称" align="center" prop="nickName" />
       <el-table-column label="状态" align="center" prop="status">
-        <template slot-scope="scope">
-          <dict-tag :options="statusOptions" :value="scope.row.status"/>
-        </template>
+		 <template slot-scope="scope">
+		   <dict-tag :options="statusOptions" :value="scope.row.status"/>
+		 </template>
       </el-table-column>
       <el-table-column label="类别" align="center" prop="type">
         <template slot-scope="scope">
           <dict-tag :options="typeOptions" :value="scope.row.type"/>
         </template>
       </el-table-column>
-      <el-table-column label="处理状态" align="center" prop="trackType">
-        <template slot-scope="scope">
-          <dict-tag :options="trackTypeOptions" :value="scope.row.trackType"/>
-        </template>
-      </el-table-column>
+	  <el-table-column label="处理状态" align="center" prop="trackType">
+	    <template slot-scope="scope">
+	      <dict-tag :options="trackTypeOptions" :value="scope.row.trackType"/>
+	    </template>
+	  </el-table-column>
       <el-table-column label="标题" align="center" prop="title" />
       <el-table-column label="描述" align="center" prop="description" />
       <el-table-column label="分值" align="center" prop="score">
@@ -80,32 +103,32 @@
           <span :style="getScoreStyle(scope.row.score)">{{ scope.row.score }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="用户过往看课记录" align="center" width="200px">
-        <template slot-scope="scope">
-          <div style="display: flex; gap: 4px; justify-content: center;" v-if="!isSM">
-			  <span
-          v-for="(log, index) in scope.row.logs"
-          :key="index"
-          :style="{
-				  display: 'inline-block',
-				  width: '16px',
-				  height: '16px',
-				  borderRadius: '2px',
-				  backgroundColor:
-					log === 2 ? '#67C23A' :
-							  log === 3 ? '#f55a4f' :
-							  log === 4 ? '#FFD700' :
-							  log === 1 ? '#0bc6ff' :
-							  '#909399'
-				}"
-        ></span>
-          </div>
-
-          <div style="display: flex; gap: 4px; justify-content: center;" v-if="isSM">
+	  <el-table-column label="用户过往看课记录" align="center" width="200px">
+	    <template slot-scope="scope">
+	    	<div style="display: flex; gap: 4px; justify-content: center;" v-if="!isSM">
+	    	  <span
+	    		v-for="(log, index) in scope.row.logs"
+	    		:key="index"
+	    		:style="{
+	    		  display: 'inline-block',
+	    		  width: '16px',
+	    		  height: '16px',
+	    		  borderRadius: '2px',
+	    		  backgroundColor:
+	    			log === 2 ? '#67C23A' :
+	    					  log === 3 ? '#f55a4f' :
+	    					  log === 4 ? '#FFD700' :
+	    					  log === 1 ? '#0bc6ff' :
+	    					  '#909399'
+	    		}"
+	    	  ></span>
+	    	</div>
+
+	      <div style="display: flex; gap: 4px; justify-content: center;" v-if="isSM">
 	        <span
-            v-for="(log, index) in scope.row.logs"
-            :key="index"
-            :style="{
+	          v-for="(log, index) in scope.row.logs"
+	          :key="index"
+	          :style="{
 	            display: 'inline-block',
 	            width: '16px',
 	            height: '16px',
@@ -115,7 +138,7 @@
 	            position: 'relative',
 	            transform: log === 4 ? 'rotate(45deg)' : 'none'
 	          }"
-          >
+	        >
 	          <!-- 已完成 - 圆形 + 对勾 -->
 	          <span v-if="log === 2" style="
 	            position: absolute;
@@ -128,7 +151,7 @@
 	            transform: translate(-50%, -50%) rotate(-45deg);
 	          "></span>
 
-            <!-- 未完成 - 方框 + 叉 -->
+	          <!-- 未完成 - 方框 + 叉 -->
 	          <span v-if="log === 3" style="
 	            position: absolute;
 	            top: 50%;
@@ -136,7 +159,10 @@
 	            width: 8px;
 	            height: 2px;
 	            background: #666;
-	            transform: translate(-50%, -50%) rotate(45deg);"></span>
+	            transform: translate(-50%, -50%) rotate(45deg);">
+				</span>
+
+
 	          <span v-if="log === 1" style="
 	            position: absolute;
 	            top: 50%;
@@ -147,7 +173,7 @@
 	            transform: translate(-50%, -10%) rotate(-15deg);
 	          "></span>
 
-            <!-- 部分完成 - 菱形 -->
+	          <!-- 部分完成 - 菱形 -->
 	          <span v-if="log === 4" style="
 	            position: absolute;
 	            top: 50%;
@@ -158,7 +184,7 @@
 	            transform: translate(-50%, -50%) rotate(-45deg);
 	          "></span>
 
-            <!-- 未开始 - 减号 -->
+	          <!-- 未开始 - 减号 -->
 	          <span v-if="!log" style="
 	            position: absolute;
 	            top: 50%;
@@ -169,7 +195,7 @@
 	            transform: translate(-50%, -50%);
 	          "></span>
 
-            <!-- 图像 - 使用img标签 -->
+	          <!-- 图像 - 使用img标签 -->
 	          <img v-if="log === 5" src="/path/to/your-image.png" alt="Custom icon" style="
 	            position: absolute;
 	            top: 50%;
@@ -179,39 +205,28 @@
 	            transform: translate(-50%, -50%);
 	          ">
 	        </span>
-          </div>
-        </template>
-      </el-table-column>
-      <el-table-column label="最晚看课时间" align="center">
-        <template slot-scope="scope">
-          {{ formatTime(scope.row.lastWatchTime) }}
-        </template>
-      </el-table-column>
+	      </div>
+	    </template>
+	  </el-table-column>
+	    <el-table-column label="最晚看课时间" align="center">
+	        <template slot-scope="scope">
+	          {{ formatTime(scope.row.lastWatchTime) }}
+	        </template>
+	      </el-table-column>
 
       <el-table-column label="sopId" align="center" prop="sopId" />
-      <el-table-column label="通话时长" align="center" prop="duration" />
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="修改时间" align="center" prop="updateTime" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+<!--      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button v-if="scope.row.status==0"
-                     size="mini"
-                     type="text"
-                     icon="el-icon-edit"
-                     @click="handleUpdate(scope.row)"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
           >处理</el-button>
-          <el-button v-if="scope.row.status==0"
-                     size="mini"
-                     type="text"
-                     @click="handleUpdate2(scope.row)"
-          >未接通</el-button>
-          <el-button v-if="scope.row.status==0"
-                     size="mini"
-                     type="text"
-                     @click="handleUpdate3(scope.row)"
-          >接通</el-button>
         </template>
-      </el-table-column>
+      </el-table-column> -->
     </el-table>
 
     <pagination
@@ -221,179 +236,167 @@
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
-    <div style="margin-top: 20px; padding: 12px; background: #f8f8f8; border-radius: 4px;" v-if="!isSM">
-      <div style="display: flex; gap: 20px; flex-wrap: wrap;">
-        <div style="display: flex; align-items: center; gap: 8px;">
-          <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #67C23A;"></span>
-          <span>完课</span>
-        </div>
-        <div style="display: flex; align-items: center; gap: 4px;">
-          <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #f55a4f;"></span>
-          <span>待看课</span>
-        </div>
-        <div style="display: flex; align-items: center; gap: 4px;">
-          <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #FFD700;"></span>
-          <span>看课中断</span>
-        </div>
-        <div style="display: flex; align-items: center; gap: 4px;">
-          <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #909399;"></span>
-          <span>没发课</span>
-        </div>
-        <div style="display: flex; align-items: center; gap: 4px;">
-          <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #0bc6ff;"></span>
-          <span>看课中</span>
-        </div>
-      </div>
-    </div>
-
-    <!-- 新增的解释说明区域 -->
-    <div style="margin-top: 20px; padding: 12px; background: #f8f8f8; border-radius: 4px;" v-if="isSM">
-      <div style="display: flex; gap: 20px; flex-wrap: wrap;">
-        <div style="display: flex; align-items: center; gap: 8px;">
-	            <span style="
-	              display: inline-block;
-	              width: 16px;
-	              height: 16px;
-	              border-radius: 50%;
-	              background-color: #f0f0f0;
-	              position: relative;
-	            ">
-	              <span style="
-	                position: absolute;
-	                top: 45%;
-	                left: 50%;
-	                width: 6px;
-	                height: 3px;
-	                border: solid #333;
-	                border-width: 0 0 2px 2px;
-	                transform: translate(-50%, -50%) rotate(-45deg);
-	              "></span>
-	            </span>
-          <span>完课</span>
-        </div>
-
-        <div style="display: flex; align-items: center; gap: 8px;">
-	            <span style="
-	              display: inline-block;
-	              width: 16px;
-	              height: 16px;
-	              border-radius: 2px;
-	              border: 2px solid #666;
-	              background-color: transparent;
-	              position: relative;
-	            ">
-	              <span style="
-	                position: absolute;
-	                top: 50%;
-	                left: 50%;
-	                width: 8px;
-	                height: 2px;
-	                background: #666;
-	                transform: translate(-50%, -50%) rotate(45deg);
-	              "></span>
-	              <span style="
-	                position: absolute;
-	                top: 50%;
-	                left: 50%;
-	                width: 8px;
-	                height: 2px;
-	                background: #666;
-	                transform: translate(-50%, -50%) rotate(-45deg);
-	              "></span>
-	            </span>
-          <span>待看课</span>
-        </div>
-
-        <div style="display: flex; align-items: center; gap: 8px;">
-	            <span style="
-	              display: inline-block;
-	              width: 16px;
-	              height: 16px;
-	              border-radius: 2px 8px;
-	              background-color: #f0f0f0;
-	              border: 1px solid #ddd;
-	              position: relative;
-	              transform: rotate(45deg);
-	            ">
-	              <span style="
-	                position: absolute;
-	                top: 50%;
-	                left: 50%;
-	                width: 6px;
-	                height: 6px;
-	                border: 2px solid #333;
-	                transform: translate(-50%, -50%) rotate(-45deg);
-	              "></span>
-	            </span>
-          <span>看课中断</span>
-        </div>
-
-        <div style="display: flex; align-items: center; gap: 8px;">
-	            <span style="
-	              display: inline-block;
-	              width: 16px;
-	              height: 16px;
-	              border-radius: 2px;
-	              background-color: #f0f0f0;
-	              border: 1px solid #ddd;
-	              position: relative;
-	            ">
-	              <span style="
-	                position: absolute;
-	                top: 50%;
-	                left: 50%;
-	                width: 8px;
-	                height: 2px;
-	                background: #999;
-	                transform: translate(-50%, -50%);
-	              "></span>
-	            </span>
-          <span>没发课</span>
-        </div>
-
-        <div style="display: flex; align-items: center; gap: 8px;">
-			    <span style="
-			      display: inline-block;
-			      width: 16px;
-			      height: 16px;
-			      border-radius: 2px;
-			      background-color: #f0f0f0;
-			      border: 1px solid #ddd;
-			      position: relative;
-			    ">
-			      <span  style="
-			        position: absolute;
-			        top: 50%;
-			        left: 50%;
-			        width: 8px;
-			        height: 2px;
-			        background: #666;
-			        transform: translate(-50%, -10%) rotate(-15deg);
-			      "></span>
-			    </span>
-          <span>看课中</span>
-        </div>
-
-
-      </div>
-    </div>
-
-
+	<div style="margin-top: 20px; padding: 12px; background: #f8f8f8; border-radius: 4px;" v-if="!isSM">
+	  <div style="display: flex; gap: 20px; flex-wrap: wrap;">
+	    <div style="display: flex; align-items: center; gap: 8px;">
+	      <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #67C23A;"></span>
+	      <span>完课</span>
+	    </div>
+	    <div style="display: flex; align-items: center; gap: 4px;">
+	      <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #f55a4f;"></span>
+	      <span>待看课</span>
+	    </div>
+	    <div style="display: flex; align-items: center; gap: 4px;">
+	      <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #FFD700;"></span>
+	      <span>看课中断</span>
+	    </div>
+	    <div style="display: flex; align-items: center; gap: 4px;">
+	      <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #909399;"></span>
+	      <span>没发课</span>
+	    </div>
+		<div style="display: flex; align-items: center; gap: 4px;">
+		  <span style="display: inline-block; width: 16px; height: 16px; border-radius: 2px; background-color: #0bc6ff;"></span>
+		  <span>看课中</span>
+		</div>
+	  </div>
+	</div>
+
+	<!-- 新增的解释说明区域 -->
+	<div style="margin-top: 20px; padding: 12px; background: #f8f8f8; border-radius: 4px;" v-if="isSM">
+	    <div style="display: flex; gap: 20px; flex-wrap: wrap;">
+	      <div style="display: flex; align-items: center; gap: 8px;">
+	        <span style="
+	          display: inline-block;
+	          width: 16px;
+	          height: 16px;
+	          border-radius: 50%;
+	          background-color: #f0f0f0;
+	          position: relative;
+	        ">
+	          <span style="
+	            position: absolute;
+	            top: 45%;
+	            left: 50%;
+	            width: 6px;
+	            height: 3px;
+	            border: solid #333;
+	            border-width: 0 0 2px 2px;
+	            transform: translate(-50%, -50%) rotate(-45deg);
+	          "></span>
+	        </span>
+	        <span>完课</span>
+	      </div>
+
+	      <div style="display: flex; align-items: center; gap: 8px;">
+	        <span style="
+	          display: inline-block;
+	          width: 16px;
+	          height: 16px;
+	          border-radius: 2px;
+	          border: 2px solid #666;
+	          background-color: transparent;
+	          position: relative;
+	        ">
+	          <span style="
+	            position: absolute;
+	            top: 50%;
+	            left: 50%;
+	            width: 8px;
+	            height: 2px;
+	            background: #666;
+	            transform: translate(-50%, -50%) rotate(45deg);
+	          "></span>
+	          <span style="
+	            position: absolute;
+	            top: 50%;
+	            left: 50%;
+	            width: 8px;
+	            height: 2px;
+	            background: #666;
+	            transform: translate(-50%, -50%) rotate(-45deg);
+	          "></span>
+	        </span>
+	        <span>待看课</span>
+	      </div>
+
+	      <div style="display: flex; align-items: center; gap: 8px;">
+	        <span style="
+	          display: inline-block;
+	          width: 16px;
+	          height: 16px;
+	          border-radius: 2px 8px;
+	          background-color: #f0f0f0;
+	          border: 1px solid #ddd;
+	          position: relative;
+	          transform: rotate(45deg);
+	        ">
+	          <span style="
+	            position: absolute;
+	            top: 50%;
+	            left: 50%;
+	            width: 6px;
+	            height: 6px;
+	            border: 2px solid #333;
+	            transform: translate(-50%, -50%) rotate(-45deg);
+	          "></span>
+	        </span>
+	        <span>看课中断</span>
+	      </div>
+
+	      <div style="display: flex; align-items: center; gap: 8px;">
+	        <span style="
+	          display: inline-block;
+	          width: 16px;
+	          height: 16px;
+	          border-radius: 2px;
+	          background-color: #f0f0f0;
+	          border: 1px solid #ddd;
+	          position: relative;
+	        ">
+	          <span style="
+	            position: absolute;
+	            top: 50%;
+	            left: 50%;
+	            width: 8px;
+	            height: 2px;
+	            background: #999;
+	            transform: translate(-50%, -50%);
+	          "></span>
+	        </span>
+	        <span>没发课</span>
+	      </div>
+
+		  <div style="display: flex; align-items: center; gap: 8px;">
+		    <span style="
+		      display: inline-block;
+		      width: 16px;
+		      height: 16px;
+		      border-radius: 2px;
+		      background-color: #f0f0f0;
+		      border: 1px solid #ddd;
+		      position: relative;
+		    ">
+		      <span  style="
+		        position: absolute;
+		        top: 50%;
+		        left: 50%;
+		        width: 8px;
+		        height: 2px;
+		        background: #666;
+		        transform: translate(-50%, -10%) rotate(-15deg);
+		      "></span>
+		    </span>
+		    <span>看课中</span>
+		  </div>
+
+
+	    </div>
+	  </div>
     <!-- 添加或修改企微任务看板对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="处理类型" prop="trackType">
-          <el-select v-model="form.trackType" placeholder="状态" clearable size="small">
-            <el-option
-              v-for="dict in trackTypeOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
-            />
-          </el-select>
-        </el-form-item>
-        <el-form-item label="描述" prop="description">
-          <el-input  v-model="form.description" placeholder="请输入描述"  type="textarea" :rows="3"/>
+        <el-form-item label="备注" prop="remark">
+          <el-input  v-model="form.remark" placeholder="请输入备注"  type="textarea" :rows="3"/>
         </el-form-item>
       </el-form>
       <div slot="footer" class="dialog-footer">
@@ -407,19 +410,34 @@
 <script>
 import { listQwWorkTask, getQwWorkTask, delQwWorkTask, addQwWorkTask, updateQwWorkTask, exportQwWorkTask,updateQwWorkTask2,updateQwWorkTask3 } from "@/api/qw/QwWorkTask";
 import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey, updateUser} from "@/api/qw/user";
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import { getCompanyUserListLikeName } from "@/api/company/companyUser";
 export default {
   name: "QwWorkTask",
+  components: { Treeselect  },
   data() {
     return {
-      actName:"0",
+	  actName:"0",
       // 遮罩层
       loading: true,
       // 导出遮罩层
       exportLoading: false,
+	  companyUserOptionsParams: {
+	    name: undefined,
+	    hasNextPage: false,
+	    pageNum: 1,
+	    pageSize: 10
+	  },
+	  isSM:false,
+
+	  companyUserOptionsLoading: false,
+	  companyUserOptions: [],
       // 选中数组
       ids: [],
-      isSM:false,
-      myQwUserList:[],
+	  deptOptions:[],
+	  myQwUserList:[],
       // 非单个禁用
       single: true,
       // 非多个禁用
@@ -436,9 +454,9 @@ export default {
       open: false,
       // 状态 0 待处理 1 已处理 3 过期字典
       statusOptions: [],
-      trackTypeOptions:[],
-      // 类别 1先导 2 课程 3 大小转 4 转人工字典
+      // 类别 1先导 2 课程 3 节点 4 转人工字典
       typeOptions: [],
+	  trackTypeOptions:[],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -457,59 +475,92 @@ export default {
       form: {},
       // 表单校验
       rules: {
-        trackType: [
-          { required: true, message: '请选择处理类型', trigger: 'change' }
-        ]
       }
     };
   },
   created() {
-    this.handleGetMyQwUserList();
+	this.handleGetMyQwUserList();
     this.getDicts("sys_qw_work_task_status").then(response => {
       this.statusOptions = response.data;
     });
     this.getDicts("sys_qw_work_task_type").then(response => {
       this.typeOptions = response.data;
     });
-    this.getDicts("sys_qw_work_task_track_type").then(response => {
-      this.trackTypeOptions = response.data;
-    });
-
-
+	this.getDicts("sys_qw_work_task_track_type").then(response => {
+	  this.trackTypeOptions = response.data;
+	});
+	this.getTreeselect();
   },
   methods: {
-    getScoreStyle(score) {
-      let backgroundColor = '';
-      if (score >= 15) {
-        backgroundColor = '#ff4d4f';    // 红色
-      } else if (score >= 9) {
-        backgroundColor = '#ff7d45';    // 橘红
-      } else if (score >= 4) {
-        backgroundColor = '#ffec3d';    // 黄色
-      } else {
-        backgroundColor = '#ffffff';    // 白色
-      }
-      return {
-        'background-color': backgroundColor,
-        'padding': '5px 10px',
-        'border-radius': '4px'
-      };
-    },
-    formatTime(timeStr) {
-      if (!timeStr && timeStr !== 0) return '';
-
-      // 处理数字和字符串输入
-      const str = String(timeStr).padStart(4, '0');
-
-      // 提取有效部分
-      const hours = str.substring(0, 2);
-      const minutes = str.substring(2, 4);
-
-      // 简单验证
-      if (hours > 23 || minutes > 59) return '无效时间';
-
-      return `${hours}:${minutes}`;
-    },
+	getScoreStyle(score) {
+	let backgroundColor = '';
+	  if (score >= 15) {
+		backgroundColor = '#ff4d4f';    // 红色
+	  } else if (score >= 9) {
+		backgroundColor = '#ff7d45';    // 橘红
+	  } else if (score >= 4) {
+		backgroundColor = '#ffec3d';    // 黄色
+	  } else {
+		backgroundColor = '#ffffff';    // 白色
+	  }
+	  return {
+		'background-color': backgroundColor,
+		'padding': '5px 10px',
+		'border-radius': '4px'
+	  };
+	},
+	getTreeselect() {
+	  var that=this;
+	  var param={companyId:this.companyId}
+	  treeselect(param).then((response) => {
+	    this.deptOptions = response.data;
+	    console.log(this.deptOptions)
+	    if(response.data!=null&&response.data.length>0){
+	      //this.queryParams.deptId=response.data[0].id;
+	    }
+	  });
+	},
+	loadCompanyUserOptions(query) {
+	  this.companyUserOptions = [];
+	  if (query === '') {
+	    return;
+	  }
+
+	  this.companyUserOptionsParams.pageNum = 1
+	  this.companyUserOptionsParams.name = query
+	  this.companyUserOptionsLoading = true;
+	  this.getCompanyUserListLikeName()
+	},
+	getCompanyUserListLikeName() {
+	  getCompanyUserListLikeName(this.companyUserOptionsParams).then(response => {
+	    this.companyUserOptions = [...this.companyUserOptions, ...response.data.list]
+	    this.companyUserOptionsParams.hasNextPage = response.data.hasNextPage
+	    this.companyUserOptionsLoading = false;
+	  });
+	},
+	loadMoreCompanyUserOptions() {
+	  if (!this.companyUserOptionsParams.hasNextPage) {
+	    return;
+	  }
+
+	  this.companyUserOptionsParams.pageNum += 1
+	  this.getCompanyUserListLikeName()
+	},
+	formatTime(timeStr) {
+	      if (!timeStr && timeStr !== 0) return '';
+
+	      // 处理数字和字符串输入
+	      const str = String(timeStr).padStart(4, '0');
+
+	      // 提取有效部分
+	      const hours = str.substring(0, 2);
+	      const minutes = str.substring(2, 4);
+
+	      // 简单验证
+	      if (hours > 23 || minutes > 59) return '无效时间';
+
+	      return `${hours}:${minutes}`;
+	    },
     /** 查询企微任务看板列表 */
     getList() {
       this.loading = true;
@@ -519,13 +570,13 @@ export default {
         this.loading = false;
       });
     },
-    sm(){
-      this.isSM = this.isSM ? false : true;
-    },
-    handleClickX(tab, event) {
-      this.queryParams.status=tab.name;
-      this.handleQuery();
-    },
+	handleClickX(tab, event) {
+	  this.queryParams.status=tab.name;
+	  this.handleQuery();
+	},
+	sm(){
+		this.isSM = this.isSM ? false : true;
+	},
     // 取消按钮
     cancel() {
       this.open = false;
@@ -555,18 +606,10 @@ export default {
       this.queryParams.pageNum = 1;
       this.getList();
     },
-    handleGetMyQwUserList(){
+	handleGetMyQwUserList(){
 
-      getMyQwUserList().then(response => {
-        this.myQwUserList = response.data;
-        if(this.myQwUserList!=null){
-          this.queryParams.qwUserId=this.myQwUserList[0].dictValue
-          this.queryParams.corpId=this.myQwUserList[0].corpId
-          this.getList();
-        }
-      });
-
-    },
+		this.getList();
+	},
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
@@ -588,29 +631,11 @@ export default {
     handleUpdate(row) {
       this.reset();
       const id = row.id || this.ids
-      this.form = row;
-      this.open = true;
-      this.title = "处理任务";
+        this.form = row;
+        this.open = true;
+        this.title = "处理任务";
 
     },
-
-    handleUpdate2(row) {
-      var from={id:row.id }
-      updateQwWorkTask2(from).then(response => {
-        this.msgSuccess("修改成功");
-
-        this.getList();
-      });
-
-    },
-    handleUpdate3(row) {
-      var from={id:row.id }
-      updateQwWorkTask3(from).then(response => {
-        this.msgSuccess("修改成功");
-
-        this.getList();
-      });
-    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {
@@ -635,30 +660,30 @@ export default {
     handleDelete(row) {
       const ids = row.id || this.ids;
       this.$confirm('是否确认删除企微任务看板编号为"' + ids + '"的数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(function() {
-        return delQwWorkTask(ids);
-      }).then(() => {
-        this.getList();
-        this.msgSuccess("删除成功");
-      }).catch(() => {});
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delQwWorkTask(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有企微任务看板数据项?', "警告", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning"
-      }).then(() => {
-        this.exportLoading = true;
-        return exportQwWorkTask(queryParams);
-      }).then(response => {
-        this.download(response.msg);
-        this.exportLoading = false;
-      }).catch(() => {});
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportQwWorkTask(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
     }
   }
 };

+ 24 - 9
src/views/qw/externalContact/deptIndex.vue

@@ -234,7 +234,17 @@
           v-hasPermi="['qw:externalContact:deptEdit']"
         >批量修改备注</el-button>
       </el-col>
-
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotesFilter"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注(筛选条件)
+        </el-button>
+      </el-col>
       <!-- <el-col :span="1.5">
         <el-button
           type="warning"
@@ -285,11 +295,11 @@
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
-    <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">
-      <el-tab-pane label="全部" name="all"></el-tab-pane>
+<!--    <el-tabs type="card" v-model="isBindActiveName" @tab-click="handleClickX">-->
+<!--      <el-tab-pane label="全部" name="all"></el-tab-pane>-->
       <!--      <el-tab-pane label="已绑定CRM" name="isBind"></el-tab-pane>-->
       <!--      <el-tab-pane label="未绑定CRM" name="noBind"></el-tab-pane>-->
-    </el-tabs>
+<!--    </el-tabs>-->
 
     <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
       <el-table-column type="selection" width="55" align="center" />
@@ -849,10 +859,12 @@ export default {
       exportLoading: false,
       tagOpen:false,
       notesOpen: {
-        type:1,
-        nameType:3,
-        open:false,
-        notes:null,
+        type: 1,
+        nameType: 3,
+        addType: 0,
+        filter: false,
+        open: false,
+        notes: null,
       },
       tagDelOpen:false,
       // 选中数组
@@ -1253,7 +1265,10 @@ export default {
       this.notesOpen.open=true;
 
     },
-
+    handleBatchUpdateNotesFilter() {
+      this.notesOpen.open = true;
+      this.notesOpen.filter = true;
+    },
     addUserTag(){
 
       if(this.ids==null||this.ids==""){

+ 142 - 3
src/views/qw/externalContact/index.vue

@@ -224,6 +224,28 @@
           v-hasPermi="['qw:externalContact:add']"
         >同步</el-button>
       </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotes"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotesFilter"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注(筛选条件)
+        </el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -329,7 +351,13 @@
           </div>
         </template>
       </el-table-column>
-
+      <el-table-column label="是否回复" align="center" prop="isReply" width="120px" >
+        <template slot-scope="scope">
+          <span v-if="scope.row.isReply === 1"><el-tag type="success">已回复</el-tag></span>
+          <span v-else-if="scope.row.isReply === 0"><el-tag type="info">未回复</el-tag></span>
+          <span v-else>{{ scope.row.isReply }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="状态" align="center" prop="status" width="120px" >
         <template slot-scope="scope">
           <dict-tag :options="statusOptions" :value="scope.row.status"/>
@@ -533,6 +561,53 @@
         <el-button @click="addTagCancel">取 消</el-button>
       </div>
     </el-dialog>
+    <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
+      <el-card>
+        <el-row>
+          <el-col>
+            <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
+              <el-radio :label="1">
+                客户名称添加在【新备注】【前】
+              </el-radio>
+              <el-radio :label="2">
+                客户名称添加在【新备注】【后】
+              </el-radio>
+              <el-radio :label="3">
+                不添加客户名称
+              </el-radio>
+            </el-radio-group>
+          </el-col>
+          <el-col>
+            <el-radio-group v-model="notesOpen.type">
+              <el-radio
+                :label="1"
+              >添加【新备注】在最【前】面
+              </el-radio>
+              <el-radio
+                :label="2"
+              >添加【新备注】在最【后】面
+              </el-radio>
+              <el-radio
+                :label="3"
+              >替换所有备注
+              </el-radio>
+            </el-radio-group>
+          </el-col>
+          <el-col>
+            <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
+                      maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>
+            <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
+              <i class="el-icon-info"></i>
+              由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
+            </div>
+          </el-col>
+        </el-row>
+      </el-card>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
+        <el-button @click="notesCancel()">取消</el-button>
+      </div>
+    </el-dialog>
 
     <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
       <div>搜索标签:
@@ -658,6 +733,7 @@ import {
   bindUserId,
   addTag,
   delTag,
+  batchUpdateExternalContactNotes,
   listExternalContact,
   getExternalContact,
   delExternalContact,
@@ -685,6 +761,14 @@ export default {
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info},
   data() {
     return {
+      notesOpen: {
+        type: 1,
+        nameType: 3,
+        addType: 0,
+        filter: false,
+        open: false,
+        notes: null,
+      },
       user:{
         open:false,
         title:"修改客户"
@@ -1714,7 +1798,7 @@ export default {
 	},
     /** 导出按钮操作 */
     handleExport() {
-      const queryParams = this.queryParams;
+      const { qwUserName, ...queryParams } = this.queryParams;
       this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -1726,9 +1810,64 @@ export default {
           this.download(response.msg);
           this.exportLoading = false;
         }).catch(() => {});
-    }
+    },
+    handleBatchUpdateNotesFilter() {
+      this.notesOpen.open = true;
+      this.notesOpen.filter = true;
+    },
+    handleBatchUpdateNotes() {
+
+      if (this.ids == null || this.ids == "") {
+        return this.$message('请选择需要添加备注的客户');
+      }
+
+      this.notesOpen.open = true;
+      this.notesOpen.filter = false;
+
+    },
+    notesSubmitForm() {
+
+      if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
+        return this.$message.error("请输入备注内容");
+      }
+
+      // let loadingRock = this.$loading({
+      //   lock: true,
+      //   text: '正在执行中请稍后~~请不要刷新页面!!',
+      //   spinner: 'el-icon-loading',
+      //   background: 'rgba(0, 0, 0, 0.7)'
+      // });
+
+      let obj = JSON.parse(JSON.stringify(this.queryParams))
+      console.log(obj);
+      if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
+        obj.tagIds = obj.tagIds.split(",");
+      }
+      batchUpdateExternalContactNotes({
+        addType: 0,
+        userIds: this.ids,
+        notes: this.notesOpen.notes,
+        type: this.notesOpen.type,
+        nameType: this.notesOpen.nameType,
+        filter: this.notesOpen.filter,
+        param: obj
+      }).then(res => {
+
+        this.resultMessage = res.msg;
+        this.$message.success("正在执行中...");
+        // this.resultDialogVisible = true; // 显示弹窗
+        // this.resultTitle = '批量修改备注结果';
+
+      }).finally(res => {
+        this.getList();
+        // loadingRock.close();
+        this.notesCancel();
+      })
+
+    },
   }
 };
+
 </script>
 <style scoped>
 /* CSS 样式 */

+ 277 - 3
src/views/qw/externalContact/myExternalContact.vue

@@ -178,6 +178,28 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotes"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          @click="handleBatchUpdateNotesFilter"
+          v-hasPermi="['qw:externalContact:edit']"
+        >批量修改备注(筛选条件)
+        </el-button>
+      </el-col>
       <!-- <el-col :span="1.5">
         <el-button
           type="primary"
@@ -321,6 +343,13 @@
           </div>
         </template>
       </el-table-column>
+      <el-table-column label="是否回复" align="center" prop="isReply" width="120px" >
+        <template slot-scope="scope">
+          <span v-if="scope.row.isReply === 1"><el-tag type="success">已回复</el-tag></span>
+          <span v-else-if="scope.row.isReply === 0"><el-tag type="info">未回复</el-tag></span>
+          <span v-else>{{ scope.row.isReply }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="状态" align="center" prop="status" width="120px" >
         <template slot-scope="scope">
           <dict-tag :options="statusOptions" :value="scope.row.status"/>
@@ -413,6 +442,13 @@
           >
             <span>解除会员绑定</span>
           </el-button>
+          <el-button v-show="scope.row.fsUserId"
+            size="mini"
+            type="text"
+            @click="handleDiagnosis(scope.row)"
+          >
+            <span>初诊单</span>
+          </el-button>
 
 <!--          <el-button v-if="scope.row.customerId"-->
 <!--            size="mini"-->
@@ -444,6 +480,82 @@
       @pagination="getList"
     />
 
+    <!-- 添加或修改初诊单对话框 -->
+    <el-dialog title="初诊单" :visible.sync="diagnosisOpen" width="1000px" append-to-body>
+      <el-form ref="diagnosisForm" :model="diagnosisForm" :rules="diagnosisRules" label-width="110px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="患者姓名" prop="patientName">
+              <el-input v-model="diagnosisForm.patientName" placeholder="请输入患者姓名" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="年龄" prop="age">
+              <el-input-number v-model="diagnosisForm.age"  :min="1" label="年龄"></el-input-number>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="患者电话" prop="phone">
+              <el-input v-model="diagnosisForm.phone" placeholder="请输入电话" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="性别" prop="gender">
+              <el-select  v-model="diagnosisForm.gender">
+                <el-option label="未知" :value = "0"></el-option>
+                <el-option label="男性" :value = "1"></el-option>
+                <el-option label="女性" :value = "2"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="日期" prop="dateTime">
+              <el-date-picker clearable size="small"
+                v-model="diagnosisForm.dateTime"
+                type="date"
+                value-format="yyyy-MM-dd"
+                placeholder="选择日期">
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="医生" prop="doctorId">
+              <el-select v-model="diagnosisForm.doctorId" placeholder="选择医生"  size="small" @change="doctorChange">
+                <el-option
+                  v-for="dict in doctorList"
+                  :key="dict.id"
+                  :label="dict.name"
+                  :value="dict.id"
+                />
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-form-item label="身体状况" prop="physicalCondition">
+          <el-input v-model="diagnosisForm.physicalCondition" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+
+        <el-form-item label="初步诊断" prop="firstDiagnosis">
+          <el-input v-model="diagnosisForm.firstDiagnosis" type="textarea" placeholder="请输入内容" />
+        </el-form-item>
+
+        <el-form-item label="医生职称" prop="doctorDep">
+          <el-input disabled v-model="diagnosisForm.doctorDep" placeholder="医生职称" />
+        </el-form-item>
+        <el-form-item label="医生证号" prop="doctorCertificate">
+          <el-input disabled v-model="diagnosisForm.doctorCertificate" placeholder="医生证号" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="diagnosisSubmitForm">确 定</el-button>
+        <el-button @click="diagnosisCancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
     <el-drawer size="75%" :title="show.title" :visible.sync="show.open">
       <customer-details  ref="customerDetails" @refreshList="refreshList"/>
     </el-drawer>
@@ -542,7 +654,53 @@
         <el-button @click="addTagCancel">取 消</el-button>
       </div>
     </el-dialog>
-
+    <el-dialog title="批量添加客户备注" :visible.sync="notesOpen.open" width="800px" append-to-body>
+      <el-card>
+        <el-row>
+          <el-col>
+            <el-radio-group v-model="notesOpen.nameType" style="margin-bottom: 2%">
+              <el-radio :label="1">
+                客户名称添加在【新备注】【前】
+              </el-radio>
+              <el-radio :label="2">
+                客户名称添加在【新备注】【后】
+              </el-radio>
+              <el-radio :label="3">
+                不添加客户名称
+              </el-radio>
+            </el-radio-group>
+          </el-col>
+          <el-col>
+            <el-radio-group v-model="notesOpen.type">
+              <el-radio
+                :label="1"
+              >添加【新备注】在最【前】面
+              </el-radio>
+              <el-radio
+                :label="2"
+              >添加【新备注】在最【后】面
+              </el-radio>
+              <el-radio
+                :label="3"
+              >替换所有备注
+              </el-radio>
+            </el-radio-group>
+          </el-col>
+          <el-col>
+            <el-input v-model="notesOpen.notes" placeholder="请输入客户备注(最多20个字,含已有的)" clearable size="small"
+                      maxlength="20" show-word-limit style="width: 500px;margin-top: 3%"/>
+            <div style="color: #999;font-size: 14px;display: flex;align-items: center;">
+              <i class="el-icon-info"></i>
+              由于企业微信官方限制,备注最多20个字,且自动会去除末尾超出的字
+            </div>
+          </el-col>
+        </el-row>
+      </el-card>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="notesSubmitForm()">确 定</el-button>
+        <el-button @click="notesCancel()">取消</el-button>
+      </div>
+    </el-dialog>
     <el-dialog title="批量移除标签" :visible.sync="tagDelOpen" width="800px" append-to-body>
       <div>搜索标签:
         <el-input v-model="tagChange.tagName" placeholder="请输入标签名称" clearable size="small" style="width: 200px;margin-right: 10px" />
@@ -666,6 +824,7 @@ import {
   myList,
   bindUserId,
   addTag,
+  batchUpdateExternalContactNotes,
   delTag,
   listExternalContact,
   getExternalContact,
@@ -682,6 +841,7 @@ import {
 } from '@/api/qw/externalContact'
 import info from "@/views/qw/externalContact/info.vue";
 import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey, updateUser} from "@/api/qw/user";
+import {addFsFirstDiagnosis, updateFsFirstDiagnosis, getFsFirstDiagnosis} from "@/api/company/firstDiagnosis";
 import {listTag, getTag, searchTags,} from "@/api/qw/tag";
 import { allListTagGroup} from "../../../api/qw/tagGroup";
 import mycustomer from '@/views/qw/externalContact/mycustomer'
@@ -690,12 +850,25 @@ import SopDialog from '@/views/course/sop/SopDialog.vue'
 import  selectUser  from "@/views/qw/externalContact/selectUser.vue";
 import { editTalk,editAllTalk } from "@/api/qw/externalContactInfo";
 import {createLinkUrl} from "@/api/course/sopCourseLink";
+import {docList} from "@/api/doctor/doctor";
 import PaginationMore from "../../../components/PaginationMore/index.vue";
 export default {
   name: "ExternalContact",
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info},
   data() {
     return {
+      doctorList:[],
+      diagnosisForm:{},
+      diagnosisOpen:false,
+      diagnosisRules:{},
+      notesOpen: {
+        type: 1,
+        nameType: 3,
+        addType: 0,
+        filter: false,
+        open: false,
+        notes: null,
+      },
       user:{
         open:false,
         title:"修改客户"
@@ -861,7 +1034,8 @@ export default {
       statusOptions:[],
       // 表单校验
       rules: {
-      }
+      },
+      fsUserId: null,
     };
   },
   created() {
@@ -895,9 +1069,55 @@ export default {
     this.getDicts("sys_qw_transfer_status").then(response => {
       this.transferStatusOptions = response.data;
     });
+    this.getDocList();
 
   },
   methods: {
+    doctorChange(val){
+      for(const doctor of this.doctorList) {
+        if(doctor.id == val) {
+          this.diagnosisForm.doctorDep = doctor.position;
+          this.diagnosisForm.doctorCertificate = doctor.certificateCode;
+          this.diagnosisForm.doctorName = doctor.name;
+          break;
+        }
+      }
+      console.log(this.diagnosisForm)
+    },
+    getDocList(){
+      docList().then(res => {
+        this.doctorList = res.rows;
+      })
+    },
+    handleDiagnosis(row){
+      getFsFirstDiagnosis(row.fsUserId).then(res => {
+        this.diagnosisForm = res.data;
+      });
+      this.fsUserId = row.fsUserId;
+      this.diagnosisOpen = true;
+    },
+   diagnosisSubmitForm(){
+    this.$refs["diagnosisForm"].validate(valid => {
+        if (valid) {
+          this.diagnosisForm.qwUserId = this.queryParams.qwUserId;
+          this.diagnosisForm.userId = this.fsUserId;
+          if (this.diagnosisForm.id != null) {
+            updateFsFirstDiagnosis(this.diagnosisForm).then(response => {
+              this.msgSuccess("修改成功");
+              this.diagnosisOpen = false;
+            });
+          } else {
+            addFsFirstDiagnosis(this.diagnosisForm).then(response => {
+              this.msgSuccess("新增成功");
+              this.diagnosisOpen = false;
+            });
+          }
+        }
+      });
+   },
+   diagnosisCancel(){
+    this.diagnosisOpen = false;
+   },
 	 change(){
 		if(this.createTime!=null){
 		  this.queryParams.sTime=this.createTime[0];
@@ -1735,7 +1955,61 @@ export default {
           this.download(response.msg);
           this.exportLoading = false;
         }).catch(() => {});
-    }
+    },
+    handleBatchUpdateNotesFilter() {
+      this.notesOpen.open = true;
+      this.notesOpen.filter = true;
+    },
+    handleBatchUpdateNotes() {
+
+      if (this.ids == null || this.ids == "") {
+        return this.$message('请选择需要添加备注的客户');
+      }
+
+      this.notesOpen.open = true;
+      this.notesOpen.filter = false;
+
+    },
+    notesSubmitForm() {
+
+      if (this.notesOpen.notes == null || this.notesOpen.notes == "") {
+        return this.$message.error("请输入备注内容");
+      }
+
+      // let loadingRock = this.$loading({
+      //   lock: true,
+      //   text: '正在执行中请稍后~~请不要刷新页面!!',
+      //   spinner: 'el-icon-loading',
+      //   background: 'rgba(0, 0, 0, 0.7)'
+      // });
+
+      let obj = JSON.parse(JSON.stringify(this.queryParams))
+      console.log(obj);
+      if(obj.tagIds !== null && obj.tagIds !== undefined && obj.tagIds !== ''){
+        obj.tagIds = obj.tagIds.split(",");
+      }
+      batchUpdateExternalContactNotes({
+        addType: 0,
+        userIds: this.ids,
+        notes: this.notesOpen.notes,
+        type: this.notesOpen.type,
+        nameType: this.notesOpen.nameType,
+        filter: this.notesOpen.filter,
+        param: obj
+      }).then(res => {
+
+        this.resultMessage = res.msg;
+        this.$message.success("正在执行中...");
+        // this.resultDialogVisible = true; // 显示弹窗
+        // this.resultTitle = '批量修改备注结果';
+
+      }).finally(res => {
+        this.getList();
+        // loadingRock.close();
+        this.notesCancel();
+      })
+
+    },
   }
 };
 </script>

+ 5 - 1
src/views/qw/externalContactTransfer/index.vue

@@ -306,6 +306,7 @@ export default {
       isQwUserISNull:false,
       qwUserNameList:[],
       qwUserName:null,
+      type:'0',
       qwUserNameParam:{
         qwUserName:null
       },
@@ -476,6 +477,7 @@ export default {
 
     handleTransfer(row) {
       this.reset();
+      this.type="0";
       if(this.ids==null||this.ids==""){
         return  this.$message('请选择需要分配的客户');
       }
@@ -491,6 +493,7 @@ export default {
      handleTransferAll(row) {
       this.reset();
       this.qwUserName=this.queryParams.qwUserName;
+      this.type="1";
       setTimeout(() => {
                     this.$refs.qwUserSelectOne.getDetails(this.queryParams.corpId);
        }, 1);
@@ -507,9 +510,10 @@ export default {
             var form={
               ids:this.ids,
               qwUserName:this.qwUserName,
+              type:this.type,
               userId:this.form.userId,
               corpId:this.queryParams.corpId,
-			  content:this.form.content,
+              content:this.form.content,
             }
             transfer(form).then(response => {
               this.msgSuccess(response.msg);

+ 6 - 2
src/views/qw/externalContactUnassigned/index.vue

@@ -272,6 +272,7 @@ export default {
       qwUserList:[],
       isQwUserISNull:false,
       qwUserName:null,
+      type:'0',
        qwUserNameList:[],
       qwUserNameParam:{
         qwUserName:null
@@ -440,6 +441,7 @@ export default {
 
     handleTransfer(row) {
       this.reset();
+      this.type = '0'
       if(this.ids==null||this.ids==""){
         return  this.$message('请选择需要分配的客户');
       }
@@ -451,10 +453,11 @@ export default {
 
     },
 
-    
+
      handleTransferAll(row) {
       this.reset();
      this.qwUserName=this.queryParams.qwUserName;
+       this.type="1";
       setTimeout(() => {
                     this.$refs.qwUserSelectOne.getDetails(this.queryParams.corpId);
        }, 1);
@@ -468,7 +471,8 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
             var form={
-              qwUserName:this.qwUserName, 
+              qwUserName:this.qwUserName,
+              type:this.type,
               ids:this.ids,
               userId:this.form.userId,
               corpId:this.queryParams.corpId,

+ 2 - 2
src/views/qw/friendWelcome/indexNew.vue

@@ -12,11 +12,11 @@
           </el-select>
       </el-form-item>
       <el-form-item label="使用的成员" >
-        <el-select v-model="queryParams.qwUserIds" filterable  clearable placeholder="公司员工"   size="small">
+        <el-select filterable v-model="queryParams.qwUserIds" filterable  clearable placeholder="公司员工"   size="small">
           <el-option
              v-for="dict in companyUserList"
              :key="dict.id"
-             :label="dict.qwUserName"
+             :label="dict.qwUserName+'('+dict.qwUserId+')'"
              :value="dict.id">
           </el-option>
         </el-select>

+ 164 - 0
src/views/qw/qwUserDelLossStatistics/index.vue

@@ -0,0 +1,164 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px">
+      <el-form-item label="企微员工账号" prop="userId">
+        <el-input
+          v-model="queryParams.userId"
+          placeholder="请输入企微员工账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+
+      <el-form-item label="员工名称" prop="userName">
+        <el-input
+          v-model="queryParams.userName"
+          placeholder="请输入企微员工名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="时间">
+          <el-date-picker
+          v-model="dateRange"
+          type="daterange"
+          range-separator="至"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="yyyy-MM-dd"
+          style="width: 240px"
+        />
+        </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['qw:externalContact:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+    
+    
+    <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
+      <el-table-column label="企微员工账号" align="center" prop="userId" />
+      <el-table-column label="企微员工名称" align="center" prop="qwUserName"/>
+      <el-table-column label="删除数量" align="center" prop="delCount" />
+      <el-table-column label="流失数量" align="center" prop="lossCount" />
+    </el-table>
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+  </div>
+</template>
+
+<script>
+import { delLossStatisticsExport, delLossStatistics } from "@/api/qw/externalContact";
+export default {
+  name: "ExternalContact",
+  data() {
+    return {
+      dateRange: [],
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 企业微信客户表格数据
+      externalContactList: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        qwUserName:null,
+        startTime: null,
+        endTime: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    /** 查询企业微信客户删除流失统计列表 */
+    getList() {
+      this.loading = true;
+      if (this.dateRange && this.dateRange.length === 2) {
+        this.queryParams.startTime = this.dateRange[0];
+        this.queryParams.endTime = this.dateRange[1];
+      } else {
+        this.queryParams.startTime = null;
+        this.queryParams.endTime = null;
+      }
+      delLossStatistics(this.queryParams).then(response => {
+        this.externalContactList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.dateRange = [];  
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有企业微信客户数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return delLossStatisticsExport(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 148 - 133
src/views/qw/qwUserVoiceLogTotal/index.vue

@@ -1,16 +1,18 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="148px">
-<!--      <el-form-item label="外部联系人名称" prop="extName">
-        <el-input
-          v-model="queryParams.extName"
-          placeholder="请输入外部联系人名称"
+      <el-form-item label="部门" prop="type">
+        <treeselect
+          style="width: 220px"
+          :clearable="false"
+          v-model="queryParams.deptId"
+          :options="deptOptions"
           clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
+          :show-count="true"
+          placeholder="请选择归属部门"
         />
-      </el-form-item>-->
-      <el-form-item label="所属销售" prop="companyUserId">
+      </el-form-item>
+      <el-form-item label="所属客服" prop="companyUserId">
         <el-select v-model="queryParams.companyUserId" clearable filterable remote
                    placeholder="请输入关键词" :remote-method="loadCompanyUserOptions"
                    v-select-load-more="loadMoreCompanyUserOptions"
@@ -32,53 +34,53 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-<!--      <el-form-item label="标题" prop="title">
-        <el-input
-          v-model="queryParams.title"
-          placeholder="请输入标题"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>-->
-<!--      <el-form-item label="通话状态" prop="status">
-        <el-select v-model="queryParams.status" placeholder="请选择通话状态" clearable size="small">
-          <el-option
-            v-for="dict in statusOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="dict.dictValue"
-          />
-        </el-select>
-      </el-form-item>-->
-<!--      <el-form-item label="企微id" prop="corpId">
-        <el-input
-          v-model="queryParams.corpId"
-          placeholder="请输入企微id"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>-->
-<!--      <el-form-item label="公司名称" prop="companyName">
-        <el-input
-          v-model="queryParams.companyName"
-          placeholder="请输入公司名称"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>-->
+      <!--      <el-form-item label="标题" prop="title">
+              <el-input
+                v-model="queryParams.title"
+                placeholder="请输入标题"
+                clearable
+                size="small"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-form-item>-->
+      <!--      <el-form-item label="通话状态" prop="status">
+              <el-select v-model="queryParams.status" placeholder="请选择通话状态" clearable size="small">
+                <el-option
+                  v-for="dict in statusOptions"
+                  :key="dict.dictValue"
+                  :label="dict.dictLabel"
+                  :value="dict.dictValue"
+                />
+              </el-select>
+            </el-form-item>-->
+      <!--      <el-form-item label="企微id" prop="corpId">
+              <el-input
+                v-model="queryParams.corpId"
+                placeholder="请输入企微id"
+                clearable
+                size="small"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-form-item>-->
+      <!--      <el-form-item label="公司名称" prop="companyName">
+              <el-input
+                v-model="queryParams.companyName"
+                placeholder="请输入公司名称"
+                clearable
+                size="small"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-form-item>-->
 
-<!--      <el-form-item label="时长秒" prop="duration">
-        <el-input
-          v-model="queryParams.duration"
-          placeholder="请输入时长秒"
-          clearable
-          size="small"
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>-->
+      <!--      <el-form-item label="时长秒" prop="duration">
+              <el-input
+                v-model="queryParams.duration"
+                placeholder="请输入时长秒"
+                clearable
+                size="small"
+                @keyup.enter.native="handleQuery"
+              />
+            </el-form-item>-->
       <el-form-item label="创建时间" prop="createTime">
         <el-date-picker v-model="createTime" size="small" style="width: 220px"
                         value-format="yyyy-MM-dd" type="daterange" range-separator="-"
@@ -94,38 +96,38 @@
     </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="['qw:qwUserVoiceLog:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['qw:qwUserVoiceLog:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['qw:qwUserVoiceLog:remove']"
-        >删除</el-button>
-      </el-col>-->
+      <!--      <el-col :span="1.5">
+              <el-button
+                type="primary"
+                plain
+                icon="el-icon-plus"
+                size="mini"
+                @click="handleAdd"
+                v-hasPermi="['qw:qwUserVoiceLog:add']"
+              >新增</el-button>
+            </el-col>
+            <el-col :span="1.5">
+              <el-button
+                type="success"
+                plain
+                icon="el-icon-edit"
+                size="mini"
+                :disabled="single"
+                @click="handleUpdate"
+                v-hasPermi="['qw:qwUserVoiceLog:edit']"
+              >修改</el-button>
+            </el-col>
+            <el-col :span="1.5">
+              <el-button
+                type="danger"
+                plain
+                icon="el-icon-delete"
+                size="mini"
+                :disabled="multiple"
+                @click="handleDelete"
+                v-hasPermi="['qw:qwUserVoiceLog:remove']"
+              >删除</el-button>
+            </el-col>-->
       <el-col :span="1.5">
         <el-button
           type="warning"
@@ -143,7 +145,7 @@
           plain
           size="mini"
           @click="getSellList"
-        >切换到销售统计</el-button>
+        >切换到客服统计</el-button>
       </el-col>
 
       <el-col :span="1.5">
@@ -160,42 +162,42 @@
 
     <el-table border v-loading="loading" :data="qwUserVoiceLogList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
-<!--      <el-table-column label="id" align="center" width="80" prop="id" />-->
-<!--      <el-table-column label="外部联系人名称" align="center" prop="qwExternalContact.name" />-->
-      <el-table-column label="销售名称" align="center" prop="companyUserName" />
+      <!--      <el-table-column label="id" align="center" width="80" prop="id" />-->
+      <!--      <el-table-column label="外部联系人名称" align="center" prop="qwExternalContact.name" />-->
+      <el-table-column label="客服名称" align="center" prop="companyUserName" />
       <el-table-column label="企微用户名称" align="center" prop="qwUser.qwUserName" />
       <el-table-column label="企微主体名称" align="center" prop="corpName" />
       <el-table-column label="企微用户id" align="center" prop="qwUser.qwUserId" />
       <el-table-column label="时长秒" align="center"  prop="duration" />
       <el-table-column label="接通数量" align="center"  prop="connectCount" />
       <el-table-column label="未接通数量" align="center"  prop="noConnectCount" />
-<!--      <el-table-column label="标题" align="center" width="80" prop="title" />-->
-<!--      <el-table-column label="通话状态" align="center" prop="status">
-        <template slot-scope="scope">
-          <dict-tag :options="statusOptions" :value="scope.row.status"/>
-        </template>
-      </el-table-column>-->
+      <!--      <el-table-column label="标题" align="center" width="80" prop="title" />-->
+      <!--      <el-table-column label="通话状态" align="center" prop="status">
+              <template slot-scope="scope">
+                <dict-tag :options="statusOptions" :value="scope.row.status"/>
+              </template>
+            </el-table-column>-->
       <!--<el-table-column label="公司名称" align="center" prop="company.companyName" />
-      <el-table-column label="销售用户名称" align="center" prop="companyUser.userName" />
+      <el-table-column label="客服用户名称" align="center" prop="companyUser.userName" />
       <el-table-column label="创建时间" align="center" prop="createTime" />-->
-<!--      <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="['qw:qwUserVoiceLog:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['qw:qwUserVoiceLog:remove']"
-          >删除</el-button>
-        </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="['qw:qwUserVoiceLog:edit']"
+                >修改</el-button>
+                <el-button
+                  size="mini"
+                  type="text"
+                  icon="el-icon-delete"
+                  @click="handleDelete(scope.row)"
+                  v-hasPermi="['qw:qwUserVoiceLog:remove']"
+                >删除</el-button>
+              </template>
+            </el-table-column>-->
     </el-table>
 
     <pagination
@@ -212,9 +214,13 @@
 import { listQwUserVoiceLog, getQwUserVoiceLog, delQwUserVoiceLog, addQwUserVoiceLog, updateQwUserVoiceLog, exportQwUserVoiceLog } from "@/api/qw/qwUserVoiceLog";
 import {listQwUserVoiceLogTotal,exportQwUserVoiceLogTotal,listQwUserVoiceLogSellTotal,exportQwUserVoiceLogSellTotal} from "@/api/qw/qwUserVoiceLogTotal";
 import {getCompanyUserListLikeName} from "@/api/company/companyUser";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import {treeselect} from "../../../api/company/companyDept";
 
 export default {
   name: "QwUserVoiceLog",
+  components: {Treeselect},
   data() {
     return {
       // 遮罩层
@@ -238,6 +244,7 @@ export default {
       total: 0,
       // 企微用户通话记录表格数据
       qwUserVoiceLogList: [],
+      deptOptions: [],
       // 弹出层标题
       title: "",
       // 是否显示弹出层
@@ -280,6 +287,7 @@ export default {
     };
   },
   created() {
+    this.getDeptTreeSelect();
     this.handlePagination();
     this.getDicts("sys_qw_user_voice_status").then(response => {
       this.statusOptions = response.data;
@@ -296,6 +304,12 @@ export default {
         this.loading = false;
       });
     },
+
+    getDeptTreeSelect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
     getSellList() {
       this.loading = true;
       this.status = 1;
@@ -375,6 +389,7 @@ export default {
         createTime: null,
         beginTime:null,
         endTime:null,
+        deptOption:null,
       };
       this.resetForm("form");
     },
@@ -437,35 +452,35 @@ export default {
     handleDelete(row) {
       const ids = row.id || this.ids;
       this.$confirm('是否确认删除企微用户通话记录编号为"' + ids + '"的数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(function() {
-          return delQwUserVoiceLog(ids);
-        }).then(() => {
-          this.handlePagination();
-          this.msgSuccess("删除成功");
-        }).catch(() => {});
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delQwUserVoiceLog(ids);
+      }).then(() => {
+        this.handlePagination();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有企微用户通话记录数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
         if(this.status === 0){
           return exportQwUserVoiceLogTotal(queryParams);
         }else{
           return exportQwUserVoiceLogSellTotal(queryParams);
         }
 
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
     }
   }
 };

+ 5 - 5
src/views/qw/sop/addSop.vue

@@ -29,12 +29,12 @@
               :label="1"
             >标签
             </el-radio>
-            <el-radio
-              :label="2"
-            >群聊
-            </el-radio>
+<!--            <el-radio-->
+<!--              :label="2"-->
+<!--            >群聊-->
+<!--            </el-radio>-->
           </el-radio-group>
-          <Tip :title="'标签:根据企微客户的标签筛选客户进入SOP\r\n群聊:选择企微用户所属的群聊,并且只能选择课程模板,课程模板里面第一条规则是发送到群聊,其他规则催课会发送到群里面的个人'" />
+          <Tip :title="'标签:根据企微客户的标签筛选客户进入SOP'" />
         </el-form-item>
         <el-form-item label="小转天数" prop="minConversionDay" v-if="form.filterMode == 1">
           <!--          <el-input class="el-input" type="" v-model="form.minConversionDay" placeholder="请输入" />-->

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

@@ -1468,7 +1468,8 @@ export default {
         name: row.name,
         tempId: row.tempId,
         filterMode: row.filterMode,
-        corpId: row.corpId
+        corpId: row.corpId,
+        type:1,
       }
       // 使用 params 传递参数
       this.$router.push({
@@ -1484,6 +1485,7 @@ export default {
       this.sopLogsDialog.title = '规则执行详情';
       this.sopLogsDialog.open = true;
       this.sopLogsDialog.sopLogsForm = row;
+      this.$set(this.sopLogsDialog.sopLogsForm, 'filterSopType', 3);
     },
 
     handleAvatarSuccessFile(res, file, item) {

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

@@ -1468,7 +1468,8 @@ export default {
         name: row.name,
         tempId: row.tempId,
         filterMode: row.filterMode,
-        corpId: row.corpId
+        corpId: row.corpId,
+        type:2,
       }
       // 使用 params 传递参数
       this.$router.push({
@@ -1484,6 +1485,7 @@ export default {
       this.sopLogsDialog.title = '规则执行详情';
       this.sopLogsDialog.open = true;
       this.sopLogsDialog.sopLogsForm = row;
+      this.$set(this.sopLogsDialog.sopLogsForm, 'filterSopType', 2);
     },
 
     handleAvatarSuccessFile(res, file, item) {

+ 56 - 5
src/views/qw/sop/sop.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">
@@ -264,7 +288,7 @@
             type="text"
             style="color: green;"
             @click="handleQueryDetails(scope.row)"
-            v-hasPermi="['qw:sop:list']"
+            v-hasPermi="['qw:sopTemp:info']"
           >查看模板
           </el-button>
         </template>
@@ -275,6 +299,7 @@
           <el-button
             size="mini"
             type="text"
+            v-hasPermi="['qw:sop:edit']"
             @click="handleUpdateOutTime(scope.row)"
           >修改规则
           </el-button>
@@ -313,6 +338,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">
@@ -853,7 +879,7 @@
 import {
   addSop,
   courseList,
-  delSop,
+  delSop, delSopLogs,
   exportSop,
   getSopVoiceList,
   listSop,
@@ -862,7 +888,7 @@ import {
   updateSopStatus,
   updateStatus,
   videoList
-} from "@/api/qw/sop";
+} from '@/api/qw/sop'
 import {sendMsgSop} from "@/api/qw/sopUserLogsInfo";
 import {listSopTemp} from "@/api/qw/sopTemp";
 import {getQwAllUserList, listUser} from '@/api/company/companyUser'
@@ -873,10 +899,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 +1098,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 => {
@@ -1471,7 +1508,8 @@ export default {
         name: row.name,
         tempId: row.tempId,
         filterMode: row.filterMode,
-        corpId: row.corpId
+        corpId: row.corpId,
+        type: 1,
       }
       // 使用 params 传递参数
       this.$router.push({
@@ -1488,6 +1526,8 @@ export default {
       this.sopLogsDialog.title = '规则执行详情';
       this.sopLogsDialog.open = true;
       this.sopLogsDialog.sopLogsForm = row;
+      // 使用Vue.set或this.$set添加新字段
+      this.$set(this.sopLogsDialog.sopLogsForm, 'filterSopType', 1);
     },
 
     handleAvatarSuccessFile(res, file, item) {
@@ -1637,6 +1677,17 @@ export default {
       }).catch(() => {
       });
     },
+    /** 删除按钮操作 */
+    handleSopLogsDelete() {
+      this.$confirm('是否确认删除企微sop编号为"' + this.ids + '"的所有发送任务(执行记录)数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => delSopLogs(this.ids)).then(() => {
+        this.msgSuccess("删除成功");
+      }).catch(() => {
+      });
+    },
     /**
      * 批量执行SOP任务
      */

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

@@ -495,7 +495,7 @@ export default {
       this.updateQwUserDialog.open = true
     },
     handleUpdateSopTemp(){
-      this.selectListSopTemp(this.form.type,1)
+      this.selectListSopTemp(this.form.sendType,1)
     },
     //刷新部分数据
     refreshData(row){
@@ -588,7 +588,6 @@ export default {
     //删除员工
     handleClosegroupUser(id){
       // const index = this.userSelectList.findIndex(t => t === list);
-      console.log(id)
       // if (index !== -1) {
       //   this.userSelectList.splice(index, 1);
       // }

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

@@ -176,6 +176,7 @@
                 <span v-if="item.contentType == 6">视频</span>
                 <span v-if="item.contentType == 7">语音</span>
                 <span v-if="item.contentType == 9">APP</span>
+                <span v-if="item.contentType == 10">自定义小程序</span>
                 <span v-if="item.contentType == 4"><el-button size="mini" type="primary" @click="generateShortLink(item)" style="margin-left: 330px;">生成短链</el-button></span>
               </div>
               <div v-if="item.sendStatus">
@@ -209,7 +210,7 @@
                 </div>
               </div>
             </div>
-            <div v-if="item.contentType == 4" class="message-style">
+            <div v-if="item.contentType == 4 || item.contentType == 10" class="message-style">
                 <div style="display: flex; justify-content: space-between; width: 100%">
                   <span style="font-size: 13px; flex: 1">{{ item.miniprogramTitle }}</span>
                   <el-image
@@ -436,6 +437,7 @@ export default {
       this.queryParams.sopId = val.id || this.rowDetailFrom.id;
       this.queryParams.corpId= val.corpId || this.rowDetailFrom.corpId;
       this.queryParams.type= val.type || this.rowDetailFrom.type;
+      this.queryParams.filterSopType=val.filterSopType || this.rowDetailFrom.filterSopType;
       this.loading = true;
 
       listQwSopLogsList(this.queryParams).then(response => {

+ 15 - 9
src/views/qw/sopTemp/addSopTemp.vue

@@ -178,7 +178,7 @@
                                             </el-card>
                                           </div>
 
-                                          <div v-if="setList.contentType == 4">
+                                          <div v-if="setList.contentType == 4 || setList.contentType == 10 ">
                                             <el-card class="box-card">
                                               <el-form-item label="标题" prop="miniprogramTitle">
                                                 <el-input v-model="setList.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字"  />
@@ -189,8 +189,8 @@
                                               <el-form-item label="appid" prop="miniprogramAppid" v-show="false" >
                                                 <el-input v-model="setList.miniprogramAppid='wx73f85f8d62769119' " disabled />
                                               </el-form-item>
-                                              <el-form-item label="page路径" prop="miniprogramPage" v-show="false" label-width="100px" style="margin-left: -30px">
-                                                <el-input v-model="setList.miniprogramPage" placeholder="小程序消息打开后的路径" disabled />
+                                              <el-form-item label="page路径" prop="miniprogramPage" v-show="setList.contentType == 10" label-width="100px" style="margin-left: -30px">
+                                                <el-input v-model="setList.miniprogramPage" placeholder="小程序消息打开后的路径"  type="textarea" :rows="3" />
                                               </el-form-item>
                                             </el-card>
                                           </div>
@@ -585,6 +585,7 @@ export default {
       setList.desc = val.desc;
       setList.url = val.url;
       setList.extras = val.extras;
+      setList.videoId = val.id;
 
       this.videoNumOptions.open=false;
     },
@@ -693,7 +694,7 @@ export default {
               this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
 
-          if (content.setting[i].contentType == 4){
+          if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10){
             this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
           }
 
@@ -720,7 +721,7 @@ export default {
               this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
-            if (this.setting[i].contentType == 4){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
 
@@ -739,7 +740,7 @@ export default {
             if (content.setting[i].contentType == 3){
               this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
             }
-            if (this.setting[i].contentType == 4){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(content.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
             }
           }
@@ -768,7 +769,7 @@ export default {
 
               this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
           }
-          if (content.setting[i].contentType == 4){
+          if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10 ){
               this.$set(content.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
           }
 
@@ -880,12 +881,17 @@ export default {
                     return this.$message.error("链接地址不能为空")
                   }
 
-                  if (this.setting[i].content[j].setting[k].contentType == 4 && (this.setting[i].content[j].setting[k].miniprogramTitle == null || this.setting[i].content[j].setting[k].miniprogramTitle == "")) {
+                  if ((this.setting[i].content[j].setting[k].contentType == 4 || this.setting[i].content[j].setting[k].contentType == 10 ) && (this.setting[i].content[j].setting[k].miniprogramTitle == null || this.setting[i].content[j].setting[k].miniprogramTitle == "")) {
                     return this.$message.error("小程序消息标题不能为空")
                   }
-                  if (this.setting[i].content[j].setting[k].contentType == 4 && (this.setting[i].content[j].setting[k].miniprogramPicUrl == null || this.setting[i].content[j].setting[k].miniprogramPicUrl == "")) {
+                  if ((this.setting[i].content[j].setting[k].contentType == 4 || this.setting[i].content[j].setting[k].contentType == 10 )  && (this.setting[i].content[j].setting[k].miniprogramPicUrl == null || this.setting[i].content[j].setting[k].miniprogramPicUrl == "")) {
                     return this.$message.error("小程序封面地址不能为空")
                   }
+
+                  if (this.setting[i].content[j].setting[k].contentType == 10 && (this.setting[i].content[j].setting[k].miniprogramPage == null || this.setting[i].content[j].setting[k].miniprogramPage == "")) {
+                    return this.$message.error("小程序page地址不能为空")
+                  }
+
                   if (this.setting[i].content[j].setting[k].contentType == 5 && (this.setting[i].content[j].setting[k].fileUrl == null || this.setting[i].content[j].setting[k].fileUrl == "")) {
                     return this.$message.error("文件不能为空")
                   }

+ 4 - 15
src/views/qw/sopTemp/index.vue

@@ -268,19 +268,9 @@
           </el-time-picker>
         </el-form-item>
         <el-form-item label="每天催课次数" prop="num" v-if="form.sendType == 11 && !form.id">
-          <el-input-number v-model="form.num" :min="1" label="每天催课次数" @change="sendNumChange"></el-input-number>
+          <el-input-number v-model="form.num" :min="0" label="每天催课次数" @change="sendNumChange"></el-input-number>
         </el-form-item>
-        <el-form-item label="催课时间" v-if="form.sendType == 11 && !form.id">
-<!--          <el-time-picker-->
-<!--            v-for="item in form.timeList"-->
-<!--            class="custom-input"-->
-<!--            v-model="item.value"-->
-<!--            value-format="HH:mm"-->
-<!--            format="HH:mm"-->
-<!--            :picker-options="{ selectableRange: startTimeRange }"-->
-<!--            placeholder="时间"-->
-<!--            style="width: 200px;height: 20px;margin-left: 10px;margin-top: 10px">-->
-<!--          </el-time-picker>-->
+        <el-form-item label="催课时间" v-if="form.sendType == 11 && !form.id && form.num > 0">
           <div v-for="(item, index) in form.timeList" :key="index" style="margin-bottom: 10px;">
             <el-time-picker
               class="custom-input"
@@ -718,14 +708,13 @@ export default {
 
           }
 
-
-
           let f = JSON.parse(JSON.stringify(this.form));
           if (f.timeList && f.timeList.length > 0) {
             f.timeDesc = f.timeList.map(item => item.desc);
             f.timeList = f.timeList.map(item => item.value);
           }
 
+          console.log("f-----------",f)
           const loading = this.$loading({
             lock: true,
             text: 'Loading',
@@ -779,7 +768,7 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const ids = row.id || this.ids;
-      this.$confirm('是否确认删除sop模板编号为"' + ids + '"的数据项?', "警告", {
+      this.$confirm('是否确认删除当前所选模板?', "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning"

+ 18 - 37
src/views/qw/sopTemp/updateSopTemp.vue

@@ -284,7 +284,8 @@
                                                 :key="item.dictValue"
                                                 :label="item.dictValue"
                                                 :disabled="(content.type!=2 && item.dictValue === '9') || (content.isOfficial==1 && ['5','6','7','8','9'].includes(item.dictValue))"
-                                                v-for="item in sysQwSopAiContentType" v-if="setIndex == 0 ? courseTypeList.includes(item.dictValue) : !courseTypeList.includes(item.dictValue)">{{ item.dictLabel }}
+                                                v-for="item in sysQwSopAiContentType"
+                                                v-if="setIndex == 0 ? courseTypeList.includes(item.dictValue) : !courseTypeList.includes(item.dictValue)">{{ item.dictLabel }}
                                               </el-radio>
                                             </el-radio-group>
                                           </div>
@@ -352,7 +353,7 @@
                                             </el-card>
                                           </div>
 
-                                          <div v-if="setList.contentType == 4">
+                                          <div v-if="setList.contentType == 4 || setList.contentType == 10">
                                             <el-card class="box-card">
                                               <el-form-item label="标题" prop="miniprogramTitle">
                                                 <el-input v-model="setList.miniprogramTitle"
@@ -373,11 +374,11 @@
                                                 <el-input v-model="setList.miniprogramAppid='wx73f85f8d62769119' " :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')"
                                                           disabled/>
                                               </el-form-item>
-                                              <el-form-item label="page路径" prop="miniprogramPage" v-show="false"
+                                              <el-form-item label="page路径" prop="miniprogramPage" v-show="setList.contentType == 10"
                                                             label-width="100px" style="margin-left: -30px">
                                                 <el-input v-model="setList.miniprogramPage"
                                                           :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')"
-                                                          placeholder="小程序消息打开后的路径" disabled/>
+                                                          placeholder="小程序消息打开后的路径" type="textarea" :rows="3" />
                                               </el-form-item>
                                             </el-card>
                                           </div>
@@ -474,31 +475,6 @@
 
                                             </el-card>
                                           </div>
-                                          <div v-if="setList.contentType == 10 ">
-                                            <el-card class="box-card">
-                                              <el-form-item label="链接标题:" label-width="100px" required>
-                                                <el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-model="setList.linkTitle"
-                                                          placeholder="请输入链接标题"
-                                                          style="width: 90%;"/>
-                                              </el-form-item>
-                                              <el-form-item label="链接描述:" label-width="100px" required>
-                                                <el-input :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" type="textarea" :rows="3"
-                                                          v-model="setList.linkDescribe"
-                                                          placeholder="请输入链接描述"
-                                                          style="width: 90%;margin-top: 1%;"/>
-                                              </el-form-item>
-                                              <el-form-item label="链接封面:" label-width="100px" required>
-                                                <ImageUpload :disabled="formType == 3 || !roles.includes('edit_sop_temp_content')" v-model="setList.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-tag type="warning"> 链接地址自动生成
-                                                </el-tag>
-                                              </el-form-item>
-                                            </el-card>
-                                          </div>
                                         </el-form-item>
                                         <el-form-item label="添加短链"
                                                       v-if="content.type == 2 && setList.contentType == 1  ">
@@ -738,7 +714,7 @@ export default {
       ruleList: [],
       ids: [],
       startTimeRange: [],
-      courseTypeList: ['3', '4', '9'],
+      courseTypeList: ['1','3', '4', '9','10'],
       sysFsSopWatchStatus: [],
       //消息内容类型 企微版
       sysQwSopContentType: [],
@@ -1140,15 +1116,20 @@ export default {
                 return false;
               }
 
-              if (data.content[j].setting[k].contentType == 4 && (data.content[j].setting[k].miniprogramTitle == null || data.content[j].setting[k].miniprogramTitle == "")) {
+              if ((data.content[j].setting[k].contentType == 4 || data.content[j].setting[k].contentType == 10) && (data.content[j].setting[k].miniprogramTitle == null || data.content[j].setting[k].miniprogramTitle == "")) {
                 this.$message.error("小程序消息标题不能为空")
                 return false;
               }
-              if (data.content[j].setting[k].contentType == 4 && data.content[j].isOfficial !== '1' && (data.content[j].setting[k].miniprogramPicUrl == null || data.content[j].setting[k].miniprogramPicUrl == "")) {
+              if ((data.content[j].setting[k].contentType == 4 || data.content[j].setting[k].contentType == 10) && data.content[j].isOfficial !== '1' && (data.content[j].setting[k].miniprogramPicUrl == null || data.content[j].setting[k].miniprogramPicUrl == "")) {
                 this.$message.error("小程序封面地址不能为空")
                 return false;
               }
 
+              if (data.content[j].setting[k].contentType == 10 && data.content[j].isOfficial !== '1' && (data.content[j].setting[k].miniprogramPage == null || data.content[j].setting[k].miniprogramPage == "")) {
+                this.$message.error("小程序page地址不能为空")
+                return false;
+              }
+
               if (data.content[j].setting[k].contentType == 5 && (data.content[j].setting[k].fileUrl == null || data.content[j].setting[k].fileUrl == "")) {
                 this.$message.error("文件不能为空")
                 return false;
@@ -1341,6 +1322,7 @@ export default {
       setList.desc = val.desc;
       setList.url = val.url;
       setList.extras = val.extras;
+      setList.videoId = val.id;
 
       this.videoNumOptions.open = false;
 
@@ -1373,7 +1355,7 @@ export default {
             this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
             this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
           }
-          if (content.setting[i].contentType == 4) {
+          if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10) {
             this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
           }
 
@@ -1485,8 +1467,7 @@ export default {
               this.$set(content.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(content.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
-            if (content.setting[i].contentType == 4 && (content.isOfficial == '0' || content.isOfficial == null)) {
-              console.log(content.isOfficial);
+            if ((content.setting[i].contentType == 4 || content.setting[i].contentType == 10) && (content.isOfficial == '0' || content.isOfficial == null)) {
               this.$set(content.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
 
@@ -1506,7 +1487,7 @@ export default {
             if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
               this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
             }
-            if (content.setting[i].contentType == 4) {
+            if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10 ) {
               this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(selectedVideo.dictLabel, 60));
             }
           }
@@ -1540,7 +1521,7 @@ export default {
           if (content.setting[i].contentType == 3 || content.setting[i].contentType == 9) {
             this.$set(content.setting[i], 'linkDescribe', selectedVideo.dictLabel);
           }
-          if (content.setting[i].contentType == 4) {
+          if (content.setting[i].contentType == 4 || content.setting[i].contentType == 10) {
             this.$set(content.setting[i], 'miniprogramTitle', this.truncateTextByByteLength(selectedVideo.dictLabel, 60));
           }
 

+ 1 - 0
src/views/qw/sopTemp/updateSopTemp2.vue

@@ -509,6 +509,7 @@ export default {
       setList.desc = val.desc;
       setList.url = val.url;
       setList.extras = val.extras;
+      setList.videoId = val.id;
 
       this.videoNumOptions.open=false;
     },

+ 148 - 102
src/views/qw/sopUserLogs/sopUserLogsSchedule.vue

@@ -2,8 +2,8 @@
   <div class="app-container">
     <div style="margin-bottom: 10px">
       <el-card>
-        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则名称:{{sopName}}</span>
-        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则编号:{{queryParams.sopId}}</span>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则名称:{{sopName}}</span>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">自动化规则编号:{{queryParams.sopId}}</span>
         <span class="custom-style" style="display: block;">模板编号:{{tempId}}</span>
       </el-card>
     </div>
@@ -18,12 +18,21 @@
           @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="startTime">
         <el-date-picker clearable size="small"
-          v-model="queryParams.startTime"
-          type="date"
-          value-format="yyyy-MM-dd"
-          placeholder="选择营期时间">
+                        v-model="queryParams.startTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择营期时间">
         </el-date-picker>
       </el-form-item>
       <el-form-item label="状态" prop="status">
@@ -45,6 +54,15 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="客户id" prop="externalId">
+        <el-input
+          v-model="queryParams.externalId"
+          placeholder="请输入企微客户id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -52,6 +70,7 @@
     </el-form>
 
     <el-row :gutter="10" class="mb8" v-if="filterMode == 1">
+
       <el-col :span="1.5">
         <el-tooltip class="item" effect="dark" content="此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top">
           <el-button
@@ -60,7 +79,7 @@
             size="medium"
             :disabled="multiple"
             @click="handleCampSendMsg"
-            v-hasPermi="['qw:sopUserLogsInfo:msg']"
+            v-hasPermi="['qw:sopUserLogsInfo:msgSchedule']"
           >营期一键群发(或草稿)</el-button>
         </el-tooltip>
       </el-col>
@@ -79,6 +98,7 @@
         </el-tooltip>
       </el-col>
     </el-row>
+
     <el-row :gutter="10" class="mb8" v-if="filterMode == 2">
       <el-col :span="1.5">
         <el-tooltip class="item" effect="dark" content="添加新群聊进入任务" placement="top">
@@ -102,15 +122,34 @@
           >批量修改营期时间</el-button>
         </el-tooltip>
       </el-col>
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的群发送消息,ps:删除之后不可恢复" placement="top">
+          <el-button
+            type="danger"
+            icon="el-icon-s-promotion"
+            size="medium"
+            :disabled="multiple"
+            @click="handleDeleteUserLogs"
+            v-hasPermi="['qw:sopUserLogs:remove']"
+          >批量删除营期</el-button>
+        </el-tooltip>
+      </el-col>
     </el-row>
-    <Tip v-if="filterMode == 1" :title="'【营期一键群发】:此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】'" />
-    <Tip v-if="filterMode == 1" :title="'【批量删除营期】:此功能用于删除选中的【整个营期】,删除之后将不会在给原营期的客户发送消息,ps:删除之后不可恢复'" />
-    <Tip v-if="filterMode == 1" :title="'【天数】:【列表:营期时间】对应列表中的天数是几 就代表着 插件助手 会发送【任务模板】里的第几天的消息'" />
-
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
+      <i class="el-icon-info"></i>
+      【营期一键群发】:此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】
+    </div>
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
+      <i class="el-icon-info"></i>
+      【批量删除营期】:此功能用于删除选中的【整个营期】,删除之后将不会在给原营期的客户发送消息,ps:删除之后不可恢复
+    </div>
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="filterMode == 1">
+      <i class="el-icon-info"></i>
+      【天数】:【列表:营期时间】对应列表中的天数是几 就代表着 插件助手 会发送【任务模板】里的第几天的消息
+    </div>
     <el-table border v-loading="loading" :data="sopUserLogsList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="营期编号" align="center" prop="id" />
-<!--      <el-table-column label="模板编号" align="center" prop="sopTempId" />-->
       <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
       <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
       <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2" />
@@ -132,7 +171,7 @@
         </template>
       </el-table-column>
 
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="filterMode == 1">
         <template slot-scope="scope">
           <el-button
             v-if="scope.row.status ==1"
@@ -150,12 +189,12 @@
             @click="handleRepairLogs(scope.row)"
             v-hasPermi="['qw:sop:list']"
           >修复营期</el-button>
-<!--          <el-button-->
-<!--            size="mini"-->
-<!--            type="text"-->
-<!--            icon="el-icon-edit"-->
-<!--            @click="handleTemp(scope.row)"-->
-<!--          >新建群发任务</el-button>-->
+          <!--          <el-button-->
+          <!--            size="mini"-->
+          <!--            type="text"-->
+          <!--            icon="el-icon-edit"-->
+          <!--            @click="handleTemp(scope.row)"-->
+          <!--          >新建群发任务</el-button>-->
         </template>
       </el-table-column>
 
@@ -171,7 +210,7 @@
 
 
     <!--  执行详情  -->
-    <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="70%" style="font-weight: bolder">
+    <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="88%" style="font-weight: bolder">
       <sop-user-logs-info-details ref="SopUserLogsInfoDetails" :rowDetailFrom="logsInfoDetailsOpen.item" @flashNotify="flashNotify"></sop-user-logs-info-details>
     </el-drawer>
 
@@ -247,17 +286,17 @@
 
 <script>
 import {
-  addGroupChat,
   delSopUserLogs,
   exportSopUserLogs,
   listSopUserLogs,
   repairSopUserLogs,
+  getSelectChat,
+  addGroupChat,
   updateLogDate
-} from '@/api/qw/sopUserLogs'
-import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
-import SopUserLogsInfoDetails from '@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue'
-import SendMsgOpenTool from '@/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue'
-import Tip from '../../../components/Tip/index.vue'
+} from "../../../api/qw/sopUserLogs";
+import sopLogsDetails from "@/views/qw/sopLogs/sopLogsList.vue";
+import SopUserLogsInfoDetails from "@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue";
+import sendMsgOpenTool from "../../../views/qw/sopUserLogsInfo/sendMsgOpenTool.vue";
 import {listAll as chatListAll} from "@/api/qw/groupChat";
 import companyUserList from "@/views/company/companyUser/companyUserList.vue";
 import qwUserList from "@/views/qw/user/qwUserList.vue";
@@ -265,7 +304,7 @@ import {getQwAllUserList, listUser} from "@/api/company/companyUser";
 
 export default {
   name: "sopUserLogsSchedule",
-  components: {qwUserList, companyUserList, Tip, SendMsgOpenTool, SopUserLogsInfoDetails, sopLogsDetails},
+  components: {qwUserList, companyUserList, SopUserLogsInfoDetails, sopLogsDetails,sendMsgOpenTool},
   props:{
     rowDetailFrom:{},
   },
@@ -273,33 +312,18 @@ export default {
   data() {
     return {
       qwUserIds: [],
-      companyUserLists:[],
-      chatNames: [],
-      userSelectList:[],
       sopUserLogId:null,
+      companyUserLists:[],
       sopName:'',
       tempId:'',
       // 遮罩层
       loading: true,
-      // 查询参数
-      addGroupData: {
-        open: false,
-        userOpen: false,
-        selectChat: [],
-        form: {
-          chatIds: [],
-        },
-      },
-      updateTimeData: {
-        open: false,
-        form: {
-          date: null,
-        },
-      },
       // 导出遮罩层
       exportLoading: false,
+      filterMode: 1,
       // 选中数组
       ids: [],
+      chatNames: [],
       statusOptions: [],
       // 非单个禁用
       single: true,
@@ -314,28 +338,49 @@ export default {
         open:false,
       },
       sysQwSopAiContentType:[],
+      userSelectList:[],
       // sopUserLogs表格数据
       sopUserLogsList: [],
       sopUserLogsDelStatus:[],
       // 弹出层标题
       title: "",
-      filterMode: 1,
       // 是否显示弹出层
       open: false,
       // 查询参数
+      addGroupData: {
+        open: false,
+        userOpen: false,
+        selectChat: [],
+        form: {
+          chatIds: [],
+        },
+      },
+      updateTimeData: {
+        open: false,
+        form: {
+          date: null,
+        },
+      },
       queryParams: {
         pageNum: 1,
         pageSize: 10,
         sopId: null,
         userLogsId:null,
         externalUserName:null,
+        externalId:null,
         sopTempId: null,
         qwUserId: null,
+        qwUserName: null,
         corpId: null,
         startTime: null,
         status: null,
+        userId: null,
         type:null,
-        userId: null
+      },
+      sendMsgOpen:{
+        title:'营期一键批量群发',
+        open:false,
+        ids:null,
       },
       setting:[],
       // 表单参数
@@ -363,8 +408,8 @@ export default {
       this.sysQwSopAiContentType = response.data;
     });
     this.queryParams.sopId = this.$route.params.id;
-    this.filterMode = this.$route.query.filterMode;
     this.sopName = this.$route.query.name;
+    this.filterMode = this.$route.query.filterMode;
     this.tempId = this.$route.query.tempId;
     this.queryParams.corpId= this.$route.query.corpId;
     this.queryParams.type= this.$route.query.type;
@@ -384,7 +429,35 @@ export default {
         this.loading = false;
       });
     },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    addSetList(){
+      const newSetting = {
+        contentType:'1',
+        value: '',
+      };
+      // 将新设置项添加到 content.setting 数组中
+      this.setting.push(newSetting);
 
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        sopId: null,
+        sopTempId: null,
+        qwUserId: null,
+        externalId:null,
+        corpId: null,
+        startTime: null,
+        status: 0,
+        userId: null
+      };
+      this.resetForm("form");
+    },
 
     /**
      * 营期一键群发
@@ -414,34 +487,6 @@ export default {
       }).catch(() => {});
     },
 
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    addSetList(){
-        const newSetting = {
-          contentType:'1',
-          value: '',
-        };
-        // 将新设置项添加到 content.setting 数组中
-        this.setting.push(newSetting);
-
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        sopId: null,
-        sopTempId: null,
-        qwUserId: null,
-        corpId: null,
-        startTime: null,
-        status: 0,
-        userId: null
-      };
-      this.resetForm("form");
-    },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
@@ -472,13 +517,13 @@ export default {
       this.logsInfoDetailsOpen.open=true;
       const externalUserName = this.queryParams.externalUserName;
       setTimeout(() => {
-        this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val,externalUserName);
+        this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val, externalUserName);
       }, 500);
 
     },
 
-    handleRepairLogs(val){
-      this.loading=true;
+    handleRepairLogs(val) {
+      this.loading = true;
       let loadingRock = this.$loading({
         lock: true,
         text: '正在修复中请稍后~~!!',
@@ -488,10 +533,10 @@ export default {
 
       repairSopUserLogs(val).then(res => {
         this.msgSuccess("修复成功成功");
-      }).catch(res=>{
-      }).finally(res=>{
+      }).catch(res => {
+      }).finally(res => {
         loadingRock.close();
-        this.loading=false;
+        this.loading = false;
         this.getList();
       })
 
@@ -500,26 +545,27 @@ export default {
     handleExport() {
       const queryParams = this.queryParams;
       this.$confirm('是否确认导出所有sopUserLogs数据项?', "警告", {
-          confirmButtonText: "确定",
-          cancelButtonText: "取消",
-          type: "warning"
-        }).then(() => {
-          this.exportLoading = true;
-          return exportSopUserLogs(queryParams);
-        }).then(response => {
-          this.download(response.msg);
-          this.exportLoading = false;
-        }).catch(() => {});
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportSopUserLogs(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {
+      });
     },
-    addGroup(){
+    addGroup() {
       this.addGroupData.open = true;
       this.addGroupData.form = {date: new Date(), chatIds: []};
     },
-    updateGroupTime(){
+    updateGroupTime() {
       this.updateTimeData.open = true;
       this.updateTimeData.form = {date: new Date()};
     },
-    submitUpdateTimeForm(){
+    submitUpdateTimeForm() {
       let form = {
         date: this.updateTimeData.form.date,
         ids: this.ids,
@@ -529,7 +575,7 @@ export default {
         this.getList();
       });
     },
-    submitAddGroupForm(){
+    submitAddGroupForm() {
       let form = {
         id: this.queryParams.sopId,
         qwUserIds: this.userSelectList.join(),
@@ -541,13 +587,13 @@ export default {
         this.getList();
       });
     },
-    handleCompanyUser(){
+    handleCompanyUser() {
       setTimeout(() => {
-        this.$refs.QwUserList.getDetails(this.queryParams.corpId,this.queryParams.type, 2);
+        this.$refs.QwUserList.getDetails(this.queryParams.corpId, this.queryParams.type, 2);
       }, 1);
       this.addGroupData.userOpen = true;
     },
-    handleClosegroupUser(list){
+    handleClosegroupUser(list) {
       const index = this.userSelectList.findIndex(t => t === list);
       if (index !== -1) {
         this.userSelectList.splice(index, 1);
@@ -555,13 +601,13 @@ export default {
         this.loadChatList()
       }
     },
-    loadChatList(){
+    loadChatList() {
       chatListAll(this.qwUserIds.join(), this.queryParams.corpId, this.queryParams.sopId).then(e => {
         this.addGroupData.selectChat = e.data;
       })
     },
-    selectUserList(list){
-      this.addGroupData.userOpen=false;
+    selectUserList(list) {
+      this.addGroupData.userOpen = false;
       list.forEach(obj => {
         if (!this.userSelectList.some(item => item == obj.id)) {
           console.info(this.userSelectList)

+ 583 - 0
src/views/qw/sopUserLogs/sopUserLogsScheduleOld.vue

@@ -0,0 +1,583 @@
+<template>
+  <div class="app-container">
+    <div style="margin-bottom: 10px">
+      <el-card>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则名称:{{sopName}}</span>
+        <span class="custom-style" style="display: block; margin-bottom: 10px">SOP规则编号:{{queryParams.sopId}}</span>
+        <span class="custom-style" style="display: block;">模板编号:{{tempId}}</span>
+      </el-card>
+    </div>
+
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <el-form-item label="企微员工账号" prop="qwUserId">
+        <el-input
+          v-model="queryParams.qwUserId"
+          placeholder="请输入企微员工账号"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="营期时间" prop="startTime">
+        <el-date-picker clearable size="small"
+          v-model="queryParams.startTime"
+          type="date"
+          value-format="yyyy-MM-dd"
+          placeholder="选择营期时间">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option
+            v-for="dict in sopUserLogsDelStatus"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="客户名称" prop="externalUserName">
+        <el-input
+          v-model="queryParams.externalUserName"
+          placeholder="请输入客户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8" v-if="filterMode == 1">
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】" placement="top">
+          <el-button
+            type="warning"
+            icon="el-icon-s-promotion"
+            size="medium"
+            :disabled="multiple"
+            @click="handleCampSendMsg"
+            v-hasPermi="['qw:sopUserLogsInfo:msg']"
+          >营期一键群发(或草稿)</el-button>
+        </el-tooltip>
+      </el-col>
+
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="删除营期之后,将不会在给原营期的客户发送消息,ps:删除之后不可恢复" placement="top">
+          <el-button
+            type="danger"
+            icon="el-icon-s-promotion"
+            size="medium"
+            :disabled="multiple"
+            @click="handleDeleteUserLogs"
+            v-hasPermi="['qw:sopUserLogs:remove']"
+          >批量删除营期</el-button>
+
+        </el-tooltip>
+      </el-col>
+    </el-row>
+    <el-row :gutter="10" class="mb8" v-if="filterMode == 2">
+      <el-col :span="1.5">
+        <el-tooltip class="item" effect="dark" content="添加新群聊进入任务" placement="top">
+          <el-button
+            type="warning"
+            icon="el-icon-plus"
+            size="medium"
+            @click="addGroup"
+          >追加群聊</el-button>
+        </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-row>
+    <Tip v-if="filterMode == 1" :title="'【营期一键群发】:此功能用于给 选中的 营期 内【所有的】客户发送 消息【或者发送草稿-/-清楚草稿】'" />
+    <Tip v-if="filterMode == 1" :title="'【批量删除营期】:此功能用于删除选中的【整个营期】,删除之后将不会在给原营期的客户发送消息,ps:删除之后不可恢复'" />
+    <Tip v-if="filterMode == 1" :title="'【天数】:【列表:营期时间】对应列表中的天数是几 就代表着 插件助手 会发送【任务模板】里的第几天的消息'" />
+
+    <el-table border v-loading="loading" :data="sopUserLogsList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="营期编号" align="center" prop="id" />
+<!--      <el-table-column label="模板编号" align="center" prop="sopTempId" />-->
+      <el-table-column label="企微员工账号" align="center" prop="qwUserId" />
+      <el-table-column label="企微员工名称" align="center" prop="qwUserName" />
+      <el-table-column label="群聊" align="center" prop="chatName" v-if="filterMode == 2" />
+      <el-table-column label="营期时间" align="center" prop="startTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="天数" align="center" prop="countDays" />
+      <el-table-column label="状态" align="center" prop="status" >
+        <template slot-scope="scope">
+          <div v-if="scope.row.userId && scope.row.userId.includes('null')">
+            <span style="color: orange;">营期异常</span>
+          </div>
+          <div v-else>
+            <dict-tag :options="sopUserLogsDelStatus" :value="scope.row.status"/>
+          </div>
+
+        </template>
+      </el-table-column>
+
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            v-if="scope.row.status ==1"
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleSelect(scope.row)"
+            v-hasPermi="['qw:sop:list']"
+          >营期详情</el-button>
+          <el-button
+            v-if="scope.row.userId && scope.row.userId.includes('null')"
+            size="mini"
+            type="text"
+            icon="el-icon-s-check"
+            @click="handleRepairLogs(scope.row)"
+            v-hasPermi="['qw:sop:list']"
+          >修复营期</el-button>
+<!--          <el-button-->
+<!--            size="mini"-->
+<!--            type="text"-->
+<!--            icon="el-icon-edit"-->
+<!--            @click="handleTemp(scope.row)"-->
+<!--          >新建群发任务</el-button>-->
+        </template>
+      </el-table-column>
+
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+
+    <!--  执行详情  -->
+    <el-drawer :title="logsInfoDetailsOpen.title" :visible.sync="logsInfoDetailsOpen.open" size="70%" style="font-weight: bolder">
+      <sop-user-logs-info-details ref="SopUserLogsInfoDetails" :rowDetailFrom="logsInfoDetailsOpen.item" @flashNotify="flashNotify"></sop-user-logs-info-details>
+    </el-drawer>
+
+    <send-msg-open-tool ref="sendMsgOpenTool" ></send-msg-open-tool>
+    <el-dialog title="修改营期时间" :visible.sync="updateTimeData.open"  width="800px" append-to-body>
+      <p>
+        <span>选择群聊:</span>
+        <el-tag v-for="name in chatNames">{{name}}</el-tag>
+      </p>
+      <el-form ref="msgForm" :model="updateTimeData.form" label-width="100px">
+        <el-form-item label="日期">
+          <el-date-picker
+            v-model="updateTimeData.form.date"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitUpdateTimeForm">确 定</el-button>
+        <el-button @click="updateTimeData.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-dialog title="选择企微" :visible.sync="addGroupData.userOpen" width="1300px"   append-to-body>
+      <qwUserList ref="QwUserList" @selectUserList="selectUserList"></qwUserList>
+    </el-dialog>
+
+    <el-dialog title="追加群聊" :visible.sync="addGroupData.open"  width="800px" append-to-body>
+      <el-form ref="msgForm" :model="addGroupData.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="handleCompanyUser">请选择使用员工</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 companyUserLists " :key="list.userId" v-if="list.id == id">{{list.qwUserName}}</span>
+            </el-tag>
+          </div>
+        </el-form-item>
+        <el-form-item label="群聊">
+          <el-select multiple filterable clearable v-model="addGroupData.form.chatIds">
+            <el-option v-for="item in addGroupData.selectChat" :key="item.chatId" :label="item.name" :value="item.chatId"/>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="日期">
+          <el-date-picker
+            v-model="addGroupData.form.date"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择日期">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitAddGroupForm">确 定</el-button>
+        <el-button @click="addGroupData.open = false">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  addGroupChat,
+  delSopUserLogs,
+  exportSopUserLogs,
+  listSopUserLogs,
+  repairSopUserLogs,
+  updateLogDate
+} from '@/api/qw/sopUserLogs'
+import sopLogsDetails from '@/views/qw/sopLogs/sopLogsList.vue'
+import SopUserLogsInfoDetails from '@/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue'
+import SendMsgOpenTool from '@/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue'
+import Tip from '../../../components/Tip/index.vue'
+import {listAll as chatListAll} from "@/api/qw/groupChat";
+import companyUserList from "@/views/company/companyUser/companyUserList.vue";
+import qwUserList from "@/views/qw/user/qwUserList.vue";
+import {getQwAllUserList, listUser} from "@/api/company/companyUser";
+
+export default {
+  name: "sopUserLogsSchedule",
+  components: {qwUserList, companyUserList, Tip, SendMsgOpenTool, SopUserLogsInfoDetails, sopLogsDetails},
+  props:{
+    rowDetailFrom:{},
+  },
+
+  data() {
+    return {
+      qwUserIds: [],
+      companyUserLists:[],
+      chatNames: [],
+      userSelectList:[],
+      sopUserLogId:null,
+      sopName:'',
+      tempId:'',
+      // 遮罩层
+      loading: true,
+      // 查询参数
+      addGroupData: {
+        open: false,
+        userOpen: false,
+        selectChat: [],
+        form: {
+          chatIds: [],
+        },
+      },
+      updateTimeData: {
+        open: false,
+        form: {
+          date: null,
+        },
+      },
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      statusOptions: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      logsInfoDetailsOpen:{
+        title:"",
+        open:false,
+      },
+      sysQwSopAiContentType:[],
+      // sopUserLogs表格数据
+      sopUserLogsList: [],
+      sopUserLogsDelStatus:[],
+      // 弹出层标题
+      title: "",
+      filterMode: 1,
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        sopId: null,
+        userLogsId:null,
+        externalUserName:null,
+        sopTempId: null,
+        qwUserId: null,
+        corpId: null,
+        startTime: null,
+        status: null,
+        type:null,
+        userId: null
+      },
+      setting:[],
+      // 表单参数
+      form: {},
+      tempForm: {
+        setting:null,
+        videoIdSet:null,
+        courseIdSet:null,
+      },
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });
+
+    this.getDicts("sop_user_logs_del_status").then(response => {
+      this.sopUserLogsDelStatus = response.data;
+    });
+    this.getDicts("sys_qwSopAi_contentType").then(response => {
+      this.sysQwSopAiContentType = response.data;
+    });
+    this.queryParams.sopId = this.$route.params.id;
+    this.filterMode = this.$route.query.filterMode;
+    this.sopName = this.$route.query.name;
+    this.tempId = this.$route.query.tempId;
+    this.queryParams.corpId= this.$route.query.corpId;
+    this.queryParams.type= this.$route.query.type;
+    getQwAllUserList(this.queryParams.corpId).then(response => {
+      this.companyUserLists = response.data;
+    });
+    this.getList()
+
+  },
+  methods: {
+    /** 查询sopUserLogs列表 */
+    getList() {
+      this.loading = true;
+      listSopUserLogs(this.queryParams).then(response => {
+        this.sopUserLogsList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+
+    /**
+     * 营期一键群发
+     */
+    handleCampSendMsg(){
+
+      setTimeout(() => {
+        this.$refs.sendMsgOpenTool.oneClickGroupSending(this.ids,2,this.queryParams.corpId);
+      }, 500);
+
+    },
+
+    /**
+     *  删除营期
+     */
+    handleDeleteUserLogs(){
+      const ids =  this.ids;
+      this.$confirm('是否确认删除编号为"' + ids + '"的数据项【注意!!删除后不可恢复,请谨慎操作】?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delSopUserLogs(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    addSetList(){
+        const newSetting = {
+          contentType:'1',
+          value: '',
+        };
+        // 将新设置项添加到 content.setting 数组中
+        this.setting.push(newSetting);
+
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        sopId: null,
+        sopTempId: null,
+        qwUserId: null,
+        corpId: null,
+        startTime: null,
+        status: 0,
+        userId: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+
+    flashNotify(){
+      this.getList();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      if(this.filterMode == 2){
+        this.chatNames = selection.map(item => item.chatName);
+      }
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+    handleSelect(val){
+      val.filterMode = this.filterMode;
+      this.logsInfoDetailsOpen.title='企微账号:'+val.qwUserId+'  '+'营期时间:'+val.startTime+'  '+'天数:' + val.countDays;
+      this.logsInfoDetailsOpen.open=true;
+      const externalUserName = this.queryParams.externalUserName;
+      setTimeout(() => {
+        this.$refs.SopUserLogsInfoDetails.selectSopUserLogsInfo(val,externalUserName);
+      }, 500);
+
+    },
+
+    handleRepairLogs(val){
+      this.loading=true;
+      let loadingRock = this.$loading({
+        lock: true,
+        text: '正在修复中请稍后~~!!',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+
+      repairSopUserLogs(val).then(res => {
+        this.msgSuccess("修复成功成功");
+      }).catch(res=>{
+      }).finally(res=>{
+        loadingRock.close();
+        this.loading=false;
+        this.getList();
+      })
+
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有sopUserLogs数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportSopUserLogs(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    },
+    addGroup(){
+      this.addGroupData.open = true;
+      this.addGroupData.form = {date: new Date(), chatIds: []};
+    },
+    updateGroupTime(){
+      this.updateTimeData.open = true;
+      this.updateTimeData.form = {date: new Date()};
+    },
+    submitUpdateTimeForm(){
+      let form = {
+        date: this.updateTimeData.form.date,
+        ids: this.ids,
+      }
+      updateLogDate(form).then(e => {
+        this.updateTimeData.open = false;
+        this.getList();
+      });
+    },
+    submitAddGroupForm(){
+      let form = {
+        id: this.queryParams.sopId,
+        qwUserIds: this.userSelectList.join(),
+        chatIds: this.addGroupData.form.chatIds.join(),
+        date: this.addGroupData.form.date,
+      }
+      addGroupChat(form).then(e => {
+        this.addGroupData.open = false;
+        this.getList();
+      });
+    },
+    handleCompanyUser(){
+      setTimeout(() => {
+        this.$refs.QwUserList.getDetails(this.queryParams.corpId,this.queryParams.type, 2);
+      }, 1);
+      this.addGroupData.userOpen = true;
+    },
+    handleClosegroupUser(list){
+      const index = this.userSelectList.findIndex(t => t === list);
+      if (index !== -1) {
+        this.userSelectList.splice(index, 1);
+        this.qwUserIds.splice(index, 1);
+        this.loadChatList()
+      }
+    },
+    loadChatList(){
+      chatListAll(this.qwUserIds.join(), this.queryParams.corpId, this.queryParams.sopId).then(e => {
+        this.addGroupData.selectChat = e.data;
+      })
+    },
+    selectUserList(list){
+      this.addGroupData.userOpen=false;
+      list.forEach(obj => {
+        if (!this.userSelectList.some(item => item == obj.id)) {
+          console.info(this.userSelectList)
+          this.userSelectList.push(obj.id);
+          this.qwUserIds.push(obj.qwUserId);
+        }
+      });
+      this.loadChatList()
+
+    },
+  }
+};
+</script>
+
+<style>
+.custom-style {
+  font-weight: bold; /* 加粗 */
+}
+</style>

+ 14 - 9
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -104,7 +104,7 @@
                           </el-form-item>
                         </el-card>
                       </div>
-                      <div v-if="item.contentType == 4">
+                      <div v-if="item.contentType == 4 || item.contentType == 10 ">
                         <el-card class="box-card">
                           <el-form-item label="标题" prop="miniprogramTitle">
                             <el-input v-model="item.miniprogramTitle" placeholder="请输入小程序消息标题,最长为64字"  />
@@ -115,8 +115,8 @@
                           <el-form-item label="appid" prop="miniprogramAppid" v-show="false" >
                             <el-input v-model="item.miniprogramAppid='wx73f85f8d62769119' " 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 label="page路径" prop="miniprogramPage" v-show="item.contentType == 10" label-width="100px" style="margin-left: -30px" >
+                            <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" type="textarea" :rows="3" />
                           </el-form-item>
                         </el-card>
                       </div>
@@ -360,7 +360,7 @@ export default {
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
 
-            if ( this.setting[i].contentType == 4 ){
+            if ( this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
           }
@@ -385,7 +385,7 @@ export default {
               this.$set(this.setting[i], 'linkDescribe', selectedVideo.dictLabel);
             }
 
-            if (this.setting[i].contentType == 4){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
             }
 
@@ -600,7 +600,7 @@ export default {
               this.$set(this.setting[i], 'linkTitle', selectedCourse.dictLabel);
               this.$set(this.setting[i], 'linkImageUrl', selectedCourse.dictImgUrl);
             }
-            if (this.setting[i].contentType == 4){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ){
               this.$set(this.setting[i], 'miniprogramPicUrl', selectedCourse.dictImgUrl);
             }
 
@@ -621,7 +621,7 @@ export default {
             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){
+            if (this.setting[i].contentType == 4 || this.setting[i].contentType == 10){
               this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
             }
 
@@ -694,12 +694,17 @@ export default {
                 return this.$message.error("链接地址不能为空")
               }
 
-              if (this.setting[i].contentType == 4 && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
                 return this.$message.error("小程序消息标题不能为空")
               }
-              if (this.setting[i].contentType == 4 && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
                 return this.$message.error("小程序封面地址不能为空")
               }
+
+              if (this.setting[i].contentType == 10 && (this.setting[i].miniprogramPage == null || this.setting[i].miniprogramPage == "")) {
+                return this.$message.error("小程序page地址不能为空")
+              }
+
               if (this.setting[i].contentType == 5 && (this.setting[i].fileUrl == null || this.setting[i].fileUrl == "")) {
                 return this.$message.error("文件不能为空")
               }

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

@@ -0,0 +1,751 @@
+<template>
+  <div class="app-container">
+    <el-dialog :title="sendMsgOpen.title" :visible.sync="sendMsgOpen.open"  width="1000px" append-to-body>
+      <el-alert
+        type="error"
+        :closable="false"
+        show-icon>
+        <template #title>
+                <span style="font-size: 25px; line-height: 1.5;">
+                    此功能用于给 选中的 SOP营期 内【所有的】客户发送 消息
+                </span>
+        </template>
+      </el-alert>
+        <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
+          <el-form-item label="策略" prop="draftStrategy">
+            <el-radio-group v-model="msgForm.draftStrategy">
+              <el-radio :label="1">正常群发</el-radio>
+              <el-radio :label="2">清除草稿</el-radio>
+              <el-radio :label="3">发送草稿</el-radio>
+            </el-radio-group>
+          </el-form-item>
+
+          <el-form-item label="选择课程" v-if="msgForm.draftStrategy==1" >
+            <el-select  v-model="msgForm.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini"  @change="courseChange()">
+              <el-option
+                v-for="dict in courseList"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="parseInt(dict.dictValue)"
+              />
+            </el-select>
+            <el-select  v-model="msgForm.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" @change="videoIdChange()"  >
+              <el-option
+                v-for="dict in videoList"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="parseInt(dict.dictValue)"
+              />
+            </el-select>
+            <el-select  v-model="msgForm.courseType" placeholder="请选择消息类型" size="mini" style=" margin-right: 10px;">
+              <el-option
+                v-for="dict in sysFsSopWatchStatus"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="parseInt(dict.dictValue)"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="规则" prop="setting" v-if="msgForm.draftStrategy==1"  >
+            <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"  @change="handleContentTypeChange()">{{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;"
+                        @keydown.native="handleKeydown($event, index)"
+                        :ref="`textarea-${index}`"
+                      >
+                      </el-input>
+                      <el-link
+                        v-if="item.contentType == 1"
+                        type="primary"
+                        @click="toggleSalesCall(index)"
+                        style="margin-top: 10px;"
+                      >
+                        {{ item.isSalesCallAdded ? '移除#销售称呼#' : '添加#销售称呼#' }}
+                      </el-link>
+                      <el-link
+                        v-if="item.contentType == 1"
+                        type="primary"
+                        @click="toggleSalesCallCustomer(index)"
+                        style="margin-top: 10px;margin-left: 2%"
+                      >
+                        {{ item.isSalesCallCustomerAdded ? '移除#客户称呼#' : '添加#客户称呼#' }}
+                      </el-link>
+
+
+                      <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1"  :width="150" :height="150" />
+
+                      <div v-if="item.contentType == 3 || item.contentType ==9 ">
+                        <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-tag type="warning" v-model="item.isBindUrl=1">选择的课程小节 即为卡片链接地址</el-tag>
+                          </el-form-item>
+                        </el-card>
+                      </div>
+                      <div v-if="item.contentType == 4 || item.contentType == 10 ">
+                        <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='wx73f85f8d62769119' " disabled />
+                          </el-form-item>
+                          <el-form-item label="page路径" prop="miniprogramPage" v-show="item.contentType == 10" label-width="100px" style="margin-left: -30px" >
+                            <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" type="textarea" :rows="3" />
+                          </el-form-item>
+                        </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">
+
+                      </div>
+
+                    </el-form-item>
+
+                    <el-form-item label="添加短链" v-if="item.contentType == 1 "  >
+                      <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark" :disabled="!!msgForm.videoId">
+                        <el-switch
+                          v-model="item.isBindUrl"
+                          :disabled="!msgForm.videoId"
+                          active-color="#13ce66"
+                          inactive-color="#DCDFE6"
+                          active-value="1"
+                          inactive-value="2">
+                        </el-switch>
+                      </el-tooltip>
+
+                      <span v-if="item.isBindUrl == '1'" style="margin-left: 10px; color: #13ce66">添加URL</span>
+                      <span v-if="item.isBindUrl == '2'" style="margin-left: 10px; color: #b1b4ba">不加URL</span>
+                    </el-form-item>
+                    <el-form-item label="课节过期时间" v-if="item.isBindUrl == '1'
+                                                          && item.contentType != 2
+                                                          && item.contentType != 5
+                                                          && item.contentType != 6
+                                                          && item.contentType != 8"
+                                  style="margin-top: 1%" label-width="100px">
+                      <el-row>
+                        <el-input-number  v-model="item.expiresDays"  :min="1" :max="100" ></el-input-number>
+                        (天)
+                      </el-row>
+                      <el-row>
+                        <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
+                      </el-row>
+                    </el-form-item>
+                  </el-form>
+                </el-col>
+                <el-col :span="1" :offset="1">
+                  <i class="el-icon-delete" @click="delSetList(index)" 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()'  >添加内容</el-link>
+
+          </el-form-item>
+          <el-form-item label="发送时间" prop="sendTime" v-if="msgForm.draftStrategy==1" >
+            <el-time-picker
+              class="custom-input"
+              v-model="msgForm.sendTime"
+              value-format="HH:mm"
+              format="HH:mm"
+              placeholder="时间"
+              style="width: 100px;height: 20px;">
+            </el-time-picker>
+            <span class="tip" style="margin-left: 2%"> 不填时,默认为系统当前时间(立即发送)</span>
+          </el-form-item>
+
+        </el-form>
+        <div slot="footer" class="dialog-footer">
+          <el-button type="primary" @click="submitMsgForm">确 定</el-button>
+          <el-button @click="cancelMsgForm">取 消</el-button>
+        </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { sendMsg,} from "../../../api/qw/sopUserLogsInfo";
+import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
+import {courseList, videoList} from "@/api/qw/sop";
+
+
+export default {
+  name: "sendMsgSopOpenTool",
+  components: {ImageUpload},
+  data() {
+    return {
+      //上传语音的遮罩层
+      voiceLoading :false,
+      uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS",
+      uploadUrlByVoice:process.env.VUE_APP_BASE_API+"/common/uploadOSSByHOOKVoice",
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // sopUserLogsInfo表格数据
+      sopUserLogsInfoList: [],
+      sysFsSopWatchStatus: [],
+      isSalesCallAdded:false,
+      isSalesCallCustomerAdded:false,
+      tagList:[],
+      selectTags:[],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      updateOpen:false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        tagIds:null,
+        remark:null,
+        sopId: null,
+        userLogsId: null,
+        userIdParam:null,
+        startTimeParam:null,
+        externalContactId: null,
+        qwUserId: null,
+        corpId: null,
+        externalId: null,
+        fsUserId: null,
+        externalUserName: null,
+        createTime: null,
+      },
+
+      courseList:[],
+      videoList:[],
+      //插件版
+      sysQwSopAiContentType:[],
+
+      sendMsgOpen:{
+        title:'一键批量群发',
+        open:false,
+        ids:null,
+      },
+      // 表单参数
+      form: {},
+      setting:[{contentType:'1', value: '',}],
+      msgForm:{
+        videoId:null,
+        courseId:null,
+        courseType:null,
+        userIdParam:null,
+        setting:null,
+        ids:null,
+        type:null,
+        corpId:null,
+        sopId: null,
+        sopIds: null,
+        startTime: null,
+        sendTime: null,
+        draftStrategy:1,
+      },
+      // 表单校验
+      rules: {},
+      batchRules:{
+        paramTime: [
+          { required: true, message: '选择的时间不能为空', trigger: 'blur' }
+        ],
+      },
+      msgRules:{},
+    };
+  },
+
+  created() {
+    this.getDicts("sys_qwSopAi_contentType").then(response => {
+      this.sysQwSopAiContentType = response.data;
+    });
+    this.getDicts("sys_fs_sop_watch_status").then(response => {
+      this.sysFsSopWatchStatus = response.data;
+    });
+
+    courseList().then(response => {
+      this.courseList = response.list;
+    });
+  },
+  methods: {
+
+    oneClickGroupSending(val,type,corpId){
+
+      this.sendMsgOpen.open= true;
+      this.msgForm.sopIds = val;
+      this.msgForm.type = type;
+      this.msgForm.corpId = corpId;
+
+    },
+    courseChange() {
+      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++) {
+          //响应式直接给链接的标题/封面上值
+          if (selectedCourse && this.msgForm.courseId != null) {
+            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);
+            }
+          }
+
+        }
+
+      }
+      videoList(this.msgForm.courseId).then(response => {
+        this.videoList=response.list;
+      });
+    },
+
+    videoIdChange() {
+      if (this.msgForm.videoId != null ) {
+        // 查找选中的课节对应的 label
+        const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
+
+        for (let i = 0; i < this.setting.length; i++) {
+          //响应式直接给链接的描述上值
+          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.setting[i].contentType == 10 ){
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
+
+          }
+        }
+      }
+    },
+    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;
+    },
+
+    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;
+    },
+
+    handleInputVideoText(value,content){
+      // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
+      const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
+
+      // 删除不符合条件的字符
+      const filteredValue = value.split('').filter(char => regex.test(char)).join('');
+
+      this.$set(content, 'value', filteredValue);
+
+    },
+
+    delSetList(index){
+      this.setting.splice(index,1)
+    },
+    addSetList(){
+      const newSetting = {
+        contentType:'1',
+        value: '',
+      };
+      // 将新设置项添加到 content.setting 数组中
+      this.setting.push(newSetting);
+
+    },
+
+
+    handleKeydown(event, index) {
+      const item = this.setting[index];
+      const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
+      const cursorPosition = textarea.selectionStart;
+
+      // 检查是否按下了 Backspace 或 Delete 键
+      if (event.key === 'Backspace' || event.key === 'Delete') {
+        const tags = ['#销售称呼#', '#客户称呼#']; // 需要检查的标签
+        const value = item.value;
+
+        // 遍历标签,检查是否需要删除
+        for (const tag of tags) {
+          let start, end;
+
+          if (event.key === 'Backspace') {
+            // 检查光标前是否是当前标签的一部分
+            start = cursorPosition - tag.length;
+            if (start >= 0 && value.slice(start, cursorPosition) === tag) {
+              // 删除整个标签
+              item.value = value.slice(0, start) + value.slice(cursorPosition);
+              // 更新光标位置
+              this.$nextTick(() => {
+                textarea.setSelectionRange(start, start);
+              });
+              // 更新状态
+              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
+              event.preventDefault(); // 阻止默认删除行为
+              break; // 找到匹配的标签后退出循环
+            }
+          } else if (event.key === 'Delete') {
+            // 检查光标后是否是当前标签的一部分
+            end = cursorPosition + tag.length;
+            if (end <= value.length && value.slice(cursorPosition, end) === tag) {
+              // 删除整个标签
+              item.value = value.slice(0, cursorPosition) + value.slice(end);
+              // 更新状态
+              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
+              event.preventDefault(); // 阻止默认删除行为
+              break; // 找到匹配的标签后退出循环
+            }
+          }
+
+          // 检查光标是否位于标签的中间
+          for (let i = 0; i <= tag.length; i++) {
+            const tagStart = cursorPosition - i;
+            const tagEnd = tagStart + tag.length;
+            if (
+              tagStart >= 0 &&
+              tagEnd <= value.length &&
+              value.slice(tagStart, tagEnd) === tag
+            ) {
+              // 删除整个标签
+              item.value = value.slice(0, tagStart) + value.slice(tagEnd);
+              // 更新光标位置
+              this.$nextTick(() => {
+                textarea.setSelectionRange(tagStart, tagStart);
+              });
+              // 更新状态
+              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
+              event.preventDefault(); // 阻止默认删除行为
+              break; // 找到匹配的标签后退出循环
+            }
+          }
+        }
+      }
+    },
+
+    // 切换添加销售称呼按钮点击事件
+    toggleSalesCall(index) {
+      const item = this.setting[index];
+      const salesCall = '#销售称呼#';
+      const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
+
+      // 获取当前光标位置
+      const cursorPosition = textarea.selectionStart;
+
+      if (item.isSalesCallAdded) {
+        // 移除所有的 #销售称呼#
+        item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
+      } else {
+        // 添加 #销售称呼#
+        item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
+      }
+
+      // 切换状态
+      item.isSalesCallAdded = !item.isSalesCallAdded;
+
+      // 保持光标位置
+      this.$nextTick(() => {
+        textarea.setSelectionRange(cursorPosition, cursorPosition);
+      });
+    },
+    toggleSalesCallCustomer(index) {
+      const item = this.setting[index];
+      const salesCall = '#客户称呼#';
+      const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
+
+      // 获取当前光标位置
+      const cursorPosition = textarea.selectionStart;
+
+      if (item.isSalesCallCustomerAdded) {
+        // 移除所有的 #销售称呼#
+        item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
+      } else {
+        // 添加 #客户称呼#
+        item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
+      }
+
+      // 切换状态
+      item.isSalesCallCustomerAdded = !item.isSalesCallCustomerAdded;
+
+      // 保持光标位置
+      this.$nextTick(() => {
+        textarea.setSelectionRange(cursorPosition, cursorPosition);
+      });
+    },
+
+    handleContentTypeChange() {
+
+      //如果是链接的才上
+      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++) {
+          //响应式直接给链接的标题/封面上值
+          if (selectedCourse  && this.msgForm.courseId != null) {
+
+            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);
+            }
+
+
+          }
+
+        }
+
+      }
+      if (this.msgForm.videoId != null ) {
+        // 查找选中的课节对应的 label
+        const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
+
+        for (let i = 0; i < this.setting.length; i++) {
+          //响应式直接给链接的描述上值
+          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.setting[i].contentType == 10){
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
+          }
+        }
+      }
+
+
+    },
+
+    resetSendMsgSop() {
+      this.msgForm = {
+        videoId:null,
+        courseId:null,
+        courseType:null,
+        setting:null,
+        sendTime:null,
+        draftStrategy:1,
+      };
+      this.resetForm("msgForm");
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+
+    submitMsgForm(){
+
+      this.$refs["msgForm"].validate(valid => {
+        if (valid) {
+
+          if (this.msgForm.draftStrategy==1){
+
+            this.msgForm.setting=JSON.stringify(this.setting)
+
+            if (this.setting.length <= 0) {
+              return this.$message.error("请添加规则")
+            }
+            if (this.msgForm.courseId===null || this.msgForm.courseId===''){
+              return this.$message.error("课程不能为空")
+            }
+
+            if (this.msgForm.videoId===null || this.msgForm.videoId===''){
+              return this.$message.error("课节不能为空")
+            }
+
+            if (this.msgForm.courseType===null || this.msgForm.courseType===''){
+              return this.$message.error("消息类型不能为空")
+            }
+
+            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].contentType == 9  ) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
+                return this.$message.error("链接标题不能为空")
+              }
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
+                return this.$message.error("链接描述不能为空")
+              }
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
+                return this.$message.error("链接图片不能为空")
+              }
+              if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 )&& this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
+                return this.$message.error("链接地址不能为空")
+              }
+
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
+                return this.$message.error("小程序消息标题不能为空")
+              }
+              if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10) && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
+                return this.$message.error("小程序封面地址不能为空")
+              }
+
+              if (this.setting[i].contentType == 10 && (this.setting[i].miniprogramPage == null || this.setting[i].miniprogramPage == "")) {
+                return this.$message.error("小程序page地址不能为空")
+              }
+
+              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("语音不能为空")
+              }
+            }
+          }
+
+
+
+          this.sendMsgOpen.open = false;
+
+          const loading = this.$loading({
+            lock: true,
+            text: '正在执行中请稍后~~请不要刷新页面!!',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+          sendMsg(this.msgForm).then(response => {
+            this.msgSuccess("一键群发成功");
+            loading.close();
+            this.setting=[];
+            this.resetSendMsgSop();
+          }).finally(()=>{
+            loading.close();
+          });
+
+        }
+      });
+    },
+    cancelMsgForm(){
+      this.sendMsgOpen.open = false;
+      this.resetSendMsgSop();
+    },
+
+  }
+};
+</script>

+ 139 - 62
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -7,7 +7,7 @@
       show-icon>
       <template #title>
               <span style="font-size: 20px; line-height: 1.5;">
-                    搜索【客户备注】【标签】【进线时间】 只能搜索/筛选出 【当前页】的数据)【可以用客户id来搜(客户id来源-》企微/我的企微客户-》列表的企微客户ID)】
+                    搜索【客户备注】【标签】【进线时间】【客户等级】 只能搜索/筛选出 【当前页】的数据)【可以用客户id来搜(客户id来源-》企微/我的企微客户-》列表的企微客户ID)】
               </span>
       </template>
     </el-alert>
@@ -39,6 +39,7 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+
       <el-form-item label="客户id" prop="externalId">
         <el-input
           v-model="queryParams.externalId"
@@ -48,28 +49,34 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-<!--      <el-form-item label="进线时间" prop="entryTime" v-if="queryParams.filterMode == 1">-->
-<!--        <el-date-picker clearable size="small"-->
-<!--                        v-model="queryParams.entryTime"-->
-<!--                        type="date"-->
-<!--                        value-format="yyyy-MM-dd"-->
-<!--                        placeholder="选择营期时间">-->
-<!--        </el-date-picker>-->
-<!--      </el-form-item>-->
-
+      <el-form-item label="客户等级" prop="level">
+        <el-select v-model="queryParams.level" placeholder="客户等级" clearable size="small">
+          <el-option
+            v-for="dict in ratingType"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="进线时间" prop="entryTime" v-if="queryParams.filterMode == 1">
-        <el-date-picker
-          v-model="scheduleEntryTime"
-          type="datetimerange"
-          size="small"
-          style="width: 350px"
-          value-format="yyyy-MM-dd HH:mm:ss"
-          range-separator="-"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          @change="handleScheduleTimeChange">
+        <el-date-picker clearable size="small"
+                        v-model="queryParams.entryTime"
+                        type="date"
+                        value-format="yyyy-MM-dd"
+                        placeholder="选择营期时间">
         </el-date-picker>
       </el-form-item>
+      <el-form-item label="官方群发需求" prop="fsUserIdStatus">
+        <el-select style="width: 200px" v-model="queryParams.fsUserIdStatus" placeholder="请选择" clearable size="small" >
+          <el-option
+            v-for="item in statusOptions"
+            :key="item.dictValue"
+            :label="item.dictLabel"
+            :value="item.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="标签" prop="tagIds">
         <!--        <el-select v-model="selectTags" remote multiple placeholder="请选择" filterable  style="width: 100%;">-->
         <!--          <el-option-->
@@ -157,16 +164,6 @@
           </div>
         </template>
       </el-table-column>
-      <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>
-      <el-table-column label="添加日期" align="center" prop="createTime" width="180"/>
-      <el-table-column label="添加时间" align="center" prop="crtTime" width="180"/>
-      <el-table-column label="修改时间" align="center" prop="updateTime" width="180"/>
-      <!--      <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">-->
-      <!--        <template slot-scope="scope">-->
-      <!--          <el-tag v-if="scope.row.fsUserId > 0" type="success">是</el-tag>-->
-      <!--          <el-tag v-else type="danger">否</el-tag>-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
       <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">
         <!-- 表头提示 -->
         <template slot="header">
@@ -187,6 +184,17 @@
           </el-tooltip>
         </template>
       </el-table-column>
+      <el-table-column label="客户等级" align="center" prop="levelName" width="180"/>
+      <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>
+      <el-table-column label="添加日期" align="center" prop="createTime" width="180"/>
+      <el-table-column label="添加时间" align="center" prop="crtTime" width="180"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime" width="180"/>
+<!--      <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">-->
+<!--        <template slot-scope="scope">-->
+<!--          <el-tag v-if="scope.row.fsUserId > 0" type="success">是</el-tag>-->
+<!--          <el-tag v-else type="danger">否</el-tag>-->
+<!--        </template>-->
+<!--      </el-table-column>-->
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
         <template slot-scope="scope">
           <!--          <el-button-->
@@ -220,7 +228,7 @@
         </template>
       </el-table-column>
       <el-table-column label="加群时间" align="center" prop="joinTime" width="180"/>
-      <!--      <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>-->
+<!--      <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>-->
     </el-table>
 
     <pagination-more
@@ -287,7 +295,7 @@
                       @click="toggleSalesCall(index)"
                       style="margin-top: 10px;"
                     >
-                      {{ item.isSalesCallAdded ? '移除#销售称呼#' : '添加#销售称呼#' }}
+                      {{ item.isSalesCallAdded ? '移除#客服称呼#' : '添加#客服称呼#' }}
                     </el-link>
                     <el-link
                       v-if="item.contentType == 1"
@@ -377,7 +385,44 @@
                         @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>
@@ -484,6 +529,10 @@
       </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>
 
@@ -502,13 +551,15 @@ import {addCourseFinishTemp, updateCourseFinishTemp} from "@/api/course/courseFi
 import {allListTagGroup} from "@/api/qw/tagGroup";
 import {listTag} from "@/api/qw/tag";
 import {searchTags} from "../../../api/qw/tag";
-import PaginationMore from '@/components/PaginationMore/index.vue'
+import userVideo from "@/views/qw/userVideo/userVideo.vue";
+import PaginationMore from "../../../components/PaginationMore/index.vue";
 
 export default {
   name: "sopUserLogsInfoDetails",
-  components: { PaginationMore, ImageUpload},
+  components: {PaginationMore, userVideo, ImageUpload},
   data() {
     return {
+      statusOptions:[],
       //上传语音的遮罩层
       voiceLoading :false,
       uploadUrl:process.env.VUE_APP_BASE_API+"/common/uploadOSS2",
@@ -527,6 +578,12 @@ export default {
       showSearch: true,
       // 总条数
       total: 0,
+      videoNumOptions: {
+        title: '选择视频号',
+        open: false,
+        content: null,
+        contentIndex: null,
+      },
       // sopUserLogsInfo表格数据
       sopUserLogsInfoList: [],
       sysFsSopWatchStatus: [],
@@ -539,9 +596,6 @@ export default {
       open: false,
       updateOpen:false,
       // 查询参数
-
-      scheduleEntryTime:null,
-
       queryParams: {
         pageNum: 1,
         pageSize: 10,
@@ -559,9 +613,10 @@ export default {
         externalUserName: null,
         createTime: null,
         entryTime: null,
-        inComingSTime: null,
-        inComingETime: null,
+        fsUserIdStatus:null,
+        level:null
       },
+      ratingType: [],
 
       tagGroupList: [],
 
@@ -617,6 +672,16 @@ export default {
   },
 
   created() {
+
+    this.getDicts("sys_qw_allow_select").then((response) => {
+      this.statusOptions = response.data;
+    });
+
+    this.getDicts("sys_qw_sop_rating_type").then(response => {
+      this.ratingType = response.data;
+    });
+
+
     this.getDicts("sys_qwSopAi_contentType").then(response => {
       this.sysQwSopAiContentType = response.data;
     });
@@ -914,7 +979,7 @@ export default {
 
       // 检查是否按下了 Backspace 或 Delete 键
       if (event.key === 'Backspace' || event.key === 'Delete') {
-        const tags = ['#销售称呼#', '#客户称呼#']; // 需要检查的标签
+        const tags = ['#客服称呼#', '#客户称呼#']; // 需要检查的标签
         const value = item.value;
 
         // 遍历标签,检查是否需要删除
@@ -932,7 +997,7 @@ export default {
                 textarea.setSelectionRange(start, start);
               });
               // 更新状态
-              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客服称呼#') item.isSalesCallAdded = false;
               if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
               event.preventDefault(); // 阻止默认删除行为
               break; // 找到匹配的标签后退出循环
@@ -944,7 +1009,7 @@ export default {
               // 删除整个标签
               item.value = value.slice(0, cursorPosition) + value.slice(end);
               // 更新状态
-              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客服称呼#') item.isSalesCallAdded = false;
               if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
               event.preventDefault(); // 阻止默认删除行为
               break; // 找到匹配的标签后退出循环
@@ -967,7 +1032,7 @@ export default {
                 textarea.setSelectionRange(tagStart, tagStart);
               });
               // 更新状态
-              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客服称呼#') item.isSalesCallAdded = false;
               if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
               event.preventDefault(); // 阻止默认删除行为
               break; // 找到匹配的标签后退出循环
@@ -977,20 +1042,20 @@ export default {
       }
     },
 
-    // 切换添加销售称呼按钮点击事件
+    // 切换添加客服称呼按钮点击事件
     toggleSalesCall(index) {
       const item = this.setting[index];
-      const salesCall = '#销售称呼#';
+      const salesCall = '#客服称呼#';
       const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
 
       // 获取当前光标位置
       const cursorPosition = textarea.selectionStart;
 
       if (item.isSalesCallAdded) {
-        // 移除所有的 #销售称呼#
+        // 移除所有的 #客服称呼#
         item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
       } else {
-        // 添加 #销售称呼#
+        // 添加 #客服称呼#
         item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
       }
 
@@ -1011,7 +1076,7 @@ export default {
       const cursorPosition = textarea.selectionStart;
 
       if (item.isSalesCallCustomerAdded) {
-        // 移除所有的 #销售称呼#
+        // 移除所有的 #客服称呼#
         item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
       } else {
         // 添加 #客户称呼#
@@ -1118,16 +1183,6 @@ export default {
       this.resetForm("msgForm");
     },
 
-    handleScheduleTimeChange(val) {
-      if (val) {
-        this.queryParams.inComingSTime = val[0];
-        this.queryParams.inComingETime = val[1];
-      } else {
-        this.queryParams.inComingSTime = null;
-        this.queryParams.inComingETime = null;
-      }
-    },
-
     /** 搜索按钮操作 */
     handleQuery() {
 
@@ -1156,9 +1211,6 @@ export default {
     /** 重置按钮操作 */
     resetQuery() {
       this.selectTags=[];
-      this.scheduleEntryTime=null;
-      this.queryParams.inComingSTime=null;
-      this.queryParams.inComingETime=null;
       this.resetForm("queryForm");
       this.handleQuery();
     },
@@ -1343,7 +1395,32 @@ export default {
         this.download(response.msg);
         this.exportLoading = false;
       }).catch(() => {});
-    }
+    },
+    //选择视频号
+    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;
+
+    },
   }
 };
 </script>

+ 1400 - 0
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetailsOld.vue

@@ -0,0 +1,1400 @@
+<template>
+  <div class="app-container">
+    <el-alert
+      title="注意事项"
+      type="warning"
+      :closable="false"
+      show-icon>
+      <template #title>
+              <span style="font-size: 20px; line-height: 1.5;">
+                    搜索【客户备注】【标签】【进线时间】 只能搜索/筛选出 【当前页】的数据)【可以用客户id来搜(客户id来源-》企微/我的企微客户-》列表的企微客户ID)】
+              </span>
+      </template>
+    </el-alert>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
+      <!--      <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="externalUserName">
+        <el-input
+          v-model="queryParams.externalUserName"
+          placeholder="请输入客户名称"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户备注" prop="remark">
+        <el-input
+          v-model="queryParams.remark"
+          placeholder="请输入客户备注"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="客户id" prop="externalId">
+        <el-input
+          v-model="queryParams.externalId"
+          placeholder="请输入企微客户id"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+<!--      <el-form-item label="进线时间" prop="entryTime" v-if="queryParams.filterMode == 1">-->
+<!--        <el-date-picker clearable size="small"-->
+<!--                        v-model="queryParams.entryTime"-->
+<!--                        type="date"-->
+<!--                        value-format="yyyy-MM-dd"-->
+<!--                        placeholder="选择营期时间">-->
+<!--        </el-date-picker>-->
+<!--      </el-form-item>-->
+
+      <el-form-item label="进线时间" prop="entryTime" v-if="queryParams.filterMode == 1">
+        <el-date-picker
+          v-model="scheduleEntryTime"
+          type="datetimerange"
+          size="small"
+          style="width: 350px"
+          value-format="yyyy-MM-dd HH:mm:ss"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          @change="handleScheduleTimeChange">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="标签" prop="tagIds">
+        <!--        <el-select v-model="selectTags" 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: 250px">
+          <div style="min-height: 35px; max-height: 200px; overflow-y: auto;">
+            <el-tag type="success"
+                    closable
+                    :disable-transitions="false"
+                    v-for="list in this.selectTags"
+                    :key="list.tagId"
+                    @close="handleCloseTags(list)"
+                    style="margin: 3px;"
+            >{{list.name}}
+            </el-tag>
+          </div>
+        </div>
+
+      </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" v-if="queryParams.filterMode == 1">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          icon="el-icon-s-promotion"
+          size="medium"
+          :disabled="multiple"
+          @click="handleSendMsg"
+          v-hasPermi="['qw:sopUserLogsInfo:msg']"
+        >一键群发</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="medium"
+          :disabled="multiple"
+          @click="handleUpdate"
+          v-hasPermi="['qw:sopUserLogsInfo:edit']"
+        >批量修改客户营期</el-button>
+      </el-col>
+    </el-row>
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="queryParams.filterMode == 1">
+      <i class="el-icon-info"></i>
+      【一键群发】:用于给 选中的 客户 发送插件信息
+    </div>
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="queryParams.filterMode == 1">
+      <i class="el-icon-info"></i>
+      【批量修改客户营期】:选中 相应的客户 修改到 想进的相应的营期
+    </div>
+    <div style="color: #999;font-size: 14px;display: flex;align-items: center;margin-bottom: 5px" v-if="queryParams.filterMode == 1">
+      <i class="el-icon-info"></i>
+      【官方群发许可】:只有这里显示为【是】的,才能通过模板中的 官方群发 来发送(允许条件是 客户点击过【非官方群发】发送的课程!)
+    </div>
+
+    <el-table border v-loading="loading" :data="sopUserLogsInfoList" @selection-change="handleSelectionChange" v-if="queryParams.filterMode == 1">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="编号" align="center" prop="id" width="100"/>
+      <!--      <el-table-column label="企微员工账号" align="center" prop="qwUserId" width="100"/>-->
+      <el-table-column label="客户ID" align="center" prop="externalId" width="100"/>
+      <!--      <el-table-column label="客户小程序id" align="center" prop="fsUserId" width="100">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <el-tag type="success">-->
+      <!--            {{ scope.row.fsUserId === 0 || scope.row.fsUserId === null ? '无' : scope.row.fsUserId }}-->
+      <!--          </el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <el-table-column label="客户名称" align="center" prop="externalUserName" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="客户标签" align="center" prop="tagIdsName" width="250px">
+        <template slot-scope="scope">
+          <div v-for="name in scope.row.tagIdsName" style="display: inline;">
+            <el-tag type="success">{{ name }}</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>
+      <el-table-column label="添加日期" align="center" prop="createTime" width="180"/>
+      <el-table-column label="添加时间" align="center" prop="crtTime" width="180"/>
+      <el-table-column label="修改时间" align="center" prop="updateTime" width="180"/>
+      <!--      <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">-->
+      <!--        <template slot-scope="scope">-->
+      <!--          <el-tag v-if="scope.row.fsUserId > 0" type="success">是</el-tag>-->
+      <!--          <el-tag v-else type="danger">否</el-tag>-->
+      <!--        </template>-->
+      <!--      </el-table-column>-->
+      <el-table-column label="官方群发许可" align="center" prop="fsUserId" width="70">
+        <!-- 表头提示 -->
+        <template slot="header">
+          <el-tooltip effect="dark" content="即点过小程序链接的,通过插件助手发过一次课,且客户观看了的" placement="top">
+            <span>官方群发许可</span>
+          </el-tooltip>
+        </template>
+
+        <!-- 单元格提示 -->
+        <template slot-scope="scope">
+          <el-tooltip
+            effect="dark"
+            :content="`通过插件助手发过一次课,且客户观看了的`"
+            placement="top"
+          >
+            <el-tag v-if="scope.row.fsUserId > 0" type="success">是</el-tag>
+            <el-tag v-else type="danger">否</el-tag>
+          </el-tooltip>
+        </template>
+      </el-table-column>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120" fixed="right">
+        <template slot-scope="scope">
+          <!--          <el-button-->
+          <!--            size="mini"-->
+          <!--            type="text"-->
+          <!--            icon="el-icon-edit"-->
+          <!--            @click="handleUpdate(scope.row)"-->
+          <!--            v-hasPermi="['qw:sopUserLogsInfo:edit']"-->
+          <!--          >修改客户营期</el-button>-->
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['qw:sopUserLogsInfo:remove']"
+          >删除客户营期</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <el-table border v-loading="loading" :data="sopUserLogsInfoList" @selection-change="handleSelectionChange" v-if="queryParams.filterMode == 2">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="编号" align="center" prop="id" width="100"/>
+      <el-table-column label="客户名称" align="center" prop="name" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="客户标签" align="center" prop="tagIdsName" width="250px">
+        <template slot-scope="scope">
+          <div v-for="name in scope.row.tagIdsName" style="display: inline;">
+            <el-tag type="success">{{ name }}</el-tag>
+          </div>
+        </template>
+      </el-table-column>
+      <el-table-column label="加群时间" align="center" prop="joinTime" width="180"/>
+      <!--      <el-table-column label="进线时间" align="center" prop="inComTime" width="180"/>-->
+    </el-table>
+
+    <pagination-more
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <el-dialog :title="sendMsgOpen.title" :visible.sync="sendMsgOpen.open"  width="1000px" append-to-body>
+      <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
+        <el-form-item label="选择课程">
+          <el-select  v-model="msgForm.courseId" placeholder="请选择课程" style=" margin-right: 10px;" size="mini" remote  filterable  @change="courseChange()">
+            <el-option
+              v-for="dict in courseList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            />
+          </el-select>
+          <el-select  v-model="msgForm.videoId" placeholder="请选择小节" size="mini" style=" margin-right: 10px;" remote  filterable @change="videoIdChange()"  >
+            <el-option
+              v-for="dict in videoList"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            />
+          </el-select>
+          <el-select  v-model="msgForm.courseType" placeholder="请选择消息类型" size="mini" style=" margin-right: 10px;">
+            <el-option
+              v-for="dict in sysFsSopWatchStatus"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            />
+          </el-select>
+        </el-form-item>
+        <el-form-item label="规则" prop="setting"  >
+          <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"  @change="handleContentTypeChange()">{{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;"
+                      @keydown.native="handleKeydown($event, index)"
+                      :ref="`textarea-${index}`"
+                    >
+                    </el-input>
+                    <el-link
+                      v-if="item.contentType == 1"
+                      type="primary"
+                      @click="toggleSalesCall(index)"
+                      style="margin-top: 10px;"
+                    >
+                      {{ item.isSalesCallAdded ? '移除#销售称呼#' : '添加#销售称呼#' }}
+                    </el-link>
+                    <el-link
+                      v-if="item.contentType == 1"
+                      type="primary"
+                      @click="toggleSalesCallCustomer(index)"
+                      style="margin-top: 10px;margin-left: 2%"
+                    >
+                      {{ item.isSalesCallCustomerAdded ? '移除#客户称呼#' : '添加#客户称呼#' }}
+                    </el-link>
+
+
+                    <ImageUpload v-if="item.contentType == 2 " v-model="item.imgUrl" type="image" :num="1"  :width="150" :height="150" />
+
+                    <div v-if="item.contentType == 3 || item.contentType ==9 ">
+                      <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-tag type="warning" v-model="item.isBindUrl=1">选择的课程小节 即为卡片链接地址</el-tag>
+                        </el-form-item>
+                      </el-card>
+                    </div>
+                    <div v-if="item.contentType == 4 || item.contentType == 10">
+                      <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='wx73f85f8d62769119' " disabled />
+                        </el-form-item>
+                        <el-form-item label="page路径" prop="miniprogramPage" v-show="item.contentType == 10" label-width="100px" style="margin-left: -30px" >
+                          <el-input v-model="item.miniprogramPage" placeholder="小程序消息打开后的路径" type="textarea" :rows="3" />
+                        </el-form-item>
+                      </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">
+
+                    </div>
+
+                  </el-form-item>
+
+                  <el-form-item label="添加短链" v-if="item.contentType == 1 "  >
+                    <el-tooltip content="请先根据课程选定课程小节之后再添加" effect="dark" :disabled="!!msgForm.videoId">
+                      <el-switch
+                        v-model="item.isBindUrl"
+                        :disabled="!msgForm.videoId"
+                        active-color="#13ce66"
+                        inactive-color="#DCDFE6"
+                        active-value="1"
+                        inactive-value="2">
+                      </el-switch>
+                    </el-tooltip>
+
+                    <span v-if="item.isBindUrl == '1'" style="margin-left: 10px; color: #13ce66">添加URL</span>
+                    <span v-if="item.isBindUrl == '2'" style="margin-left: 10px; color: #b1b4ba">不加URL</span>
+                  </el-form-item>
+                  <el-form-item label="课节过期时间" v-if="item.isBindUrl == '1'
+                                                          && item.contentType != 2
+                                                          && item.contentType != 5
+                                                          && item.contentType != 6
+                                                          && item.contentType != 8"
+                                style="margin-top: 1%" label-width="100px">
+                    <el-row>
+                      <el-input-number  v-model="item.expiresDays"  :min="1" :max="100" ></el-input-number>
+                      (天)
+                    </el-row>
+                    <el-row>
+                      <span class="tip">填写0或不填时,默认为系统配置的默认时间</span>
+                    </el-row>
+                  </el-form-item>
+                </el-form>
+              </el-col>
+              <el-col :span="1" :offset="1">
+                <i class="el-icon-delete" @click="delSetList(index)" 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()'  >添加内容</el-link>
+
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitMsgForm">确 定</el-button>
+        <el-button @click="cancelMsgForm">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <!-- 添加或修改sopUserLogsInfo对话框 -->
+    <el-dialog title="批量修改客户营期" :visible.sync="updateOpen" width="500px" append-to-body>
+      <el-form ref="updateLogsInfoFrom" :model="updateLogsInfoFrom" :rules="batchRules" label-width="120px">
+        <el-form-item label="选择营期时间" prop="paramTime">
+          <el-date-picker clearable size="small"
+                          v-model="updateLogsInfoFrom.paramTime"
+                          type="date"
+                          value-format="yyyy-MM-dd"
+                          placeholder="选择营期时间">
+          </el-date-picker>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+
+    <!--  搜索标签   -->
+    <el-dialog :title="changeTagDialog.title" :visible.sync="changeTagDialog.open" style="width:100%;height: 100%" 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(queryTagParams.name)">搜索</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="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>
+
+      <pagination
+        v-show="tagTotal>0"
+        :total="tagTotal"
+        :page.sync="queryTagParams.pageNum"
+        :limit.sync="queryTagParams.pageSize"
+        @pagination="getPageListTagGroup"
+      />
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="tagSubmitForm()">确 定</el-button>
+        <el-button @click="tagCancel()">取消</el-button>
+      </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {
+  listSopUserLogsInfo,
+  delSopUserLogsInfo,
+  addSopUserLogsInfo,
+  updateSopUserLogsInfo,
+  exportSopUserLogsInfo,
+  sendMsgSop, batchUpdateSopUserLogsInfoToTime
+} from "@/api/qw/sopUserLogsInfo";
+import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
+import {courseList, videoList} from "@/api/qw/sop";
+import {addCourseFinishTemp, updateCourseFinishTemp} from "@/api/course/courseFinishTemp";
+import {allListTagGroup} from "@/api/qw/tagGroup";
+import {listTag} from "@/api/qw/tag";
+import {searchTags} from "../../../api/qw/tag";
+import PaginationMore from '@/components/PaginationMore/index.vue'
+
+export default {
+  name: "sopUserLogsInfoDetails",
+  components: { PaginationMore, ImageUpload},
+  data() {
+    return {
+      //上传语音的遮罩层
+      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,
+      // sopUserLogsInfo表格数据
+      sopUserLogsInfoList: [],
+      sysFsSopWatchStatus: [],
+      isSalesCallAdded:false,
+      isSalesCallCustomerAdded:false,
+      selectTags:[],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      updateOpen:false,
+      // 查询参数
+
+      scheduleEntryTime:null,
+
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        tagIds:null,
+        remark:null,
+        sopId: null,
+        userLogsId: null,
+        userIdParam:null,
+        startTimeParam:null,
+        externalContactId: null,
+        qwUserId: null,
+        corpId: null,
+        externalId: null,
+        fsUserId: null,
+        externalUserName: null,
+        createTime: null,
+        entryTime: null,
+        inComingSTime: null,
+        inComingETime: null,
+      },
+
+      tagGroupList: [],
+
+      tagTotal:0,
+
+      //标签
+      changeTagDialog:{
+        title:"",
+        open:false,
+      },
+
+      queryTagParams:{
+        pageNum: 1,
+        pageSize: 10,
+        total:0,
+        name:null,
+        corpId:null,
+      },
+
+      courseList:[],
+      videoList:[],
+      //插件版
+      sysQwSopAiContentType:[],
+
+      sendMsgOpen:{
+        title:'一键批量群发',
+        open:false,
+        ids:null,
+      },
+      // 表单参数
+      form: {},
+      updateLogsInfoFrom:{},
+      setting:[{contentType:'1', value: '',}],
+      msgForm:{
+        videoId:null,
+        courseId:null,
+        courseType:null,
+        userIdParam:null,
+        setting:null,
+        ids:null,
+        sopId: null,
+        startTime: null,
+      },
+      // 表单校验
+      rules: {},
+      batchRules:{
+        paramTime: [
+          { required: true, message: '选择的时间不能为空', trigger: 'blur' }
+        ],
+      },
+      msgRules:{},
+    };
+  },
+
+  created() {
+    this.getDicts("sys_qwSopAi_contentType").then(response => {
+      this.sysQwSopAiContentType = response.data;
+    });
+    this.getDicts("sys_fs_sop_watch_status").then(response => {
+      this.sysFsSopWatchStatus = response.data;
+    });
+
+    courseList().then(response => {
+      this.courseList = response.list;
+    });
+  },
+  methods: {
+
+    selectSopUserLogsInfo(val,externalUserName){
+
+      this.loading = true;
+      this.queryParams.sopId=val.sopId;
+      this.queryParams.filterMode=val.filterMode;
+      this.queryParams.userLogsId=val.id;
+      this.queryParams.chatId=val.chatId;
+      if (externalUserName!=null){
+        this.queryParams.externalUserName = externalUserName;
+      }
+
+      listSopUserLogsInfo(this.queryParams).then(response => {
+        this.sopUserLogsInfoList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+
+
+      this.queryParams.qwUserId=val.qwUserId;
+      this.queryParams.corpId=val.corpId;
+      //用于一键群发
+      this.queryParams.userIdParam=val.userId;
+      this.queryParams.startTimeParam=val.startTime;
+      this.queryParams.corpIdParam=val.corpId;
+
+    },
+
+    //搜索的标签
+    hangleChangeTags(){
+
+      this.changeTagDialog.title="搜索的标签"
+      this.changeTagDialog.open=true;
+
+      // 获取 tagListFormIndex 中的所有 tagId,用于快速查找
+      const selectedTagIds = new Set(
+        (this.selectTags || []).map(tagItem => tagItem?.tagId)
+      );
+
+      this.queryTagParams.name=null;
+      this.getPageListTagGroup();
+
+      setTimeout(() => {
+        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);
+          }
+        }
+      }, 200);
+
+
+    },
+
+    tagSelection(row){
+
+      row.isSelected= !row.isSelected;
+      this.$forceUpdate();
+    },
+
+
+    //确定选择标签
+    tagSubmitForm(){
+
+      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.selectTags) {
+              this.selectTags = [];
+            }
+
+            // 检查当前 tag 是否已经存在于 tagListFormIndex[index] 中
+            let tagExists = this.selectTags.some(
+              tag => tag.id === this.tagGroupList[i].tag[x].id
+            );
+
+            // 如果 tag 不存在于 tagListFormIndex[index] 中,则新增
+            if (!tagExists) {
+              this.selectTags.push(this.tagGroupList[i].tag[x]);
+            }
+          }
+        }
+      }
+      if (!this.selectTags || this.selectTags.length === 0) {
+        return this.$message('请选择标签');
+      }
+
+      this.changeTagDialog.open = false;
+    },
+
+    //取消选择标签
+    tagCancel(){
+      this.changeTagDialog.open = false;
+    },
+
+    //删除一些选择的标签
+    handleCloseTags(list){
+      const ls = this.selectTags.findIndex(t => t.tagId === list.tagId);
+      if (ls !== -1) {
+        this.selectTags.splice(ls, 1);
+        this.selectTags = [...this.selectTags];
+      }
+
+      if (this.selectTags!=null && this.selectTags.length>0){
+        // 确保 this.form.tags 是数组
+        if (!this.queryParams.tagIds) {
+          this.queryParams.tagIds = []; // 如果未定义,初始化
+        } else {
+          this.queryParams.tagIds = []; // 清空已有数据
+        }
+
+        // 遍历并添加 tagId
+        this.selectTags.forEach(tag => {
+          if (tag.tagId) { // 确保 tagId 存在
+            this.queryParams.tagIds.push(tag.tagId);
+          }
+        });
+        this.queryParams.tagIds=this.queryParams.tagIds.join(",");
+      }else {
+        this.queryParams.tagIds=null;
+      }
+
+    },
+
+    handleSearchTags(name){
+
+      searchTags({name:name,corpId:this.queryParams.corpId}).then(response => {
+        this.tagGroupList = response.rows;
+      });
+
+    },
+
+
+    cancelSearchTags(){
+
+      this.resetSearchQueryTag()
+
+      this.getPageListTagGroup();
+
+    },
+
+    getPageListTagGroup(){
+      this.queryTagParams.corpId=this.queryParams.corpId
+      allListTagGroup(this.queryTagParams).then(response => {
+        this.tagGroupList = response.rows;
+        this.tagTotal = response.total;
+      });
+    },
+
+    resetSearchQueryTag(){
+
+      this.queryTagParams= {
+        pageNum: 1,
+        pageSize: 10,
+        total:0,
+        name:null,
+      };
+    },
+
+
+    courseChange() {
+      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++) {
+          //响应式直接给链接的标题/封面上值
+          if (selectedCourse && this.msgForm.courseId != null) {
+            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);
+            }
+          }
+
+        }
+
+      }
+      videoList(this.msgForm.courseId).then(response => {
+        this.videoList=response.list;
+      });
+    },
+
+    videoIdChange() {
+      if (this.msgForm.videoId != null ) {
+        // 查找选中的课节对应的 label
+        const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
+
+        for (let i = 0; i < this.setting.length; i++) {
+          //响应式直接给链接的描述上值
+          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.setting[i].contentType == 10){
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
+
+          }
+        }
+      }
+    },
+    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;
+    },
+
+    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;
+    },
+
+    handleInputVideoText(value,content){
+      // 允许的字符:中文、英文(大小写)、数字和指定标点符号(,。!?)
+      const regex = /^[\u4e00-\u9fa5,。!?,!?]+$/;
+
+      // 删除不符合条件的字符
+      const filteredValue = value.split('').filter(char => regex.test(char)).join('');
+
+      this.$set(content, 'value', filteredValue);
+
+    },
+
+    delSetList(index){
+      this.setting.splice(index,1)
+    },
+    addSetList(){
+      const newSetting = {
+        contentType:'1',
+        value: '',
+      };
+      // 将新设置项添加到 content.setting 数组中
+      this.setting.push(newSetting);
+
+    },
+
+
+    handleKeydown(event, index) {
+      const item = this.setting[index];
+      const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
+      const cursorPosition = textarea.selectionStart;
+
+      // 检查是否按下了 Backspace 或 Delete 键
+      if (event.key === 'Backspace' || event.key === 'Delete') {
+        const tags = ['#销售称呼#', '#客户称呼#']; // 需要检查的标签
+        const value = item.value;
+
+        // 遍历标签,检查是否需要删除
+        for (const tag of tags) {
+          let start, end;
+
+          if (event.key === 'Backspace') {
+            // 检查光标前是否是当前标签的一部分
+            start = cursorPosition - tag.length;
+            if (start >= 0 && value.slice(start, cursorPosition) === tag) {
+              // 删除整个标签
+              item.value = value.slice(0, start) + value.slice(cursorPosition);
+              // 更新光标位置
+              this.$nextTick(() => {
+                textarea.setSelectionRange(start, start);
+              });
+              // 更新状态
+              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
+              event.preventDefault(); // 阻止默认删除行为
+              break; // 找到匹配的标签后退出循环
+            }
+          } else if (event.key === 'Delete') {
+            // 检查光标后是否是当前标签的一部分
+            end = cursorPosition + tag.length;
+            if (end <= value.length && value.slice(cursorPosition, end) === tag) {
+              // 删除整个标签
+              item.value = value.slice(0, cursorPosition) + value.slice(end);
+              // 更新状态
+              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
+              event.preventDefault(); // 阻止默认删除行为
+              break; // 找到匹配的标签后退出循环
+            }
+          }
+
+          // 检查光标是否位于标签的中间
+          for (let i = 0; i <= tag.length; i++) {
+            const tagStart = cursorPosition - i;
+            const tagEnd = tagStart + tag.length;
+            if (
+              tagStart >= 0 &&
+              tagEnd <= value.length &&
+              value.slice(tagStart, tagEnd) === tag
+            ) {
+              // 删除整个标签
+              item.value = value.slice(0, tagStart) + value.slice(tagEnd);
+              // 更新光标位置
+              this.$nextTick(() => {
+                textarea.setSelectionRange(tagStart, tagStart);
+              });
+              // 更新状态
+              if (tag === '#销售称呼#') item.isSalesCallAdded = false;
+              if (tag === '#客户称呼#') item.isSalesCallCustomerAdded = false;
+              event.preventDefault(); // 阻止默认删除行为
+              break; // 找到匹配的标签后退出循环
+            }
+          }
+        }
+      }
+    },
+
+    // 切换添加销售称呼按钮点击事件
+    toggleSalesCall(index) {
+      const item = this.setting[index];
+      const salesCall = '#销售称呼#';
+      const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
+
+      // 获取当前光标位置
+      const cursorPosition = textarea.selectionStart;
+
+      if (item.isSalesCallAdded) {
+        // 移除所有的 #销售称呼#
+        item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
+      } else {
+        // 添加 #销售称呼#
+        item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
+      }
+
+      // 切换状态
+      item.isSalesCallAdded = !item.isSalesCallAdded;
+
+      // 保持光标位置
+      this.$nextTick(() => {
+        textarea.setSelectionRange(cursorPosition, cursorPosition);
+      });
+    },
+    toggleSalesCallCustomer(index) {
+      const item = this.setting[index];
+      const salesCall = '#客户称呼#';
+      const textarea = this.$refs[`textarea-${index}`][0].$refs.textarea;
+
+      // 获取当前光标位置
+      const cursorPosition = textarea.selectionStart;
+
+      if (item.isSalesCallCustomerAdded) {
+        // 移除所有的 #销售称呼#
+        item.value = item.value.replace(new RegExp(salesCall, 'g'), '');
+      } else {
+        // 添加 #客户称呼#
+        item.value = item.value.slice(0, cursorPosition) + salesCall + item.value.slice(cursorPosition);
+      }
+
+      // 切换状态
+      item.isSalesCallCustomerAdded = !item.isSalesCallCustomerAdded;
+
+      // 保持光标位置
+      this.$nextTick(() => {
+        textarea.setSelectionRange(cursorPosition, cursorPosition);
+      });
+    },
+
+    handleContentTypeChange() {
+
+      //如果是链接的才上
+      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++) {
+          //响应式直接给链接的标题/封面上值
+          if (selectedCourse  && this.msgForm.courseId != null) {
+
+            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);
+            }
+
+
+          }
+
+        }
+
+      }
+      if (this.msgForm.videoId != null ) {
+        // 查找选中的课节对应的 label
+        const selectedVideo = this.videoList.find(course => parseInt(course.dictValue) === this.msgForm.videoId);
+
+        for (let i = 0; i < this.setting.length; i++) {
+          //响应式直接给链接的描述上值
+          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.setting[i].contentType == 10){
+              this.$set(this.setting[i], 'miniprogramTitle', selectedVideo.dictLabel);
+            }
+
+          }
+        }
+      }
+
+
+    },
+
+
+    /** 查询sopUserLogsInfo列表 */
+    getList() {
+      this.loading = true;
+      listSopUserLogsInfo(this.queryParams).then(response => {
+        this.sopUserLogsInfoList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.updateOpen = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        sopId: null,
+        userLogsId: null,
+        externalContactId: null,
+        qwUserId: null,
+        corpId: null,
+        externalId: null,
+        fsUserId: null,
+        externalUserName: null,
+        createTime: null,
+        crtTime: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+
+
+    resetSendMsgSop() {
+      this.msgForm = {
+        videoId:null,
+        courseId:null,
+        courseType:null,
+        setting:null,
+        ids:null,
+      };
+      this.resetForm("msgForm");
+    },
+
+    handleScheduleTimeChange(val) {
+      if (val) {
+        this.queryParams.inComingSTime = val[0];
+        this.queryParams.inComingETime = val[1];
+      } else {
+        this.queryParams.inComingSTime = null;
+        this.queryParams.inComingETime = null;
+      }
+    },
+
+    /** 搜索按钮操作 */
+    handleQuery() {
+
+      if (this.selectTags!=null && this.selectTags.length>0){
+        // 确保 this.form.tags 是数组
+        if (!this.queryParams.tagIds) {
+          this.queryParams.tagIds = []; // 如果未定义,初始化
+        } else {
+          this.queryParams.tagIds = []; // 清空已有数据
+        }
+
+        // 遍历并添加 tagId
+        this.selectTags.forEach(tag => {
+          if (tag.tagId) { // 确保 tagId 存在
+            this.queryParams.tagIds.push(tag.tagId);
+          }
+        });
+        this.queryParams.tagIds=this.queryParams.tagIds.join(",");
+      }else {
+        this.queryParams.tagIds=null;
+      }
+
+
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.selectTags=[];
+      this.scheduleEntryTime=null;
+      this.queryParams.inComingSTime=null;
+      this.queryParams.inComingETime=null;
+      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 = "添加客户营期";
+    },
+
+    /**
+     * 一键群发
+     */
+    handleSendMsg(){
+      this.sendMsgOpen.open=true;
+      this.sendMsgOpen.ids=this.ids;
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate() {
+      this.updateOpen= true;
+    },
+    submitMsgForm(){
+      this.$refs["msgForm"].validate(valid => {
+        if (valid) {
+
+          this.msgForm.setting=JSON.stringify(this.setting)
+          this.msgForm.ids=this.ids;
+          this.msgForm.sopId=this.queryParams.sopId;
+          this.msgForm.userIdParam=this.queryParams.userIdParam;
+          this.msgForm.startTime=this.queryParams.startTimeParam;
+          this.msgForm.corpId=this.queryParams.corpIdParam;
+          this.msgForm.filterMode=this.queryParams.filterMode;
+
+          if (this.setting.length <= 0) {
+            return this.$message.error("请添加规则")
+          }
+          if (this.msgForm.courseId===null || this.msgForm.courseId===''){
+            return this.$message.error("课程不能为空")
+          }
+
+          if (this.msgForm.videoId===null || this.msgForm.videoId===''){
+            return this.$message.error("课节不能为空")
+          }
+
+          if (this.msgForm.courseType===null || this.msgForm.courseType===''){
+            return this.$message.error("消息类型不能为空")
+          }
+
+          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].contentType == 9  ) && (this.setting[i].linkTitle == null || this.setting[i].linkTitle == "")) {
+              return this.$message.error("链接标题不能为空")
+            }
+            if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkDescribe == null || this.setting[i].linkDescribe == "")) {
+              return this.$message.error("链接描述不能为空")
+            }
+            if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 ) && (this.setting[i].linkImageUrl == null || this.setting[i].linkImageUrl == "")) {
+              return this.$message.error("链接图片不能为空")
+            }
+            if ((this.setting[i].contentType == 3 || this.setting[i].contentType == 9 )&& this.setting[i].type == 1 && (this.setting[i].linkUrl == null || this.setting[i].linkUrl == "")) {
+              return this.$message.error("链接地址不能为空")
+            }
+
+            if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 ) && (this.setting[i].miniprogramTitle == null || this.setting[i].miniprogramTitle == "")) {
+              return this.$message.error("小程序消息标题不能为空")
+            }
+            if ((this.setting[i].contentType == 4 || this.setting[i].contentType == 10 )  && (this.setting[i].miniprogramPicUrl == null || this.setting[i].miniprogramPicUrl == "")) {
+              return this.$message.error("小程序封面地址不能为空")
+            }
+
+            if (this.setting[i].contentType == 10 && (this.setting[i].miniprogramPage == null || this.setting[i].miniprogramPage == "")) {
+              return this.$message.error("小程序page地址不能为空")
+            }
+
+            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("语音不能为空")
+            }
+          }
+
+          this.sendMsgOpen.open = false;
+
+          const loading = this.$loading({
+            lock: true,
+            text: '正在执行中请稍后~~请不要刷新页面!!',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+          sendMsgSop(this.msgForm).then(response => {
+            this.msgSuccess("一键群发成功");
+            loading.close();
+            this.setting=[];
+            this.msgForm = {
+              videoId:null,
+              courseId:null,
+              courseType:null,
+              setting:null,
+            }
+            this.getList();
+          }).finally(()=>{
+            loading.close();
+          });
+
+        }
+      });
+    },
+    cancelMsgForm(){
+      this.sendMsgOpen.open = false;
+      this.resetSendMsgSop();
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["updateLogsInfoFrom"].validate(valid => {
+        if (valid) {
+
+          this.updateLogsInfoFrom.ids=this.ids;
+          this.updateLogsInfoFrom.sopId= this.queryParams.sopId
+          this.updateLogsInfoFrom.qwUserId=this.queryParams.qwUserId
+          this.updateLogsInfoFrom.corpId= this.queryParams.corpId
+
+
+          let loadingRock = this.$loading({
+            lock: true,
+            text: '正在执行中请稍后~~请不要刷新页面!!',
+            spinner: 'el-icon-loading',
+            background: 'rgba(0, 0, 0, 0.7)'
+          });
+
+
+          batchUpdateSopUserLogsInfoToTime(this.updateLogsInfoFrom).then(response => {
+            this.msgSuccess("修改成功");
+            this.open = false;
+            this.updateOpen=false;
+            this.getList();
+            this.$emit('flashNotify')
+            loadingRock.close();
+          }).finally(res=>{
+            loadingRock.close();
+          })
+
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除sopUserLogsInfo编号为"' + ids + '"的数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(function() {
+        return delSopUserLogsInfo(ids);
+      }).then(() => {
+        this.getList();
+        this.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有营期数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportLoading = true;
+        return exportSopUserLogsInfo(queryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportLoading = false;
+      }).catch(() => {});
+    }
+  }
+};
+</script>
+
+<style scoped>
+/* CSS 样式 */
+.tag-container {
+  display: flex;
+  flex-wrap: wrap; /* 超出宽度时自动换行 */
+  gap: 8px; /* 设置标签之间的间距 */
+}
+.name-background {
+  display: inline-block;
+  background-color: #abece6; /* 背景颜色 */
+  padding: 4px 8px; /* 调整内边距,让背景包裹文字 */
+  border-radius: 4px; /* 可选:设置圆角 */
+}
+.tag-box {
+  padding: 8px 12px;
+  border: 1px solid #989797;
+  border-radius: 4px;
+  cursor: pointer;
+  display: inline-block;
+}
+
+.tag-selected {
+  background-color: #00bc98;
+  color: #fff;
+  border-color: #00bc98;
+}
+
+.el-tag + .el-tag {
+  margin-left: 10px;
+}
+
+
+.button-new-tag {
+  margin-left: 10px;
+  height: 32px;
+  line-height: 30px;
+  padding-top: 0;
+  padding-bottom: 0;
+}
+.input-new-tag {
+  width: 90px;
+  margin-left: 10px;
+  vertical-align: bottom;
+}
+</style>

+ 10 - 0
src/views/qw/user/cuDeptIdIndex.vue

@@ -95,6 +95,16 @@
       </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="ai状态" align="center" prop="loginStatus">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>

+ 24 - 2
src/views/qw/user/index.vue

@@ -111,9 +111,12 @@
         <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="UUID" align="center" prop="uid" />
+      <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">
         <template slot-scope="scope">
           <el-tag v-if="scope.row.ipadStatus == 1" type="success">在线</el-tag>
@@ -287,6 +290,15 @@
           >
             解除主机
           </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">
@@ -508,6 +520,10 @@
               :label="1"
             >方式二
             </el-radio>
+            <el-radio
+              :label="2"
+            >掉线通知
+            </el-radio>
           </el-radio-group>
         </el-form-item>
       </el-form>
@@ -535,6 +551,7 @@ import {
   delQwIpad,
   qrCodeVerify,
   outLoginQwIpad,
+  changeVideoStatus,
   handleAllocateRemoteHost,
   qwBindCloudHost, qwUnbindCloudHost, handleAuthAppKey, handleInputAuthAppKey, selectCloudAP, staffListUser
 } from '../../../api/qw/user'
@@ -714,6 +731,12 @@ export default {
       this.reset();
       this.getList();
     },
+    changeVideoStatus(val){
+      changeVideoStatus(val.id).then(res => {
+        this.$message.success("修改状态成功");
+        this.getList()
+      })
+    },
 
     //绑定AI客服
     bindFastGptRole(row) {
@@ -724,7 +747,6 @@ export default {
       }, 200);
 
     },
-
     handleAppellation(val) {
       this.callOpen.open = true;
       this.callOpenFrom.welcomeText = val.welcomeText;

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

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

+ 6 - 1
src/views/statistics/section/channel.vue

@@ -345,7 +345,12 @@ export default {
     handleQuery() {
       console.log(this.selectedCompanyList == null || this.selectedCompanyList.length < 0)
       if (!this.dateRange || this.dateRange.length !== 2) {
-        this.$message.warning("请选择时间范围");
+        this.$message.error("请选择时间范围");
+        return;
+      }
+
+      if(this.selectedCompanyList == null || this.selectedCompanyList.length <= 0) {
+        this.$message.error("公司为必选!");
         return;
       }
       this.queryParams.pageNum = 1;

+ 6 - 1
src/views/statistics/section/index.vue

@@ -326,7 +326,12 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       if (!this.dateRange || this.dateRange.length !== 2) {
-        this.$message.warning("请选择时间范围");
+        this.$message.error("请选择时间范围");
+        return;
+      }
+
+      if(this.selectedCompanyList == null || this.selectedCompanyList.length <= 0) {
+        this.$message.error("公司为必选!");
         return;
       }
       this.queryParams.pageNum = 1;

+ 5 - 1
src/views/statistics/section/inline.vue

@@ -343,7 +343,11 @@ export default {
     /** 搜索按钮操作 */
     handleQuery() {
       if (!this.dateRange || this.dateRange.length !== 2) {
-        this.$message.warning("请选择时间范围");
+        this.$message.error("请选择时间范围");
+        return;
+      }
+      if(this.selectedCompanyList == null || this.selectedCompanyList.length <= 0) {
+        this.$message.error("公司为必选!");
         return;
       }
       this.queryParams.pageNum = 1;

+ 7 - 3
src/views/statistics/section/today.vue

@@ -5,7 +5,7 @@
         <select-tree
           v-model="selectedCompanyList"
           :raw-data="deptList"
-          placeholder="请选择销售"
+          placeholder="请选择客服"
           :parentSelectable="true"
           :multiple="true"
           component-width="300px"
@@ -15,7 +15,7 @@
           @change="handleMultiChange"
         ></select-tree>
       </el-form-item>
-      <el-form-item label="销售" prop="nickName" v-if="queryParams.companyId">
+      <el-form-item label="客服" prop="nickName" v-if="queryParams.companyId">
         <el-select v-model="queryParams.companyUserId" remote
                    placeholder="请选择"
                    filterable clearable
@@ -340,8 +340,12 @@ export default {
     },
     /** 搜索按钮操作 */
     handleQuery() {
+      if(this.selectedCompanyList == null || this.selectedCompanyList.length <= 0) {
+        this.$message.error("公司和时间为必选!");
+        return;
+      }
       if (!this.dateRange || this.dateRange.length !== 2) {
-        this.$message.warning("请选择时间范围");
+        this.$message.error("请选择时间范围");
         return;
       }
       this.queryParams.pageNum = 1;

+ 735 - 0
src/views/store/components/addOrder.vue

@@ -0,0 +1,735 @@
+<template>
+  <div class="app-container">
+
+
+        <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+           <el-form-item label="会员信息" prop="userId">
+                <el-row  >
+                  <el-col >
+                      <el-input placeholder="请输入会员手机号" style="width:240px;cursor:pointer" v-model="phone">
+                      </el-input>
+                      <el-button plain style="margin-left:10px;"    @click="searchUser()">查询</el-button>
+                      <el-button plain style="margin-left:10px;" icon="el-icon-plus"  type="primary" @click="handleAddUser()">添加会员</el-button>
+                  </el-col>
+                </el-row>
+                <el-table border style="margin-top:5px;"  v-loading="userloading" :data="users">
+                  <el-table-column label="ID" align="center" prop="userId" />
+                  <el-table-column label="会员头像" align="center" width="80">
+                    <template slot-scope="scope">
+                      <el-popover
+                        placement="right"
+                        title=""
+                        trigger="hover"
+                      >
+                        <img slot="reference" :src="scope.row.avatar" width="50" >
+                        <img :src="scope.row.avatar" style="max-width: 120px;">
+                      </el-popover>
+                    </template>
+                  </el-table-column>
+                  <el-table-column label="昵称" align="center" prop="nickname" />
+                  <el-table-column label="手机号" align="center" prop="phone" />
+                  <el-table-column label="状态" align="center" prop="status" >
+                      <template slot-scope="scope">
+                          <el-tag prop="status" v-for="(item, index) in userStatusOptions"    v-if="scope.row.status==item.dictValue">{{item.dictLabel}}</el-tag>
+                      </template>
+                  </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-form-item label="收货信息" prop="addressId">
+              <el-row  >
+                <el-col >
+                      <el-button plain  type="primary" icon="el-icon-plus"  @click="handleAddUserAddress()">添加收货地址</el-button>
+                </el-col>
+              </el-row>
+              <el-radio-group v-model="form.addressId" style="width:100%">
+              <el-table border  style="margin-top:5px;"  v-loading="addressloading" :data="address">
+                <el-table-column label="ID" align="center"  >
+                    <template slot-scope="scope">
+                       <el-radio :label="scope.row.id"></el-radio>
+                    </template>
+                </el-table-column>
+                <el-table-column label="收货人姓名" align="center" prop="realName" />
+                <el-table-column label="收货人电话" align="center" prop="phone" />
+                <el-table-column label="地址" align="center" prop="detail" >
+                    <template slot-scope="scope">
+                       {{scope.row.province}} {{scope.row.city}} {{scope.row.district}} {{scope.row.detail}}
+                    </template>
+                </el-table-column>
+              </el-table>
+              </el-radio-group>
+            </el-form-item>
+            <el-form-item label="商品列表" >
+              <el-row  >
+                <el-col >
+                      <el-button plain  type="primary" icon="el-icon-plus" @click="handleAddProduct">添加商品</el-button>
+                </el-col>
+              </el-row>
+              <el-table border :key = "tablekey" width="100%" style="margin-top:5px;"  :data="products">
+                <el-table-column label="商品编号" align="center" prop="barCode" />
+                <el-table-column label="商品图片" align="center" width="100">
+                  <template slot-scope="scope">
+                    <el-popover
+                      placement="right"
+                      title=""
+                      trigger="hover"
+                    >
+                      <img slot="reference" :src="scope.row.image" width="50">
+                      <img :src="scope.row.image" style="max-width: 50px;">
+                    </el-popover>
+                  </template>
+                </el-table-column>
+                <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
+                <el-table-column label="商品规格" align="center" prop="sku" />
+                <el-table-column label="库存" align="center" prop="stock" />
+                <el-table-column label="单价" align="center" prop="price" />
+                <el-table-column label="数量" align="center"  prop="count" width="200px" :key="tablekey">
+                   <template slot-scope="scope">
+                    <div>
+                        <el-input-number v-model="scope.row.count"  @change="handleProductCountChange(scope.row)"  size="mini" :min="1" :max="scope.row.stock"  ></el-input-number>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="小计" align="center" prop="money"   />
+                <el-table-column label="操作" align="center" width="100px" >
+                  <template slot-scope="scope">
+                    <el-button
+                      size="mini"
+                      type="text"
+                      icon="el-icon-delete"
+                      @click="handleDelete(scope.row)"
+                    >删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-row>
+                <el-col>
+                      <span>商品合计:{{products.length}}</span><span style="margin-left:10px;">商品总价:{{totalMoney.toFixed(2)}}</span>
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <el-form-item label="订单类型" prop="orderType">
+              <el-select   v-model="form.orderType" placeholder="请选择订单类型" clearable size="small" >
+              <el-option
+                      v-for="item in orderTypeOptions"
+                      :key="item.dictValue"
+                      :label="item.dictLabel"
+                      :value="item.dictValue"
+                    />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="媒体来源" prop="orderMedium" v-if="orderMediumOptions.length>0">
+              <el-select   v-model="form.orderMedium" placeholder="请选择媒体来源" clearable size="small" >
+              <el-option
+                      v-for="item in orderMediumOptions"
+                      :key="item.dictValue"
+                      :label="item.dictLabel"
+                      :value="item.dictValue"
+                    />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="支付方式" prop="payType">
+              <el-select   v-model="form.payType" placeholder="请选择支付方式" clearable size="small" >
+              <el-option
+                      v-for="item in payTypeOptions"
+                      :key="item.dictValue"
+                      :label="item.dictLabel"
+                      :value="item.dictValue"
+                    />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="改价" prop="payPrice">
+              <el-input-number  v-model="form.payPrice" placeholder="修改商品总价" size="medium" :precision="2" :min="0.01" :step="0.1" />
+            </el-form-item>
+            <el-form-item label="物流代收" prop="amount" v-if="form.payType == '3'">
+              <el-input-number  v-model="form.amount" placeholder="平台支付价格" size="medium" :precision="2" :min="0.01" :step="0.1" />
+            </el-form-item>
+            <el-form-item label="订单备注" prop="mark">
+              <el-input  type="textarea" rows="2" v-model="form.mark" placeholder="" />
+            </el-form-item>
+        </el-form>
+      <div slot="footer" class="dialog-footer" style="float: right; margin-bottom: 20px;">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    <el-dialog :title="product.title" v-if="product.open"  :visible.sync="product.open" width="1000px" append-to-body>
+        <product-select  @selectProduct="selectProduct" />
+    </el-dialog>
+    <el-dialog :title="user.title" v-if="user.open"  :visible.sync="user.open" width="500px" append-to-body>
+        <add-user @addUser="addUser" />
+    </el-dialog>
+    <el-dialog :title="userAddress.title" v-if="userAddress.open"  :visible.sync="userAddress.open" width="800px" append-to-body>
+        <add-user-address ref="addUserAddress"   @addUserAddress="addUserAddress" />
+    </el-dialog>
+    <el-dialog :title="payQr.title" v-if="payQr.open"  :visible.sync="payQr.open" width="240px" append-to-body>
+        <div style="padding-bottom:15px;" >
+            <div  class="qrcode" ref="qrCodeUrl"></div>
+        </div>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import {exportStoreOrderItems, createUserOrder,listStoreOrder, getStoreOrder, delStoreOrder, addStoreOrder, updateStoreOrder, exportStoreOrder } from "@/api/store/storeOrder";
+import { getUserList } from "@/api/users/user";
+import { getAddressList } from "@/api/users/userAddress";
+import { getTcmScheduleList } from "@/api/company/tcmScheduleReport";
+import productOrder from "@/views/store/components/productOrder";
+import productSelect from "@/views/store/components/productSelect";
+import addUser from "@/views/store/components/addUser";
+import addUserAddress from "@/views/store/components/addUserAddress";
+import config from "@/utils/config";
+import QRCode from 'qrcodejs2'
+import { treeselect } from "@/api/company/companyDept";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+export default {
+  components: { Treeselect,productOrder,productSelect,addUser,addUserAddress },
+  name: "StoreOrder",
+  props: {
+    customerId: {
+      type: Number, // 或 Number,根据实际情况选择
+      required: false
+    },
+    userId: {
+      type: Number, // 或 Number,根据实际情况选择
+      required: false
+    }
+  },
+  data() {
+    return {
+      // 部门树选项
+      deptOptions: undefined,
+      // 部门名称
+      deptName: undefined,
+      defaultProps: {
+        children: "children",
+        label: "label",
+      },
+      deliveryPayStatusOptions:[],
+      deliveryStatusOptions:[],
+      dateRange: [],
+      orderTypeOptions:[],
+      orderMediumOptions:[],
+      payTypeOptions:[],
+      payQr:{
+        open:false,
+        title:"付款二维码"
+      },
+      user:{
+        open:false,
+        title:"创建会员"
+      },
+      userAddress:{
+        open:false,
+        title:"创建收货地址"
+      },
+      tablekey:false,
+      totalMoney:0.00,
+      products:[],
+      product:{
+        open:false,
+        title:"商品选择"
+      },
+      phone:null,
+      address:[],
+      addressloading: false,
+      userloading: false,
+      users:[],
+      userStatusOptions:[],
+      show:{
+        open:false,
+        title:"订单详情"
+      },
+      activeName:"00",
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      storeOrderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      createTimeRange:[],
+      payTimeRange:[],
+      deliveryImportTimeRange:[],
+      scheduleOptions:[],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        orderCode: null,
+        extendOrderId: null,
+        userId: null,
+        realName: null,
+        userPhone: null,
+        userAddress: null,
+        cartId: null,
+        freightPrice: null,
+        totalNum: null,
+        totalPrice: null,
+        totalPostage: null,
+        payPrice: null,
+        payPostage: null,
+        deductionPrice: null,
+        couponId: null,
+        couponPrice: null,
+        paid: null,
+        payTime: null,
+        payType: null,
+        status: null,
+        refundStatus: null,
+        refundReasonWapImg: null,
+        refundReasonWapExplain: null,
+        refundReasonTime: null,
+        refundReasonWap: null,
+        refundReason: null,
+        refundPrice: null,
+        deliverySn: null,
+        deliveryName: null,
+        deliveryType: null,
+        deliveryId: null,
+        gainIntegral: null,
+        useIntegral: null,
+        payIntegral: null,
+        backIntegral: null,
+        mark: null,
+        isDel: null,
+        cost: null,
+        verifyCode: null,
+        storeId: null,
+        shippingType: null,
+        isChannel: null,
+        isRemind: null,
+        isSysDel: null
+      },
+      // 表单参数
+      form: {
+        addressId:null,
+        userId:null,
+        products:[],
+      },
+      // 表单校验
+      rules: {
+        userId: [
+          { required: true, message: "会员信息不能为空", trigger: "submit" }
+        ],
+        addressId: [
+          { required: true, message: "收货信息不能为空", trigger: "submit" }
+        ],
+        products: [
+          { required: true, message: "商品不能为空", trigger: "submit" }
+        ],
+
+      }
+    };
+  },
+  watch: {
+    // 根据名称筛选部门树
+    deptName(val) {
+        this.$refs.tree.filter(val);
+    },
+  },
+  created() {
+    this.getTreeselect();
+    // 媒体来源 如需要则增加字典 
+    this.getDicts("store_order_medium").then((response) => {
+      this.orderMediumOptions = response.data;
+    });
+    this.getDicts("store_order_type").then((response) => {
+      this.orderTypeOptions = response.data;
+    });
+    this.getDicts("store_pay_type").then((response) => {
+      this.payTypeOptions = response.data;
+    });
+    this.getDicts("user_status").then((response) => {
+      this.userStatusOptions = response.data;
+    });
+    this.getDicts("store_order_status").then((response) => {
+      this.statusOptions = response.data;
+      console.log(response.data)
+    });
+    this.getDicts("store_order_delivery_status").then((response) => {
+      this.deliveryStatusOptions = response.data;
+    });
+    this.getDicts("store_delivery_pay_status").then((response) => {
+      this.deliveryPayStatusOptions = response.data;
+    });
+    getTcmScheduleList().then(response => {
+      this.scheduleOptions = response.data;
+    });
+    this.initUser();
+  },
+  methods: {
+    initUser(){
+      console.log("--------------",this.userId)
+      if(this.userId != null){
+        var data={userId:this.userId}
+        this.userloading = true;
+        this.users=[];
+        this.address=[];
+        getUserList(data).then(response => {
+          this.users = response.data;
+          this.userloading = false;
+          if(this.users!=null&&this.users.length==1){
+            this.form.userId=this.users[0].userId;
+            this.getAddressList(this.form.userId)
+          }
+        });
+      }
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+      treeselect().then((response) => {
+        this.deptOptions = response.data;
+      });
+    },
+    // 筛选节点
+    filterNode(value, data) {
+      if (!value) return true;
+      return data.label.indexOf(value) !== -1;
+    },
+    // 节点单击事件
+    handleNodeClick(data) {
+      this.queryParams.deptId = data.id;
+      this.getList();
+    },
+    handleGenPayUrl(row){
+      this.payQr.open=true;
+      setTimeout(() => {
+        var qrcode = new QRCode(this.$refs.qrCodeUrl, {
+            text: config.payQRUrl+row.id, // 需要转换为二维码的内容
+            width: 200,
+            height: 200,
+            colorDark: '#000000',
+            colorLight: '#ffffff',
+            correctLevel: QRCode.CorrectLevel.H
+        })
+      }, 200);
+
+
+    },
+    handleAddUser(){
+      this.user.open=true;
+    },
+    handleAddUserAddress(){
+      if(this.form.userId==null){
+        this.msgError("请选择会员");
+        return;
+      }
+      this.userAddress.open=true;
+      setTimeout(() => {
+        this.$refs.addUserAddress.init(this.form.userId);
+      }, 500);
+    },
+    addUserAddress(){
+      this.userAddress.open=false;
+      //获取地址
+      this.getAddressList(this.form.userId);
+    },
+    addUser(){
+      this.user.open=false;
+    },
+
+    compute(){
+      this.totalMoney=0;
+      var that=this;
+      this.products.forEach (function (value) {
+          that.totalMoney += value.money;
+      });
+      console.log(that.totalMoney)
+    },
+    handleProductCountChange(row){
+      this.tablekey = !this.tablekey
+      console.log(row)
+      row.money=row.count*row.price;
+      this.$forceUpdate();
+      this.compute();
+    },
+    selectProduct(row){
+      console.log(row);
+      for(var i=0;i<this.products.length;i++){
+        if(this.products[i].id==row.id){
+          return;
+        }
+      }
+      row.count=1;
+      row.money=row.count*row.price;
+      this.products.push(row);
+      this.$message.success("商品"+ row.productName + "添加成功")
+      this.compute();
+    },
+    handleAddProduct(){
+      this.product.open=true;
+    },
+    searchUser(){
+      if(this.phone==null||this.phone==""){
+        return;
+      }
+      var data={phone:this.phone}
+      this.userloading = true;
+      this.users=[];
+      this.address=[];
+      getUserList(data).then(response => {
+        this.users = response.data;
+        this.userloading = false;
+        if(this.users!=null&&this.users.length==1){
+          this.form.userId=this.users[0].userId;
+          this.getAddressList(this.form.userId)
+        }
+      });
+    },
+    getAddressList(userId){
+      var data={userId:userId}
+      this.addressloading = true;
+      this.address=[];
+      getAddressList(data).then(response => {
+        this.address = response.data;
+        this.addressloading = false;
+      });
+    },
+    handleDetails(row){
+      this.show.open=true;
+      const orderId = row.id ;
+      setTimeout(() => {
+        this.$refs.order.getOrder(orderId);
+      }, 500);
+    },
+    handleClick(tab, event) {
+       if(tab.name=="all"){
+        this.queryParams.status==null;
+      }
+      else{
+         this.queryParams.status=tab.name;
+      }
+      this.getList();
+    },
+    /** 查询订单列表 */
+    getList() {
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      this.loading = true;
+      listStoreOrder(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+        this.storeOrderList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+      this.$emit("closePackage")
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        addressId:null,
+        userId:null,
+        products:null,
+
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "创建订单";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getStoreOrder(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改订单";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if(this.products.length==0){
+          this.msgError("请选择商品");
+          return;
+        }
+        this.form.products=this.products;
+        if (valid) {
+          console.log(this.form);
+          this.form.customerId = this.customerId;
+          createUserOrder(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("创建成功");
+
+              this.$emit("closePackage")
+            }
+          });
+
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+       this.products.splice(this.products.findIndex(item => item.id === row.id), 1)
+       this.compute();
+
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange);
+      this.$confirm('是否确认导出所有订单数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportStoreOrder(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    },
+    handleExportItems() {
+      if(this.queryParams.status=='00'){
+        this.queryParams.status=null;
+      }
+      if(this.createTimeRange!=null&&this.createTimeRange.length==2){
+        this.queryParams.createTimeRange=this.createTimeRange[0]+"--"+this.createTimeRange[1]
+      }
+      else{
+        this.queryParams.createTimeRange=null;
+      }
+      if(this.payTimeRange!=null&&this.payTimeRange.length==2){
+        this.queryParams.payTimeRange=this.payTimeRange[0]+"--"+this.payTimeRange[1]
+      }
+      else{
+        this.queryParams.payTimeRange=null;
+      }
+      if(this.deliveryImportTimeRange!=null&&this.deliveryImportTimeRange.length==2){
+        this.queryParams.deliveryImportTimeRange=this.deliveryImportTimeRange[0]+"--"+this.deliveryImportTimeRange[1]
+      }
+      else{
+        this.queryParams.deliveryImportTimeRange=null;
+      }
+      const queryParams = this.addDateRange(this.queryParams, this.dateRange);
+      this.$confirm('是否确认导出所有订单明细数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportStoreOrderItems(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        }).catch(function() {});
+    }
+  }
+};
+</script>
+<style scoped lang="scss">
+.items{
+  margin: 5px 0px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-start;
+  .pic{
+    width:60px;
+    height:60px;
+  }
+  .goods-content{
+    margin-left: 10px;
+    max-width: 200px;
+    text-align: left;
+    .goods-title{
+
+      overflow:hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      -o-text-overflow:ellipsis;
+    }
+  }
+}
+.el-message-box__message p{
+  max-height: 400px;
+  overflow:scroll;
+}
+.import-msg{
+  height: 500px;
+  overflow: auto;
+}
+</style>
+<style>
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+
+</style>

+ 313 - 0
src/views/store/components/addOrderOffline.vue

@@ -0,0 +1,313 @@
+<template>
+  <div class="app-container">
+        <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+           <el-form-item label="客户信息" prop="crmId">
+                <el-row  >
+                  <el-col >
+                    <el-input placeholder="请输入客户手机号" clearable style="width:240px;cursor:pointer" v-model="phone">
+                    </el-input>
+                    <el-button plain style="margin-left:10px;"    @click="searchUser()">查询</el-button>
+                  </el-col>
+                </el-row>
+                <el-table border style="margin-top:5px;"  v-loading="userloading" :data="users">
+                  <el-table-column label="ID" align="center" prop="customerId" />
+                  <el-table-column label="客户编码" align="center" prop="customerCode" />
+                  <el-table-column label="客户名称" align="center" prop="customerName" />
+                  <el-table-column label="手机号" align="center" prop="mobile" />
+                  <el-table-column  label="客户来源" align="center" prop="source">
+                    <template slot-scope="scope">
+                      <el-tag prop="status" v-for="(item, index) in sourceOptions"    v-if="scope.row.source==item.dictValue">{{item.dictLabel}}</el-tag>
+                    </template>
+                  </el-table-column>
+                </el-table>
+            </el-form-item>
+            <el-form-item label="商品列表" >
+              <el-row  >
+                <el-col >
+                      <el-button plain  type="primary" icon="el-icon-plus" @click="handleAddProduct">添加商品</el-button>
+                </el-col>
+              </el-row>
+              <el-table border :key = "tablekey" width="100%" style="margin-top:5px;"  :data="products">
+                <el-table-column label="商品编号" align="center" prop="barCode" />
+                <el-table-column label="商品图片" align="center" width="100">
+                  <template slot-scope="scope">
+                    <el-popover
+                      placement="right"
+                      title=""
+                      trigger="hover"
+                    >
+                      <img slot="reference" :src="scope.row.image" width="50">
+                      <img :src="scope.row.image" style="max-width: 50px;">
+                    </el-popover>
+                  </template>
+                </el-table-column>
+                <el-table-column label="商品名称" show-overflow-tooltip align="center" prop="productName" />
+                <el-table-column label="商品规格" align="center" prop="sku" />
+                <el-table-column label="单价" align="center" prop="price" />
+                <el-table-column label="数量" align="center"  prop="count" width="200px" :key="tablekey">
+                   <template slot-scope="scope">
+                    <div>
+                        <el-input-number v-model="scope.row.count"  @change="handleProductCountChange(scope.row)"  size="mini" :min="1"   ></el-input-number>
+                    </div>
+                  </template>
+                </el-table-column>
+                <el-table-column label="小计" align="center" prop="money"   />
+                <el-table-column label="操作" align="center" width="100px" >
+                  <template slot-scope="scope">
+                    <el-button
+                      size="mini"
+                      type="text"
+                      icon="el-icon-delete"
+                      @click="handleDelete(scope.row)"
+                    >删除</el-button>
+                  </template>
+                </el-table-column>
+              </el-table>
+              <el-row>
+                <el-col>
+                      <span>商品合计:{{products.length}}</span><span style="margin-left:10px;">商品总价:{{totalMoney.toFixed(2)}}</span>
+                </el-col>
+              </el-row>
+            </el-form-item>
+            <el-form-item label="核实业务员" prop="uploadUserId">
+              <el-select style="width:220px" v-model="form.uploadUserId" placeholder="请选择" clearable size="small" >
+                <el-option
+                  v-for="item in salesmanList"
+                  :key="item.dictValue"
+                  :label="item.dictLabel"
+                  :value="item.dictValue"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="价格" prop="payPrice">
+              <el-input-number v-model="form.payPrice"  size="mini"    ></el-input-number>
+            </el-form-item>
+            <el-form-item label="订单备注" prop="remark">
+              <el-input  type="textarea" rows="2" v-model="form.remark" placeholder="" />
+            </el-form-item>
+        </el-form>
+      <div slot="footer" class="dialog-footer" style="float: right; margin-bottom: 20px;">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    <el-dialog :title="product.title" v-if="product.open"  :visible.sync="product.open" width="1000px" append-to-body>
+        <product-select  @selectProduct="selectProduct" />
+    </el-dialog>
+
+
+  </div>
+</template>
+
+<script>
+import { getMyCustomerList,recover,exportCustomer  } from "@/api/crm/customer";
+import {createOrder} from "@/api/store/storeOrderOffline";
+import { getSalesman } from "@/api/company/companyUser";
+
+
+import productSelect from "@/views/store/components/productSelect";
+
+export default {
+  components: { productSelect },
+  name: "AddOrderOffline",
+  data() {
+    return {
+      salesmanList:[],
+      tablekey:false,
+      totalMoney:0.00,
+      products:[],
+      product:{
+        open:false,
+        title:"商品选择"
+      },
+      phone:null,
+
+      userloading: false,
+      users:[],
+      sourceOptions:[],
+      userStatusOptions:[],
+      statusOptions:[],
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 订单表格数据
+      storeOrderList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+
+
+      // 表单参数
+      form: {
+        crmId:null,
+        uploadUserId:null,
+        products:[],
+      },
+      // 表单校验
+      rules: {
+        crmId: [
+          { required: true, message: "客户信息不能为空", trigger: "submit" }
+        ],
+        uploadUserId: [
+          { required: true, message: "核实业务员不能为空", trigger: "blur" }
+        ],
+
+        products: [
+          { required: true, message: "商品不能为空", trigger: "submit" }
+        ],
+
+      }
+    };
+  },
+  created() {
+    this.getDicts("crm_customer_source").then((response) => {
+      this.sourceOptions = response.data;
+    });
+    getSalesman().then((response) => {
+      this.salesmanList = response.data;
+    });
+  },
+  methods: {
+    handleAddProduct(){
+      this.product.open=true;
+    },
+    compute(){
+      this.totalMoney=0;
+      var that=this;
+      this.products.forEach (function (value) {
+          that.totalMoney += value.money;
+      });
+      console.log(that.totalMoney)
+    },
+    handleProductCountChange(row){
+      this.tablekey = !this.tablekey
+      console.log(row)
+      row.money=row.count*row.price;
+      this.$forceUpdate();
+      this.compute();
+    },
+    selectProduct(row){
+      console.log(row);
+      for(var i=0;i<this.products.length;i++){
+        if(this.products[i].id===row.id){
+          this.$message.warning("商品已存在")
+          return;
+        }
+      }
+      row.count=1;
+      row.money=row.count*row.price;
+      this.products.push(row);
+      this.compute();
+      this.$message.success("商品添加成功")
+    },
+
+    searchUser(crmId){
+      if(this.phone==null||this.phone===""){
+        return;
+      }
+      var data={mobile:this.phone}
+      this.userloading = true;
+      this.users=[];
+      getMyCustomerList(data).then(response => {
+        this.users = response.rows;
+        this.userloading = false;
+        if(this.users!=null&&this.users.length===1){
+          this.form.crmId=this.users[0].customerId;
+        }
+      });
+    },
+
+    // 取消按钮
+    cancel() {
+      this.$emit("closeOrderOffline")
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+
+        userId:null,
+        products:null,
+
+      };
+      this.resetForm("form");
+    },
+
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if(this.products.length==0){
+          this.msgError("请选择商品");
+          return;
+        }
+        this.form.products=this.products;
+        if (valid) {
+          console.log(this.form);
+          createOrder(this.form).then(response => {
+            if (response.code === 200) {
+              this.msgSuccess("创建成功");
+              this.$emit("closeOrderOffline")
+            }
+          });
+
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+       this.products.splice(this.products.findIndex(item => item.id === row.id), 1)
+       this.compute();
+
+    },
+
+  }
+};
+</script>
+<style scoped lang="scss">
+.items{
+  margin: 5px 0px;
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+  justify-content: flex-start;
+  .pic{
+    width:60px;
+    height:60px;
+  }
+  .goods-content{
+    margin-left: 10px;
+    max-width: 200px;
+    text-align: left;
+    .goods-title{
+
+      overflow:hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+      -o-text-overflow:ellipsis;
+    }
+  }
+}
+.el-message-box__message p{
+  max-height: 400px;
+  overflow:scroll;
+}
+.import-msg{
+  height: 500px;
+  overflow: auto;
+}
+</style>
+<style>
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+
+</style>

+ 152 - 0
src/views/store/components/couponDetails.vue

@@ -0,0 +1,152 @@
+<template>
+    <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
+      <div style="padding: 20px; background-color: #fff;">
+         优惠劵详情
+      </div>
+<div class="contentx" v-if="item!=null">
+        <div class="desct"> 优惠劵信息</div>
+        <el-descriptions title="" :column="3" border>
+          <el-descriptions-item label="标题"><span v-if="item!=null">{{item.title}}</span></el-descriptions-item>
+          <el-descriptions-item label="面额"><span v-if="item!=null">{{item.price}}</span></el-descriptions-item>
+          <el-descriptions-item label="数量"><span v-if="item!=null">{{item.number}}</span></el-descriptions-item>
+           <el-descriptions-item label="卷类型"><span v-if="item!=null">{{item.couponType}}</span></el-descriptions-item>
+          <el-descriptions-item label="最低消费金额可用"><span v-if="item!=null">{{item.minPrice}}</span></el-descriptions-item>
+          <el-descriptions-item label="剩余数量"><span v-if="item!=null">{{item.remainNumber}}</span></el-descriptions-item>
+          <el-descriptions-item label="有效期"><span v-if="item!=null">{{item.limitTime}}</span></el-descriptions-item>
+          <el-descriptions-item label="状态"><span v-if="item!=null"> <dict-tag :options="statusOptions" :value="item.status"/></span></el-descriptions-item>
+          <el-descriptions-item label="卷类型"><span v-if="item!=null"> <dict-tag :options="couponTypeOptions" :value="item.couponType"/></span></el-descriptions-item>
+        </el-descriptions>
+    </div>
+    <div class="contentx" v-if="item!=null">
+            <div class="desct"> 优惠劵领取信息</div>
+            <el-tabs type="card" v-model="actName" @tab-click="handleClickX">
+              <el-tab-pane label="全部" name="10"></el-tab-pane>
+              <el-tab-pane v-for="(item,index) in couponStatusOptions" :label="item.dictLabel" :name="item.dictValue"></el-tab-pane>
+            </el-tabs>
+            <el-table v-loading="loading" :data="userCouponList">
+              <el-table-column label="券号" align="center" prop="couponCode" />
+              <el-table-column label="会员昵称" align="center" prop="nickName" />
+             <!-- <el-table-column label="会员电话" align="center" prop="phone" /> -->
+              <el-table-column label="关联订单ID" align="center" prop="businessId" />
+              <el-table-column label="订单类型" align="center" prop="businessType">
+                <template slot-scope="scope">
+                  <dict-tag :options="businessTypeOptions" :value="scope.row.businessType"/>
+                </template>
+              </el-table-column>
+              <el-table-column label="状态" align="center" prop="status">
+                <template slot-scope="scope">
+                  <dict-tag :options="couponStatusOptions" :value="scope.row.status"/>
+                </template>
+              </el-table-column>
+              <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
+              <el-table-column label="使用时间" align="center" prop="useTime" width="180"/>
+            </el-table>
+
+            <pagination
+              v-show="total>0"
+              :total="total"
+              :page.sync="queryParams.pageNum"
+              :limit.sync="queryParams.pageSize"
+              @pagination="getList"
+            />
+        </div>
+
+    </div>
+</template>
+
+<script>
+import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon, exportCoupon } from "@/api/store/coupon";
+import { getListUserCoupon } from "@/api/store/userCoupon";
+  export default {
+    name: "coupon",
+    props:["data"],
+    data() {
+      return {
+        actName:"10",
+        couponId:null,
+        item:null,
+        statusOptions: [],
+        couponTypeOptions: [],
+        businessTypeOptions:[],
+        couponStatusOptions:[],
+        total: 0,
+        loading: true,
+        // 会员优惠券表格数据
+        userCouponList: [],
+        queryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          couponId: null,
+        },
+      }
+    },
+    created() {
+      this.getDicts("sys_coupon_type").then(response => {
+        this.couponTypeOptions = response.data;
+      });
+      this.getDicts("sys_coupon_business_type").then(response => {
+        this.businessTypeOptions = response.data;
+      });
+      this.getDicts("sys_company_status").then(response => {
+        this.statusOptions = response.data;
+      });
+      this.getDicts("sys_coupon_status").then(response => {
+        this.couponStatusOptions = response.data;
+      });
+    },
+    methods: {
+      getList() {
+        this.loading = true;
+        getListUserCoupon(this.queryParams).then(response => {
+          this.userCouponList = response.rows;
+          this.total = response.total;
+          this.loading = false;
+        });
+      },
+      handleClickX(tab, event) {
+       if(tab.name=="10"){
+         this.queryParams.status=null;
+       }else{
+         this.queryParams.status=tab.name;
+       }
+          this.queryParams.pageNum = 1;
+          this.couponId = this.queryParams.couponId;
+          this.getList();
+
+      },
+      getDetails(orderId) {
+        this.item=null;
+        this.couponId = orderId;
+        getCoupon(orderId).then(response => {
+            this.item = response.data;
+            this.queryParams.couponId = orderId;
+            this.getList();
+        });
+      },
+    }
+  }
+</script>
+<style>
+  .contentx{
+      height: 100%;
+      background-color: #fff;
+      padding: 0px 20px 20px;
+
+
+      margin: 20px;
+  }
+  .el-descriptions-item__label.is-bordered-label{
+    font-weight: normal;
+  }
+  .el-descriptions-item__content {
+    max-width: 150px;
+    min-width: 100px;
+  }
+  .desct{
+      padding-top: 20px;
+      padding-bottom: 20px;
+      color: #524b4a;
+      font-weight: bold;
+    }
+
+</style>

+ 568 - 0
src/views/store/coupon/index.vue

@@ -0,0 +1,568 @@
+<template>
+  <div class="app-container">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="标题" prop="title">
+        <el-input
+          v-model="queryParams.title"
+          placeholder="请输入标题"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+       <el-form-item label="有效期" prop="limitTime">
+                 <el-date-picker v-model="limitTime" size="small" style="width: 220px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="change"></el-date-picker>
+       </el-form-item>
+      <el-form-item label="券类型" prop="couponType">
+        <el-select v-model="queryParams.couponType" placeholder="请选择券类型" clearable size="small">
+          <el-option
+            v-for="dict in couponTypeOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="面额" prop="price">
+        <el-input
+          v-model="queryParams.price"
+          placeholder="请输入面额"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <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="['his:coupon:add']"
+        >新增</el-button>
+      </el-col> -->
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="success"
+          plain
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['his:coupon:edit']"
+        >修改</el-button>
+      </el-col> -->
+      <!-- <el-col :span="1.5">
+        <el-button
+          type="danger"
+          plain
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['his:coupon:remove']"
+        >删除</el-button>
+      </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['his:coupon:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" border :data="couponList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="优惠券名称" align="center" prop="title" width="120px"/>
+      <el-table-column label="面额" align="center" prop="price" />
+      <el-table-column label="折扣" align="center" prop="rate" />
+      <el-table-column label="数量" align="center" prop="number" />
+      <el-table-column label="卷类型 " align="center" prop="couponType" width="120px">
+        <template slot-scope="scope">
+          <dict-tag :options="couponTypeOptions" :value="scope.row.couponType"/>
+        </template>
+      </el-table-column>
+     <el-table-column label="状态" align="center" prop="status">
+       <template slot-scope="scope">
+         <dict-tag :options="statusOptions" :value="scope.row.status"/>
+       </template>
+     </el-table-column>
+      <el-table-column label="最低消费金额可用" align="center" prop="minPrice" />
+      <el-table-column label="剩余数量" align="center" prop="remainNumber" />
+      <el-table-column label="有效期" align="center" prop="limitTime" width="180"/>
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
+      <el-table-column label="更改时间" align="center" prop="updateTime" width="180"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="150px">
+        <template slot-scope="scope">
+          <!-- <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['his:coupon:edit']"
+          >修改</el-button> -->
+          <el-button
+               size="mini"
+               type="text"
+               @click="handledetails(scope.row)"
+           >详情
+           
+          </el-button>
+          <!-- <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['his:coupon:remove']"
+          >删除</el-button> -->
+
+         <el-button
+               size="mini"
+               type="text"
+               @click="send(scope.row)"
+               v-hasPermi="['his:userCoupon:send']"
+           >发送优惠劵
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+<el-dialog title="发送优惠劵" :visible.sync="openSend" width="500px" append-to-body>
+      <el-form ref="formSend"  label-width="100px">
+
+        <el-form-item label="优惠券名称" prop="title">
+          <div style="margin-left: 20px;font-weight: bold;">    {{sendForm.title}}</div>
+
+        </el-form-item>
+        <el-form-item label="面额" prop="price" v-if="form.couponType==1">
+          <div style="margin-left: 20px;font-weight: bold;">   {{sendForm.price}}</div>
+        </el-form-item>
+        <el-form-item label="搜索用户" >
+          <el-input placeholder="输入电话号码查询用户" v-model="phone" class="input-with-select">
+              <el-button slot="append" icon="el-icon-search" @click="selectPhone"></el-button>
+            </el-input>
+        </el-form-item>
+       <el-form-item label="用户" >
+         <el-select v-model="sendForm.userId">
+              <el-option
+                v-for="item in userList"
+                :key="item.name"
+                :label="item.name"
+                :value="item.id">
+              </el-option>
+            </el-select>
+       </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitSendForm">发 送</el-button>
+        <el-button @click="cancelSend">取 消</el-button>
+      </div>
+    </el-dialog>
+    <!-- 添加或修改优惠券对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="700px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="优惠券名称" prop="title">
+          <el-input v-model="form.title" placeholder="请输入优惠券名称" />
+        </el-form-item>
+
+        <el-form-item label="过期时间" prop="limitTime">
+          <el-date-picker clearable size="small"
+            v-model="form.limitTime"
+            type="date"
+            value-format="yyyy-MM-dd"
+            placeholder="选择过期时间">
+          </el-date-picker>
+        </el-form-item>
+
+
+        <el-form-item label="用户可领取数量" prop="limitCount" >
+          <el-input-number v-model="form.limitCount"  :min="1"  label="请输入用户可领取数量"></el-input-number>
+        </el-form-item>
+        <el-form-item label="卷类型" prop="couponType">
+          <el-select v-model="form.couponType" placeholder="请选择卷类型" @change="isShowChange">
+            <el-option
+              v-for="dict in couponTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="可用分类" prop="cateIds" v-show="form.couponType==5||form.couponType==6">
+          <el-select v-model="form.cateIds" multiple placeholder="请选择可用分类">
+            <el-option
+              v-for="dict in cateIdsOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="面额" prop="price" v-if="form.couponType==1||form.couponType==5||form.couponType==6">
+          <el-input-number v-model="form.price"  :min="0"  label="请输入面额"></el-input-number>
+        </el-form-item>
+        <el-form-item label="最低消费" prop="minPrice" v-if="form.couponType==1||form.couponType==5||form.couponType==6">
+           <el-input-number v-model="form.minPrice"  :min="0"  label="请输入最低消费金额可用"></el-input-number>
+        </el-form-item>
+        <el-form-item label="打折百分比" prop="rate" v-if="form.couponType==4">
+          <el-input-number v-model="form.rate"  :min="1" :max="100"  label="请输入折扣百分比"></el-input-number>
+        </el-form-item>
+
+        <el-form-item label="有效期类型" prop="limitType">
+          <el-select v-model="form.limitType" placeholder="请选择有效期类型">
+            <el-option
+              v-for="dict in limitTypeOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="领取后有效期(天)" prop="limitDay" >
+          <el-input-number v-model="form.limitDay"  :min="1"  label="请输入领取后有效期"></el-input-number>
+        </el-form-item>
+        <el-form-item label="数量" prop="number">
+            <el-input-number v-model="form.number"  :min="0"  label="请输入数量"></el-input-number>
+        </el-form-item>
+        <el-form-item label="状态" prop="status">
+          <el-radio-group v-model="form.status">
+                   <el-radio :label="item.dictValue" v-for="item in statusOptions" >{{item.dictLabel}}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+    <el-drawer
+    	:with-header="false"
+            size="75%"
+             :title="show.title" :visible.sync="show.open">
+         <couponDetails  ref="Details" />
+       </el-drawer>
+  </div>
+</template>
+
+<script>
+import { listCoupon, getCoupon, delCoupon, addCoupon, updateCoupon, exportCoupon } from "@/api/store/coupon";
+import { sendCoupon } from "@/api/store/userCoupon";
+import couponDetails from '@/views/store/components/couponDetails.vue';
+import {selectUser} from "@/api/store/user";
+import {getAllCateList} from "@/api/store/packageCate";
+export default {
+  name: "Coupon",
+  components: { couponDetails },
+  data() {
+    return {
+      show:{
+              open:false,
+            },
+      limitTime:[],
+      userList:[],
+      userName: null,
+      // 遮罩层
+      loading: true,
+      phone:null,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 优惠券表格数据
+      couponList: [],
+      statusOptions: [],
+      limitTypeOptions: [],
+      privateTypeOptions: [],
+      diseaseTypeOptions: [],
+      orOptions: [],
+      cateIdsOptions: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      openSend:false,
+      // 卷类型 1代金券 字典
+      couponTypeOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        title: null,
+        limitTime: null,
+        price: null,
+        number: null,
+        couponType: null,
+        minPrice: null,
+        remainNumber: null,
+        sTime:null,
+        eTime:null
+      },
+      sendForm:{
+        title: null,
+        price: null,
+        couponId:null,
+        couponType:null,
+        userId:null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        title: [
+          { required: true, message: "标题不能为空", trigger: "blur" }
+        ],
+        limitTime: [
+          { required: true, message: "有效期不能为空", trigger: "blur" }
+        ],
+        couponType: [
+          { required: true, message: "券类型不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  created() {
+    this.getList();
+    getAllCateList().then(response => {
+      this.diseaseTypeOptions = response.data.diseaseType;
+      this.privateTypeOptions = response.data.privateType;
+    });
+    this.getDicts("sys_coupon_type").then(response => {
+      this.couponTypeOptions = response.data;
+    });
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("sys_coupon_limit_type").then(response => {
+      this.limitTypeOptions = response.data;
+    });
+    this.getDicts("sys_company_or").then(response => {
+      this.orOptions = response.data;
+    });
+
+  },
+  methods: {
+    send(row){
+      this.openSend=true;
+      this.sendForm.userId=null;
+      this.sendForm.couponId=row.couponId;
+      this.sendForm.title=row.title;
+      this.sendForm.price=row.price;
+      this.sendForm.couponType=row.couponType;
+    },
+    selectPhone(){
+        selectUser(this.phone).then(response => {
+          this.userList=response.rows;
+          if(this.userList!=null){
+              this.sendForm.userId=this.userList[0].id;
+          }
+        });
+    },
+    cancelSend(){
+      this.openSend=false;
+    },
+    submitSendForm(row){
+      if(this.sendForm.userId==null){
+        return this.$message('未选择用户');
+      }
+      sendCoupon(this.sendForm).then(response => {
+        this.msgSuccess("发送成功");
+        this.openSend=false;
+        this.getList();
+      });
+
+    },
+    /** 查询优惠券列表 */
+    getList() {
+      this.loading = true;
+      listCoupon(this.queryParams).then(response => {
+        this.couponList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        couponId: null,
+        title: null,
+        createTime: null,
+        limitTime: null,
+        price: null,
+        number: null,
+        couponType: null,
+        minPrice: null,
+        remainNumber: null,
+        status:"1",
+        rate:0,
+        limitDay:1,
+        limitCount:1,
+        limitType:null,
+        cateIds:null,
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+       this.limitTime=null;
+      this.queryParams.sTime=null;
+      this.queryParams.eTime=null;
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.couponId)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    handledetails(row){
+            this.show.open=true;
+            setTimeout(() => {
+                 this.$refs.Details.getDetails(row.couponId);
+            }, 1);
+     },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加优惠券";
+    },
+    isShowChange(){
+      this.form.cateIds=null
+      if(this.form.couponType==5){
+        this.cateIdsOptions=this.privateTypeOptions;
+      }else{
+        this.cateIdsOptions=this.diseaseTypeOptions;
+      }
+
+    },
+
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const couponId = row.couponId || this.ids
+      getCoupon(couponId).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改优惠券";
+        this.form.status=String(this.form.status)
+        this.form.isShow=String(this.form.isShow)
+
+          if(this.form.couponType==5){
+            this.cateIdsOptions=this.privateTypeOptions;
+          }else{
+            this.cateIdsOptions=this.diseaseTypeOptions;
+          }
+          if(this.form.cateIds!=null){
+           this.form.cateIds= JSON.parse(this.form.cateIds)
+          }
+
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if(this.form.cateIds!=null){
+           this.form.cateIds= JSON.stringify(this.form.cateIds)
+          }
+
+          if (this.form.couponId != null) {
+            updateCoupon(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCoupon(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    change(){
+          if(this.limitTime!=null){
+            this.queryParams.sTime=this.limitTime[0];
+            this.queryParams.eTime=this.limitTime[1];
+          }else{
+            this.queryParams.sTime=null;
+            this.queryParams.eTime=null;
+          }
+
+        },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const couponIds = row.couponId || this.ids;
+      this.$confirm('是否确认删除优惠券编号为"' + couponIds + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delCoupon(couponIds);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有优惠券数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportCoupon(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 459 - 0
src/views/store/healthTongue/index.vue

@@ -0,0 +1,459 @@
+<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="phone">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入用户电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="加密号码" prop="phoneMk">
+        <el-input
+          v-model="queryParams.phoneMk"
+          placeholder="请输入用户电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="性别" prop="sex">
+        <el-select v-model="queryParams.sex" placeholder="请选择性别" clearable size="small">
+          <el-option
+            v-for="dict in sexOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['store:healthTongue:export']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="healthTongueList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="用户电话" align="center" prop="phone" />
+      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column label="性别" align="center" prop="sex">
+        <template slot-scope="scope">
+          <dict-tag :options="sexOptions" :value="scope.row.sex"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="年龄" align="center" prop="age" />
+
+      <el-table-column label="体质" align="center" prop="typeName" />
+
+      <el-table-column label="剥苔" align="center" prop="botai" >
+        <template slot-scope="scope">
+          <dict-tag :options="orOptions" :value="scope.row.botai"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="齿痕" align="center" prop="chihen" >
+        <template slot-scope="scope">
+          <dict-tag :options="orOptions" :value="scope.row.chihen"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="裂纹" align="center" prop="liewen">
+        <template slot-scope="scope">
+          <dict-tag :options="orOptions" :value="scope.row.liewen"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="舌脉" align="center" prop="shemianName" />
+
+      <el-table-column label="苔色" align="center" prop="taiseName" />
+
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+             size="mini"
+             type="text"
+             @click="handledetails(scope.row)"
+             >详情
+          </el-button>
+
+
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改舌苔对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="状态" prop="userId">
+          <el-input v-model="form.userId" placeholder="请输入状态" />
+        </el-form-item>
+        <el-form-item label="状态" prop="patientId">
+          <el-input v-model="form.patientId" placeholder="请输入状态" />
+        </el-form-item>
+        <el-form-item label="姓名" prop="name">
+          <el-input v-model="form.name" placeholder="请输入姓名" />
+        </el-form-item>
+        <el-form-item label="性别" prop="sex">
+          <el-select v-model="form.sex" placeholder="请选择性别">
+            <el-option
+              v-for="dict in sexOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="年龄" prop="age">
+          <el-input v-model="form.age" placeholder="请输入年龄" />
+        </el-form-item>
+        <el-form-item label="状态">
+          <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="tongueUrl">
+          <el-input v-model="form.tongueUrl" placeholder="请输入舌苔图片" />
+        </el-form-item>
+        <el-form-item label="舌苔id" prop="tongueId">
+          <el-input v-model="form.tongueId" placeholder="请输入舌苔id" />
+        </el-form-item>
+        <el-form-item label="体质" prop="typeName">
+          <el-input v-model="form.typeName" placeholder="请输入体质" />
+        </el-form-item>
+        <el-form-item label="体质解析" prop="typeJson">
+          <el-input v-model="form.typeJson" placeholder="请输入体质解析" />
+        </el-form-item>
+        <el-form-item label="剥苔" prop="botai">
+          <el-input v-model="form.botai" placeholder="请输入剥苔" />
+        </el-form-item>
+        <el-form-item label="剥苔详细" prop="botaiDesc">
+          <el-input v-model="form.botaiDesc" placeholder="请输入剥苔详细" />
+        </el-form-item>
+        <el-form-item label="齿痕" prop="chihen">
+          <el-input v-model="form.chihen" placeholder="请输入齿痕" />
+        </el-form-item>
+        <el-form-item label="齿痕详细" prop="chihenDesc">
+          <el-input v-model="form.chihenDesc" placeholder="请输入齿痕详细" />
+        </el-form-item>
+        <el-form-item label="裂纹" prop="liewen">
+          <el-input v-model="form.liewen" placeholder="请输入裂纹" />
+        </el-form-item>
+        <el-form-item label="裂纹详细" prop="liewenDesc">
+          <el-input v-model="form.liewenDesc" placeholder="请输入裂纹详细" />
+        </el-form-item>
+        <el-form-item label="舌脉" prop="shemianName">
+          <el-input v-model="form.shemianName" placeholder="请输入舌脉" />
+        </el-form-item>
+        <el-form-item label="舌脉详细" prop="shemianDesc">
+          <el-input v-model="form.shemianDesc" placeholder="请输入舌脉详细" />
+        </el-form-item>
+        <el-form-item label="苔色" prop="taiseName">
+          <el-input v-model="form.taiseName" placeholder="请输入苔色" />
+        </el-form-item>
+        <el-form-item label="苔色详细" prop="taiseDesc">
+          <el-input v-model="form.taiseDesc" placeholder="请输入苔色详细" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+       <el-drawer
+    	:with-header="false"
+            size="75%"
+             :title="show.title" :visible.sync="show.open">
+         <healthTongueDetails  ref="Details" />
+       </el-drawer>
+
+  </div>
+</template>
+
+<script>
+import { listHealthTongue, getHealthTongue, delHealthTongue, addHealthTongue, updateHealthTongue, exportHealthTongue } from "@/api/store/healthTongue";
+import healthTongueDetails from '../../components/healthTongueDetails.vue';
+export default {
+  name: "HealthTongue",
+  components: { healthTongueDetails },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      show:{
+              title:"详情",
+              open:false,
+            },
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 舌苔表格数据
+      healthTongueList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 性别字典
+      sexOptions: [],
+      // 状态字典
+      statusOptions: [],
+      orOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId:this.userId|| null,
+        patientId: this.$route.query.patientId || null,
+        name: this.$route.query.name || '',
+        sex: this.$route.query.sex || null,
+        age: this.$route.query.age || null,
+        status: null,
+        tongueUrl: null,
+        tongueId: null,
+        typeName: null,
+        typeJson: null,
+        botai: null,
+        botaiDesc: null,
+        chihen: null,
+        chihenDesc: null,
+        liewen: null,
+        phone:null,
+        phoneMk:null,
+        liewenDesc: null,
+        shemianName: null,
+        shemianDesc: null,
+        taiseName: null,
+        taiseDesc: null,
+      },
+      props: {
+        userId: {  // 通过路由params接收
+          type: [String, Number],
+          required: true
+        }
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+    };
+  },
+  created() {
+    if (!this.queryParams.userId && this.$route.params.userId) {
+      this.queryParams.userId = this.$route.params.userId;
+    }
+    this.loadData()
+
+    this.getList();
+    this.getDicts("sys_sex").then(response => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("sys_company_or").then(response => {
+      this.orOptions = response.data;
+    });
+
+  },
+  watch: {
+    // 监听路由变化,当参数变化时重新加载数据
+    '$route'(to, from) {
+      if (to.params.userId !== from.params.userId) {
+        this.queryParams = {
+          ...this.queryParams,
+          userId: to.params.userId || this.userId,  // 关键点
+        }
+        this.loadData()
+      }
+    }
+  },
+  methods: {
+    loadData() {
+      this.loading = true;
+      listHealthTongue(this.queryParams).then(response => {
+        this.healthTongueList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    /** 查询舌苔列表 */
+    getList() {
+      this.loading = true;
+      listHealthTongue(this.queryParams).then(response => {
+        this.healthTongueList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    handledetails(row){
+            this.show.open=true;
+            setTimeout(() => {
+                 this.$refs.Details.getDetails(row.id);
+            }, 1);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        userId: null,
+        patientId: null,
+        name: null,
+        sex: null,
+        age: null,
+        status: 0,
+        tongueUrl: null,
+        tongueId: null,
+        typeName: null,
+        typeJson: null,
+        botai: null,
+        botaiDesc: null,
+        chihen: null,
+        chihenDesc: null,
+        liewen: null,
+        liewenDesc: null,
+        shemianName: null,
+        shemianDesc: null,
+        taiseName: null,
+        taiseDesc: null,
+        createTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加舌苔";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getHealthTongue(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) {
+            updateHealthTongue(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addHealthTongue(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除舌苔编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delHealthTongue(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有舌苔数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return exportHealthTongue(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 428 - 0
src/views/store/myHealthTongue/index.vue

@@ -0,0 +1,428 @@
+<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="phone">
+        <el-input
+          v-model="queryParams.phone"
+          placeholder="请输入用户电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="加密号码" prop="phoneMk">
+        <el-input
+          v-model="queryParams.phoneMk"
+          placeholder="请输入用户电话"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="性别" prop="sex">
+        <el-select v-model="queryParams.sex" placeholder="请选择性别" clearable size="small">
+          <el-option
+            v-for="dict in sexOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportLoading"
+          @click="handleExport"
+          v-hasPermi="['store:healthTongue:myExport']"
+        >导出</el-button>
+      </el-col>
+      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="healthTongueList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="用户电话" align="center" prop="phone" />
+      <el-table-column label="姓名" align="center" prop="name" />
+      <el-table-column label="性别" align="center" prop="sex">
+        <template slot-scope="scope">
+          <dict-tag :options="sexOptions" :value="scope.row.sex"/>
+        </template>
+      </el-table-column>
+      <el-table-column label="年龄" align="center" prop="age" />
+
+      <el-table-column label="体质" align="center" prop="typeName" />
+
+      <el-table-column label="剥苔" align="center" prop="botai" >
+        <template slot-scope="scope">
+          <dict-tag :options="orOptions" :value="scope.row.botai"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="齿痕" align="center" prop="chihen" >
+        <template slot-scope="scope">
+          <dict-tag :options="orOptions" :value="scope.row.chihen"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="裂纹" align="center" prop="liewen">
+        <template slot-scope="scope">
+          <dict-tag :options="orOptions" :value="scope.row.liewen"/>
+        </template>
+      </el-table-column>
+
+      <el-table-column label="舌脉" align="center" prop="shemianName" />
+
+      <el-table-column label="苔色" align="center" prop="taiseName" />
+
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+             size="mini"
+             type="text"
+             @click="handledetails(scope.row)"
+             >详情
+          </el-button>
+
+
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改舌苔对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="状态" prop="userId">
+          <el-input v-model="form.userId" placeholder="请输入状态" />
+        </el-form-item>
+        <el-form-item label="状态" prop="patientId">
+          <el-input v-model="form.patientId" placeholder="请输入状态" />
+        </el-form-item>
+        <el-form-item label="姓名" prop="name">
+          <el-input v-model="form.name" placeholder="请输入姓名" />
+        </el-form-item>
+        <el-form-item label="性别" prop="sex">
+          <el-select v-model="form.sex" placeholder="请选择性别">
+            <el-option
+              v-for="dict in sexOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="parseInt(dict.dictValue)"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="年龄" prop="age">
+          <el-input v-model="form.age" placeholder="请输入年龄" />
+        </el-form-item>
+        <el-form-item label="状态">
+          <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="tongueUrl">
+          <el-input v-model="form.tongueUrl" placeholder="请输入舌苔图片" />
+        </el-form-item>
+        <el-form-item label="舌苔id" prop="tongueId">
+          <el-input v-model="form.tongueId" placeholder="请输入舌苔id" />
+        </el-form-item>
+        <el-form-item label="体质" prop="typeName">
+          <el-input v-model="form.typeName" placeholder="请输入体质" />
+        </el-form-item>
+        <el-form-item label="体质解析" prop="typeJson">
+          <el-input v-model="form.typeJson" placeholder="请输入体质解析" />
+        </el-form-item>
+        <el-form-item label="剥苔" prop="botai">
+          <el-input v-model="form.botai" placeholder="请输入剥苔" />
+        </el-form-item>
+        <el-form-item label="剥苔详细" prop="botaiDesc">
+          <el-input v-model="form.botaiDesc" placeholder="请输入剥苔详细" />
+        </el-form-item>
+        <el-form-item label="齿痕" prop="chihen">
+          <el-input v-model="form.chihen" placeholder="请输入齿痕" />
+        </el-form-item>
+        <el-form-item label="齿痕详细" prop="chihenDesc">
+          <el-input v-model="form.chihenDesc" placeholder="请输入齿痕详细" />
+        </el-form-item>
+        <el-form-item label="裂纹" prop="liewen">
+          <el-input v-model="form.liewen" placeholder="请输入裂纹" />
+        </el-form-item>
+        <el-form-item label="裂纹详细" prop="liewenDesc">
+          <el-input v-model="form.liewenDesc" placeholder="请输入裂纹详细" />
+        </el-form-item>
+        <el-form-item label="舌脉" prop="shemianName">
+          <el-input v-model="form.shemianName" placeholder="请输入舌脉" />
+        </el-form-item>
+        <el-form-item label="舌脉详细" prop="shemianDesc">
+          <el-input v-model="form.shemianDesc" placeholder="请输入舌脉详细" />
+        </el-form-item>
+        <el-form-item label="苔色" prop="taiseName">
+          <el-input v-model="form.taiseName" placeholder="请输入苔色" />
+        </el-form-item>
+        <el-form-item label="苔色详细" prop="taiseDesc">
+          <el-input v-model="form.taiseDesc" placeholder="请输入苔色详细" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+
+       <el-drawer
+    	:with-header="false"
+            size="75%"
+             :title="show.title" :visible.sync="show.open">
+         <healthTongueDetails  ref="Details" />
+       </el-drawer>
+
+  </div>
+</template>
+
+<script>
+import { myListHealthTongue, getHealthTongue, delHealthTongue, addHealthTongue, updateHealthTongue, myExportHealthTongue } from "@/api/store/healthTongue";
+import healthTongueDetails from '../../components/healthTongueDetails.vue';
+export default {
+  name: "HealthTongue",
+  components: { healthTongueDetails },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 导出遮罩层
+      exportLoading: false,
+      // 选中数组
+      ids: [],
+      show:{
+              title:"详情",
+              open:false,
+            },
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 舌苔表格数据
+      healthTongueList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 性别字典
+      sexOptions: [],
+      // 状态字典
+      statusOptions: [],
+      orOptions: [],
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        userId: null,
+        patientId: null,
+        name: null,
+        sex: null,
+        age: null,
+        status: null,
+        tongueUrl: null,
+        tongueId: null,
+        typeName: null,
+        typeJson: null,
+        botai: null,
+        botaiDesc: null,
+        chihen: null,
+        chihenDesc: null,
+        liewen: null,
+        phone:null,
+        phoneMk:null,
+        liewenDesc: null,
+        shemianName: null,
+        shemianDesc: null,
+        taiseName: null,
+        taiseDesc: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      }
+    };
+  },
+  created() {
+    this.getList();
+    this.getDicts("sys_sex").then(response => {
+      this.sexOptions = response.data;
+    });
+    this.getDicts("sys_company_status").then(response => {
+      this.statusOptions = response.data;
+    });
+    this.getDicts("sys_company_or").then(response => {
+      this.orOptions = response.data;
+    });
+
+  },
+  methods: {
+    /** 查询舌苔列表 */
+    getList() {
+      this.loading = true;
+      myListHealthTongue(this.queryParams).then(response => {
+        this.healthTongueList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    handledetails(row){
+            this.show.open=true;
+            setTimeout(() => {
+                 this.$refs.Details.getDetails(row.id);
+            }, 1);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        userId: null,
+        patientId: null,
+        name: null,
+        sex: null,
+        age: null,
+        status: 0,
+        tongueUrl: null,
+        tongueId: null,
+        typeName: null,
+        typeJson: null,
+        botai: null,
+        botaiDesc: null,
+        chihen: null,
+        chihenDesc: null,
+        liewen: null,
+        liewenDesc: null,
+        shemianName: null,
+        shemianDesc: null,
+        taiseName: null,
+        taiseDesc: null,
+        createTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加舌苔";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getHealthTongue(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) {
+            updateHealthTongue(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addHealthTongue(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除舌苔编号为"' + ids + '"的数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delHealthTongue(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有舌苔数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          this.exportLoading = true;
+          return myExportHealthTongue(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+          this.exportLoading = false;
+        }).catch(() => {});
+    }
+  }
+};
+</script>

+ 38 - 32
src/views/store/package/index.vue

@@ -178,8 +178,13 @@
           <el-input v-model="form.secondName" placeholder="请输入套餐包别名" />
         </el-form-item>
         <el-form-item label="封面图" prop="imgUrl">
-          <el-upload v-model="form.imgUrl" class="avatar-uploader" :action="uploadUrl" :show-file-list="false"
-            :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
+          <el-upload
+            v-model="form.imgUrl"
+            class="avatar-uploader"
+            :action="uploadUrl"
+            :show-file-list="false"
+            :on-success="handleAvatarSuccess"
+            :before-upload="beforeAvatarUpload">
             <img v-if="form.imgUrl" :src="form.imgUrl" class="avatar" width="300px">
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
           </el-upload>
@@ -473,6 +478,7 @@ import Editor from '@/components/Editor/wang';
 import Material from '@/components/Material';
 import { listStore } from "@/api/store/storeProduct";
 import { getAllCateList } from "@/api/store/packageCate";
+import { Loading } from 'element-ui';
 export default {
   name: "Package",
   components: { packageDetails, Editor, productAttrValueSelect, Material },
@@ -680,37 +686,37 @@ export default {
       }
     },
     beforeAvatarUpload(file) {
-      return new Promise((resolve, reject) => {
-        if (file.size / 1024 / 1024 > 3) {
-          this.$message.error('上传的图片不能超过3MB');
-          reject();
-          return;
-        }
-        if (file.size / 1024 > 500) {
-          const loadingInstance = Loading.service({ text: '图片内存过大正在压缩图片...' });
-          // 文件大于1MB时进行压缩
-          this.compressImage(file).then((compressedFile) => {
-            loadingInstance.close();
-            if (compressedFile.size / 1024 > 500) {
-              this.$message.error('图片压缩后仍大于500KB');
-              reject();
-            } else {
-              // this.$message.success(`图片压缩成功,最终质量为: ${this.finalQuality.toFixed(2)}`);
-              console.log(`图片压缩成功,最终质量为: ${this.finalQuality.toFixed(2)}`);
-              console.log(`最终内存大小为: ${(compressedFile.size / 1024).toFixed(2)}KB`);
-              resolve(compressedFile);
-            }
-          }).catch((err) => {
-            loadingInstance.close();
-            console.error(err);
+        return new Promise((resolve, reject) => {
+          if (file.size / 1024 / 1024 > 3) {
+            this.$message.error('上传的图片不能超过3MB');
             reject();
-          });
-        } else {
-          resolve(file);
-        }
-      });
-    },
-    compressImage(file) {
+            return;
+          }
+          if (file.size / 1024 > 500) {
+            const loadingInstance = Loading.service({ text: '图片内存过大正在压缩图片...' });
+            // 文件大于1MB时进行压缩
+            this.compressImage(file).then((compressedFile) => {
+              loadingInstance.close();
+              if (compressedFile.size / 1024 > 500) {
+                this.$message.error('图片压缩后仍大于500KB');
+                reject();
+              } else {
+                // this.$message.success(`图片压缩成功,最终质量为: ${this.finalQuality.toFixed(2)}`);
+                console.log(`图片压缩成功,最终质量为: ${this.finalQuality.toFixed(2)}`);
+                console.log(`最终内存大小为: ${(compressedFile.size/1024).toFixed(2)}KB`);
+                resolve(compressedFile);
+              }
+            }).catch((err) => {
+              loadingInstance.close();
+              console.error(err);
+              reject();
+            });
+          } else {
+            resolve(file);
+          }
+        });
+      },
+      compressImage(file) {
       return new Promise((resolve, reject) => {
         const reader = new FileReader();
         reader.readAsDataURL(file);

Неке датотеке нису приказане због велике количине промена