historicalRecord.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413
  1. <template>
  2. <div class="row rightAlignment">
  3. <div v-show="getShow" class="row init">
  4. <!-- 对话框 -->
  5. <div class="dialog">
  6. <div class="del " @click="shutDown">
  7. <img :src="require('@/assets/img/del.png')" >
  8. </div>
  9. <div class="head row allAlignment center">
  10. <!-- <div class="row allAlignment center"> -->
  11. <div class="u_name">
  12. <span>{{user_name}}</span>
  13. </div>
  14. <div v-if="getMore" class="btn_untreated" @click="getMoreList" >
  15. <span>更多消息</span>
  16. </div>
  17. <div v-if="!getMore" class="btn_untreated_off">
  18. <span>更多消息</span>
  19. </div>
  20. <!-- </div> -->
  21. </div>
  22. <div class="chatWindow" >
  23. <div v-for="(item,index) in dataList " :key="index">
  24. <!-- 模拟用户 -->
  25. <div v-if="item.to_id.startsWith('KF')" style="padding-top:10px;">
  26. <div class="title_time">
  27. <span>{{item.time_line}}</span>
  28. </div>
  29. <div v-if="item.content.text" class=" row wrap" >
  30. <div class="left_session item-center" v-html="item.content.text"></div>
  31. </div>
  32. <div v-if="item.content.img" class="row " >
  33. <div class="left_session item-center " >
  34. <img :src="imgsrc+item.content.img" alt="">
  35. </div>
  36. </div>
  37. </div>
  38. <!-- 模拟客户 -->
  39. <div v-else style="padding-top:10px;">
  40. <div class="row rightAlignment title_time" style="width: 100%;">
  41. <span>{{item.time_line}}</span>
  42. </div>
  43. <div v-if="item.content.text" class="row rightAlignment">
  44. <div class="right_session item-center wrap" v-html="item.content.text"></div>
  45. </div>
  46. <div v-if="item.content.img" class="row rightAlignment" >
  47. <div class="right_session item-center ">
  48. <img :src="imgsrc+item.content.img" alt="">
  49. </div>
  50. </div>
  51. </div>
  52. <!-- 系统消息
  53. <div>
  54. <div class="title_time row center " style="height:50px;">
  55. <span>09.30.45 由客服小王处理</span>
  56. </div>
  57. </div> -->
  58. </div>
  59. </div>
  60. <div>
  61. dadada
  62. </div>
  63. <div class="copyEditor">
  64. <!-- <div>
  65. <span>评价结果</span>
  66. </div>
  67. <div class="row ">
  68. <div>
  69. <img src="" alt="">
  70. <div>
  71. <span>{{alarm.evaluate_id == 1 ?'差评': alarm.evaluate_id == 2 ? '一般': alarm.evaluate_id == 3 ?'满意':'未评价'}}</span>
  72. </div>
  73. </div>
  74. <div>
  75. <div>
  76. <span>触犯报警:</span>
  77. </div>
  78. <div>
  79. <span v-if="alarm.verifyReturnTime == 2">回复超时</span>
  80. <span v-if="alarm.cvtOvertime == 2">会话超时</span>
  81. <span v-if="alarm.serverSensitive == 2">客服敏感词</span>
  82. <span v-if="alarm.userSensitive == 2">用户敏感词</span>
  83. <span v-if="alarm.respond == 2">未回应</span>
  84. </div>
  85. </div>
  86. </div> -->
  87. </div>
  88. </div>
  89. <!-- 用户信息展示框 -->
  90. <div class="user_info">
  91. <div style=" padding: 20px;">
  92. <ul style="padding-inline-start:0px; margin-block-start: 0;">
  93. <li style="font-weight:bold;font-weight:bold; color:#666666;">用户信息</li>
  94. <li>姓名:{{account.account_name ? account.account_name : "暂无"}}</li>
  95. <li>手机:{{account.account_phone ? account.account_phone : "暂无"}}</li>
  96. <li>邮箱:{{account.account_email ? account.account_email : "暂无"}}</li>
  97. <li>地址:{{account.address ?account.address : "暂无"}}</li>
  98. </ul>
  99. <div>
  100. <span>访客备注:</span>
  101. <div class="margin_t">
  102. <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="account.remark">
  103. </el-input>
  104. </div>
  105. </div>
  106. <ul style="padding-inline-start:0px; margin-block-start:0; margin-top:40px;">
  107. <li style="font-weight:bold;font-weight:bold; color:#666666;">访问信息</li>
  108. <li>来源渠道:直接访问</li>
  109. <li>IP地址:{{account.user_ip ?account.user_ip : "暂无"}}</li>
  110. <li>来源终端:{{account.system +"-"+ account.browse ? account.system +"-"+ account.browse : "暂无"}}</li>
  111. </ul>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. </template>
  117. <script>
  118. import '@/css/index.css';
  119. export default {
  120. props:['show','uid','user_name'],
  121. name:'historicalRecord',
  122. data(){
  123. return{
  124. textarea:'',
  125. stateType:'',
  126. frce:'',
  127. inputValse:'',
  128. dataList:[],//会话记录
  129. alarm:'',//评价谢谢
  130. // imgsrc:'http://192.168.2.186:8090'
  131. imgsrc:'http://kfadmin.bocai186.com',//图片路径域
  132. account: [],
  133. newpage: 1,
  134. getMore:true,
  135. }
  136. },
  137. mounted() {
  138. this.token = this.$store.getters.get_user_info.token;
  139. this.time = JSON.parse(sessionStorage.getItem("time"));
  140. },
  141. computed:{
  142. getShow(){
  143. if(this.show){
  144. this.getRecordList(1)
  145. }
  146. return this.show;
  147. },
  148. },
  149. methods:{
  150. getMoreList(){
  151. this.newpage++;
  152. this.getRecordList();
  153. },
  154. /*****************************************/
  155. //关闭会话详情记录
  156. shutDown(){
  157. this.$emit('childValue',false);
  158. },
  159. /*****************************************/
  160. //获取会话详情列表
  161. getRecordList(page,size = 10){
  162. let str ="historyinfo" + "customer-service" + "history" + this.time[0] + "service";
  163. this.get("api/service/history/historyInfo",{
  164. params:{
  165. servicelog_id:this.uid,
  166. currentPage: this.newpage,
  167. pageSize: size
  168. },
  169. headers:{
  170. 'X-Requested-With': 'XMLHttpRequest',
  171. 'apiToken': this.$md5(str),
  172. 'userToken': this.token
  173. }
  174. }).then(res => {
  175. if(res.data.code == 1){
  176. res.data.data.list = res.data.data.list.reverse();
  177. this.account = res.data.data.account;
  178. this.alarm = res.data.data.alarm;
  179. res.data.data.list.forEach(e => {
  180. e.time_line = this.$public.customFormatDateTime(e.time_line);
  181. e.content = JSON.parse(e.content);
  182. });
  183. if(res.data.data.currentPage > res.data.data.countPage){
  184. this.getMore = false;
  185. return false
  186. }else {
  187. let newList = res.data.data.list;
  188. console.log(res.data.data)
  189. newList.forEach(e=>{
  190. e.content.text = this.turnFace(e.content.text);
  191. //this.turnFace()
  192. })
  193. this.dataList = newList.concat(this.dataList);
  194. }
  195. }
  196. });
  197. },
  198. /******************文字信息转表情******************/
  199. turnFace(data){
  200. let str = data.match(/\#\[.*?\]\//g);
  201. let arr =Array.from(new Set(str));
  202. arr.forEach(e=>{
  203. let imgsrc = '';
  204. for(let i = 0 ; i < this.$frce.length ; i++){
  205. let expText = e.slice(1,e.length-1);
  206. if(expText == this.$frce[i]){
  207. imgsrc = '<img class="hover" src="'+require(`@/assets/img/${i}.gif`)+'"/>'
  208. break;
  209. }
  210. }
  211. data = data.replace(new RegExp(`\\#\\[${e.substring(2,e.length-2)}\\]\\/`,'g'),imgsrc);
  212. })
  213. return data;
  214. },
  215. }
  216. }
  217. </script>
  218. <style scoped>
  219. .init{
  220. font-size: 0;
  221. background: #FFFFFF;
  222. width: 855px;
  223. border: 1px solid #d5e5ff;
  224. z-index: 10 ;
  225. margin-top: 18px !important;
  226. }
  227. .del{
  228. /* position:fixed;*/
  229. top: 35vh;
  230. left: -31px;
  231. position: relative;
  232. width: 32px;
  233. height: 60px;
  234. cursor:pointer;
  235. /* background:red; */
  236. /* border-radius: 50% 0 0 50%;
  237. border: 1px solid #d5e5ff; */
  238. z-index: 20;
  239. }
  240. .dialog{
  241. width: 584px;
  242. /* height: 100vh; */
  243. border: 1px solid #D5E5FF;
  244. border-left: 0;
  245. border-top: 0;
  246. /* background: red; */
  247. }
  248. .user_info{
  249. width: 261px;
  250. /* height: 100vh; */
  251. font-size:14px;
  252. color:rgba(153,153,153,1);
  253. font-weight:400;
  254. }
  255. .head{
  256. padding: 0 20px;
  257. height:50px;
  258. border-bottom: 1px solid #D5E5FF;
  259. }
  260. .chatWindow{
  261. height: 420px;
  262. font-size: 14px;
  263. padding: 0 10px;
  264. font-weight:400;
  265. color:rgba(102,102,102,1);
  266. overflow:auto
  267. }
  268. .copyEditor{
  269. font-size: 14px;
  270. width: 100%;
  271. height: 160px;
  272. border-top: 1px solid #D5E5FF;
  273. }
  274. .btn_untreated_off {
  275. width:70px;
  276. line-height: 30px;
  277. background: rgb(195, 195, 192);
  278. border-radius:5px;
  279. font-size:12px;
  280. font-weight:400;
  281. color:rgba(255,255,255,1);
  282. text-align: center;
  283. cursor: pointer;
  284. }
  285. .btn_untreated{
  286. width:70px;
  287. line-height: 30px;
  288. background: rgb(89, 115, 255);
  289. border-radius:5px;
  290. font-size:12px;
  291. font-weight:400;
  292. color:rgba(255,255,255,1);
  293. text-align: center;
  294. cursor: pointer;
  295. }
  296. .title_time{
  297. font-size:12px;
  298. font-weight:400;
  299. color:rgba(187,187,187,1);
  300. }
  301. .u_name{
  302. width:67px;
  303. height:20px;
  304. font-size:14px;
  305. font-family:PingFang SC;
  306. font-weight:bold;
  307. line-height:20px;
  308. color:rgba(102,102,102,1);
  309. }
  310. ul li {
  311. list-style: none;
  312. margin: 0px;
  313. padding:6px 0 ;
  314. }
  315. .bt_save{
  316. width:50px;
  317. line-height:30px;
  318. text-align: center;
  319. border:1px solid rgba(221,221,221,1);
  320. background:linear-gradient(180deg,rgba(245,245,245,1) 0%,rgba(238,238,238,1) 100%);
  321. border-radius:5px;
  322. }
  323. .margin_t{
  324. margin-top: 10px;
  325. }
  326. .left_session{
  327. border:1px solid rgba(221,221,221,1);
  328. margin-right: 50px;
  329. max-width: 100%;
  330. min-height: 20px;
  331. padding: 6px;
  332. background:rgba(223,240,255,1);
  333. border-radius:0px 10px 10px 10px;
  334. margin-top:6px;
  335. }
  336. .right_session{
  337. margin-top:6px;
  338. border:1px solid rgba(221,221,221,1);
  339. margin-left: 50px;
  340. max-width: 100%;
  341. min-height: 20px;
  342. padding: 6px;
  343. background:rgba(245,245,245,1);
  344. justify-content: flex-end;
  345. border-radius:10px 0px 10px 10px;
  346. }
  347. .key {
  348. width: 100%;
  349. position: relative;
  350. }
  351. .inputBtn {
  352. /* position: absolute;
  353. right: 30px;
  354. bottom: 10px; */
  355. width: 50px;
  356. height: 26px;
  357. background:rgba(221,221,221,1);
  358. border-radius: 5px;
  359. font-size: 14px;
  360. color: #fff;
  361. }
  362. .frceBox {
  363. position: absolute;
  364. top: -25.1vh;
  365. left: 0;
  366. width: 100%;
  367. height: 25vh;
  368. background: #fff;
  369. border-top: 1px solid #d5e5ff;
  370. overflow-x: hidden;
  371. overflow-y: auto;
  372. z-index: 999999;
  373. }
  374. .frceBox p {
  375. width: 50px;
  376. height: 50px;
  377. }
  378. .frce {
  379. /* width: 100%; */
  380. padding: 0.1rem 0;
  381. margin: 0 10px;
  382. }
  383. .input {
  384. width: 99%;
  385. height: 90px;
  386. background: #fff;
  387. resize: none;
  388. font-size: 14px;
  389. /* padding: 10px; */
  390. /* border: none; */
  391. border: 1px solid #D5E5FF;
  392. outline: none;
  393. }
  394. </style>