taskDetail.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
  8. <title>待办任务</title>
  9. <!-- 引入样式文件 -->
  10. <link rel="stylesheet"
  11. href="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012584633/vant.css" />
  12. <!-- 必须先引入vue, 后使用vant-ui -->
  13. <script
  14. src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1742017957144/vue.js"></script>
  15. <!-- 引入vant的组件库-->
  16. <!-- 引入 Vant 的 JS 文件 -->
  17. <script
  18. src="https://wl-1306604067.cos.ap-guangzhou.myqcloud.com/production/ct/103548289110001/1758012748487/vant.min.js"></script>
  19. <script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
  20. <script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
  21. <!-- <script src="js/vconsole.min.js"></script>
  22. <script>
  23. var vConsole = new window.VConsole();
  24. </script> -->
  25. </head>
  26. <style>
  27. body {
  28. margin: 0;
  29. padding: 0;
  30. }
  31. .box {
  32. width: 100vw;
  33. min-height: 100vh;
  34. box-sizing: border-box;
  35. background: #F7F9FC;
  36. }
  37. .page5 {
  38. width: 100vw;
  39. box-sizing: border-box;
  40. padding: 15px 10px;
  41. }
  42. .task_list {}
  43. .task_item {
  44. width: 100%;
  45. background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, #FFFFFF 100%);
  46. border-radius: 15px;
  47. border: 1px solid #FFFFFF;
  48. box-sizing: border-box;
  49. margin-bottom: 15px;
  50. }
  51. .task_item:last-child {
  52. margin-bottom: 0;
  53. }
  54. .task_item_title {
  55. display: flex;
  56. align-items: center;
  57. padding: 15px 15px 0;
  58. }
  59. .task_item_title img {
  60. width: 53px;
  61. height: 53px;
  62. border-radius: 10px;
  63. margin-right: 10px;
  64. }
  65. .task_item_text {
  66. font-weight: 500;
  67. font-size: 16px;
  68. color: #222222;
  69. line-height: 24px;
  70. display: flex;
  71. flex-direction: column;
  72. gap: 8px;
  73. }
  74. .task_item_time {
  75. font-size: 12px;
  76. color: #999999;
  77. line-height: 17px;
  78. }
  79. .client_tag {
  80. display: flex;
  81. align-items: center;
  82. flex-wrap: wrap;
  83. padding: 0 15px 9px;
  84. gap: 8px;
  85. }
  86. .client_tag_title {
  87. font-size: 12px;
  88. color: #999999;
  89. line-height: 17px;
  90. white-space: nowrap;
  91. padding-right: 5px;
  92. }
  93. .client_tag span {
  94. height: 21px;
  95. font-size: 12px;
  96. color: #1677FF;
  97. line-height: 17px;
  98. border-radius: 5px;
  99. padding: 2px 8px;
  100. background: rgba(22, 119, 255, 0.1);
  101. box-sizing: border-box;
  102. white-space: nowrap;
  103. }
  104. .task_item_line {
  105. width: 100%;
  106. height: 1px;
  107. margin: 15px 0 14px;
  108. background: linear-gradient(90deg, rgba(217,219,227,0) 0%, #D9DBE3 49%, rgba(217,219,227,0) 100%);
  109. }
  110. .task_item_des {
  111. display: flex;
  112. align-items: flex-start;
  113. padding: 0 15px 10px;
  114. }
  115. .task_des_title {
  116. font-size: 14px;
  117. color: #222222;
  118. line-height: 20px;
  119. padding-bottom: 17px;
  120. }
  121. .task_des {
  122. font-size: 12px;
  123. color: #999999;
  124. line-height: 18px;
  125. display: -webkit-box;
  126. -webkit-line-clamp: 2;
  127. -webkit-box-orient: vertical;
  128. overflow: hidden;
  129. text-overflow: ellipsis;
  130. }
  131. .task_detail {
  132. padding: 15px 15px 20px;
  133. background: linear-gradient( 180deg, rgba(255,255,255,0.8) 0%, #FFFFFF 100%);
  134. border-radius: 15px;
  135. border: 1px solid #FFFFFF;
  136. margin-bottom: 15px;
  137. }
  138. .task_btn {
  139. width: 100%;
  140. height: 40px;
  141. background: #1677FF;
  142. border-radius: 22px;
  143. font-weight: bold;
  144. font-size: 14px;
  145. color: #FFFFFF;
  146. line-height: 40px;
  147. text-align: center;
  148. margin-top: 25px;
  149. }
  150. .task_detail_con {
  151. display: flex;
  152. flex-wrap: wrap;
  153. justify-content: space-between;
  154. gap: 20px;
  155. }
  156. .task_detail_con_item {
  157. display: flex;
  158. flex-direction: column;
  159. font-size: 12px;
  160. color: #666666;
  161. }
  162. .task_detail_con_data {
  163. font-weight: 500;
  164. font-size: 14px;
  165. color: #136DFB;
  166. line-height: 20px;
  167. padding-top: 10px;
  168. }
  169. .inten_title {
  170. font-weight: 500;
  171. font-size: 14px;
  172. color: #222222;
  173. line-height: 20px;
  174. padding-bottom: 15px;
  175. padding-left: 5px;
  176. position: relative;
  177. display: flex;
  178. align-items: center;
  179. }
  180. .inten_title::after {
  181. position: absolute;
  182. left: 0;
  183. content: '';
  184. width: 2px;
  185. height: 12px;
  186. background: #FF4141;
  187. border-radius: 1px;
  188. }
  189. .ai_title {
  190. font-size: 12px;
  191. color: #666666;
  192. line-height: 17px;
  193. padding-bottom: 10px;
  194. }
  195. .task_ai_des {
  196. font-size: 14px;
  197. color: #222222;
  198. line-height: 23px;
  199. }
  200. .clue_data {
  201. display: flex;
  202. justify-content: space-between;
  203. margin-bottom: 20px;
  204. }
  205. .clue_data_item {
  206. display: flex;
  207. flex-direction: column;
  208. }
  209. .clue_data_time {
  210. font-weight: 500;
  211. font-size: 14px;
  212. color: #136DFB;
  213. line-height: 20px;
  214. }
  215. </style>
  216. <body>
  217. <div id="box" class="box">
  218. <div class="page5">
  219. <!-- 任务详情 -->
  220. <div class="task_item">
  221. <div class="task_item_title">
  222. <img :src="taskData.clientAvatar || '../img/avatar.png'" alt="">
  223. <div class="task_item_text">
  224. <div>{{taskData.clientName}}</div>
  225. <div class="task_item_time">任务时间: {{formatDate(taskData.createdTime)}}</div>
  226. </div>
  227. </div>
  228. <div class="task_item_line"></div>
  229. <div class="client_tag">
  230. <div class="client_tag_title">客户标签:</div>
  231. <span v-for="(item, index) in taskData.clientTags" :key="index">{{item}}</span>
  232. </div>
  233. <!-- <div class="task_item_des">
  234. <div class="task_des_title task_ai">AI分析:</div>
  235. <div class="task_des task_ai_des">{{taskData.analysisReason}}</div>
  236. </div> -->
  237. </div>
  238. <div class="task_detail" v-if="type === 'SELL_PROCESS'">
  239. <div class="task_des_title">{{taskData.sellProcessName}}</div>
  240. <div class="task_detail_con">
  241. <div class="task_detail_con_item">
  242. <div>进入当前阶段:</div>
  243. <div class="task_detail_con_data">{{taskData.sellProcessName}}</div>
  244. </div>
  245. <div class="task_detail_con_item">
  246. <div>停留时间:</div>
  247. <div class="task_detail_con_data">{{taskData.lastContactTime}}</div>
  248. </div>
  249. <div class="task_detail_con_item">
  250. <div>上次联系时间:</div>
  251. <div class="task_detail_con_data">{{taskData.lastContactTime}}</div>
  252. </div>
  253. <div class="task_detail_con_item">
  254. <div>未联系时间:</div>
  255. <div class="task_detail_con_data">{{taskData.lastContactTime}}</div>
  256. </div>
  257. </div>
  258. </div>
  259. <div v-if="type === 'INTENTION_SESSION' && taskData.intentionGroupList && taskData.intentionGroupList.length > 0">
  260. <div class="task_detail" v-for="(item, index) in taskData.intentionGroupList" :key="index">
  261. <div class="inten_title">{{item.nameList[0]}}</div>
  262. <div class="ai_title">AI分析:</div>
  263. <div class="task_ai_des">{{item.reason}}</div>
  264. </div>
  265. </div>
  266. <div class="task_detail" v-if="type === 'SESSION_CLUE'">
  267. <div class="clue_data">
  268. <div class="clue_data_item">
  269. <div class="ai_title">添加企微时间:</div>
  270. <div class="clue_data_time">{{timeFormat(taskData.createdTime)}}</div>
  271. </div>
  272. <div class="clue_data_item">
  273. <div class="ai_title">线索分类:</div>
  274. <div class="clue_data_time">
  275. <span>{{taskData.category}}</span>
  276. <span style="color: #CCCCCC;">—</span>
  277. <span style="color: #7D97BF;">{{taskData.subCategory}}</span></div>
  278. </div>
  279. </div>
  280. <div class="ai_title">线索依据:</div>
  281. <div class="task_ai_des" style="margin-bottom: 20px;">{{taskData.analysisReason}}</div>
  282. <div class="ai_title">AI分析:</div>
  283. <div class="task_ai_des">{{taskData.analysisReason}}</div>
  284. </div>
  285. <div class="task_detail" v-if="type === 'SENTIMENT_SESSION'">
  286. <div class="ai_title">AI情绪分析:</div>
  287. <div class="task_ai_des">{{taskData.sentimentReason}}</div>
  288. </div>
  289. </div>
  290. </div>
  291. </body>
  292. <script>
  293. new Vue({
  294. el: '#box',
  295. data() {
  296. return {
  297. httpUrl: '',
  298. bId: null,
  299. env: '',
  300. taskId: null,
  301. type: null,
  302. taskData: {}
  303. }
  304. },
  305. created() {
  306. this.bId = this.getQueryParam('bId')
  307. this.env = this.getQueryParam('env')
  308. this.taskId = this.getQueryParam('taskId')
  309. this.type = this.getQueryParam('type')
  310. if (!this.env || this.env === 'prod') {
  311. this.httpUrl = 'http://test.wefanbot.com:18993'
  312. } else {
  313. this.httpUrl = 'http://test.wefanbot.com:18993'
  314. }
  315. this.toRead()
  316. this.getDetail()
  317. },
  318. methods: {
  319. toRead() {
  320. fetch(this.httpUrl + `/scrm/v1/wxcp-member-todo-task/p/read?taskId=${this.taskId}`)
  321. .then(res => {
  322. return res.json()
  323. }).then(result => {
  324. let { data, code, msg } = result
  325. if (code === 1) {
  326. } else {
  327. vant.Toast.fail(msg)
  328. }
  329. })
  330. },
  331. getDetail() {
  332. let url = ''
  333. if (this.type === 'SELL_PROCESS') {
  334. // 销售进程
  335. url = `/wxcp/sell-process/p/member/todo-task-info?todoTaskId=${this.taskId}`
  336. } else if (this.type === 'INTENTION_SESSION') {
  337. // 意向客户
  338. url = `/scrm/v1/wxc-intention-session/p/member/todo-task-info?todoTaskId=${this.taskId}`
  339. } else if (this.type === 'SESSION_CLUE') {
  340. // 会话线索
  341. url = `/wxcp/sessionClue/p/member/todo-task-info?todoTaskId=${this.taskId}`
  342. } else if (this.type === 'SENTIMENT_SESSION') {
  343. // 投诉
  344. url = `/scrm/v1/wxc-sentiment-session/p/member/todo-task-info?todoTaskId=${this.taskId}`
  345. }
  346. fetch(this.httpUrl + url)
  347. .then(res => {
  348. return res.json()
  349. }).then(result => {
  350. let { data, code, msg } = result
  351. if (code === 1) {
  352. this.taskData = data
  353. } else {
  354. vant.Toast.fail(msg)
  355. }
  356. })
  357. },
  358. timeFormat(time, format = 'yyyy-MM-dd hh:mm:ss') {
  359. if (time === undefined || time === '' || time === null) {
  360. return '/';
  361. }
  362. const date = new Date(time);
  363. const o = {
  364. 'M+': date.getMonth() + 1, // 月份
  365. 'd+': date.getDate(), // 日
  366. 'h+': date.getHours(), // 小时
  367. 'm+': date.getMinutes(), // 分钟
  368. 's+': date.getSeconds(), // 秒
  369. 'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
  370. 'S': date.getMilliseconds() // 毫秒
  371. };
  372. // 处理年份
  373. if (/(y+)/.test(format)) {
  374. format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  375. }
  376. // 处理日期和时间部分
  377. for (let k in o) {
  378. if (new RegExp('(' + k + ')').test(format)) {
  379. let value = o[k];
  380. let padding = RegExp.$1.length === 1 ? '' : '00'; // 根据格式字符串中的长度决定是否补零
  381. format = format.replace(RegExp.$1, ('' + value).padStart(padding.length + value.toString().length - value.toString().length, '0'));
  382. }
  383. }
  384. // 如果格式只包含时间部分,移除日期部分可能的占位符
  385. if (!/(M+|d+)/.test(format)) {
  386. // 移除任何可能存在的日期占位符(如:'yyyy-MM-dd ')
  387. format = format.replace(/(\s*-\s*){2}/g, ''); // 移除两个'-'之间的任何内容
  388. format = format.replace(/^\s*yyyy-\s*/, ''); // 移除开头的'yyyy-'
  389. }
  390. // 如果格式只包含日期部分,移除时间部分可能的占位符
  391. if (!/(h+|m+|s+)/.test(format)) {
  392. // 移除任何可能存在的时间占位符(如:' hh:mm:ss')
  393. format = format.replace(/(\s*:\s*){2}/g, ''); // 移除两个':'之间的任何内容
  394. format = format.replace(/\s*hh:\s*$/, ''); // 移除结尾的' hh:'
  395. }
  396. return format;
  397. },
  398. formatDate(input) {
  399. // 创建 Date 对象(兼容不同浏览器)
  400. const date = new Date(input)
  401. // 提取年、月、日
  402. const year = date.getFullYear()
  403. const month = String(date.getMonth() + 1).padStart(2, '0') // 月份从0开始,需要+1
  404. const day = String(date.getDate()).padStart(2, '0')
  405. return `${year}-${month}-${day}`
  406. },
  407. // 截取url中的数据
  408. getQueryParam(paramName) {
  409. // 获取当前URL的查询字符串部分
  410. const queryString = window.location.search;
  411. // 创建一个URLSearchParams对象
  412. const urlParams = new URLSearchParams(queryString);
  413. // 返回指定参数的值,如果不存在则返回null
  414. return urlParams.get(paramName);
  415. },
  416. }
  417. })
  418. </script>
  419. </html>