AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

658 lines
16 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view v-if="waitCustomList.length==0" class="empty">
  4. <view style="width: 100%;display: flex;
  5. flex-direction: column;justify-content: center;align-items: center;">
  6. <view style="width: 100%;text-align: center;">
  7. <image style="width: 220rpx;height: 200rpx;"
  8. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  9. </view>
  10. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  11. </view>
  12. </view>
  13. <!-- <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  14. @click="tapThevisiting(item)">
  15. <view class="title">
  16. <view class="zuo">
  17. <view class="zuoimg">A</view>
  18. <view class="zuoname">{{item.name}}</view>
  19. </view>
  20. <view class="you">
  21. <view class="youimg1" v-if="item.status!=0"></view>
  22. <view class="youimg1-1" v-if="item.status==0"></view>
  23. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view>
  24. </view>
  25. </view>
  26. <view class="centerbox" v-if="item.status!=0">
  27. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  28. <view class="centerbox-che">开始时间:<text class="shizai">{{item.createTime}}</text></view>
  29. <view class="centerbox-che">顾问姓名:<text class="shizai" style="color: #333333;">{{item.agentName}}</text>
  30. </view>
  31. <view class="centerbox-che2" v-if="item.status==1">
  32. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==0">设备状态:<text
  33. class="shizai" style="color: red;">离线</text></view>
  34. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine!=0">工牌电量:<text
  35. class="shizai" style="color: #333333;">{{item.zkEquipmentState.electricity}}%</text></view>
  36. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==1">录音状态:
  37. <text v-if="item.zkEquipmentState.simAudioStatus=='true'" class="shizai"
  38. style="color: #333333;">使用中</text>
  39. <text v-if="item.zkEquipmentState.simAudioStatus=='false'" class="shizai"
  40. style="color: #333333;">未使用</text>
  41. </view>
  42. </view>
  43. </view>
  44. <view class="footer-button" v-if="item.status!=0">
  45. <view v-if="permissions.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  46. <view v-if="permissions.commonly4" class="footer1" @click.stop="assign(item)">重新指派</view>
  47. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  48. </view>
  49. <view class="centerbox" v-if="item.status==0">
  50. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  51. </view>
  52. <view class="footer-button" v-if="item.status==0">
  53. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  54. </view>
  55. </view> -->
  56. <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  57. @click="tapThevisiting(item)">
  58. <view class="title">
  59. <view class="zuo">
  60. <view class="zuoimg">顾</view>
  61. <view class="zuoname">{{item.agentName || '--'}}</view>
  62. </view>
  63. <view class="cen" v-if="timestamp(item.assignedTime) < 60*30">
  64. <view v-if="item.status!=0">
  65. 自动结束 <u-count-down :timestamp="timestamp(item.assignedTime)" color="#E7483C"></u-count-down>
  66. </view>
  67. </view>
  68. <view class="you">
  69. <!-- <view class="youimg1" v-if="item.status!=0"></view>
  70. <view class="youimg1-1" v-if="item.status==0"></view>
  71. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view> -->
  72. <view class="" v-if="item.status!=0" style="display: flex;">
  73. <block v-if="item.imei!=null">
  74. <!-- 接待中 -->
  75. <view class="">
  76. <!-- 工牌标示 -->
  77. <!-- <image class="you-img" src="../../static/images/cus1.png" mode=""></image> -->
  78. </view>
  79. <!-- 未离线 -->
  80. <view class="" v-if="item.zkEquipmentState.onLine!=0" style="display: flex;">
  81. <view class="">
  82. <!-- 电量 -->
  83. <image v-if="item.zkEquipmentState.electricity>=20" class="you-img"
  84. src="../../static/images/cus2.png" mode=""></image>
  85. <image v-else class="you-img" src="../../static/images/cus5.png" mode=""></image>
  86. </view>
  87. <view class="">
  88. <!-- 录音 -->
  89. <image v-if="item.zkEquipmentState.simAudioStatus=='true'" class="you-img"
  90. src="../../static/images/cus3.png" mode=""></image>
  91. <image v-else class="you-img" src="../../static/images/cus6.png" mode=""></image>
  92. </view>
  93. </view>
  94. <!-- 离线 -->
  95. <view class="" v-else>
  96. <view class="">
  97. <!-- 录音 -->
  98. <image class="you-img" src="../../static/images/cus4.png" mode=""></image>
  99. </view>
  100. </view>
  101. </block>
  102. </view>
  103. <view class="youtext" v-else>
  104. <!--排队中 -->
  105. 排队中
  106. </view>
  107. </view>
  108. </view>
  109. <view class="centerbox">
  110. <view class="content-sec">
  111. <view class="left">
  112. <view class="adviser">客</view>
  113. <view class="cus">{{item.name || '--'}}</view>
  114. <view class="arriveNum">{{ item.phone || '--' }}</view>
  115. </view>
  116. </view>
  117. <view class="content-last">
  118. <view class="c-items">
  119. <image src="../../static/images/people.png" class="c-items-img" mode=""></image>
  120. {{ item.visitRecord || "0" }}次到访
  121. </view>
  122. <view class="c-items">
  123. <image src="../../static/images/time.png" class="c-items-img" mode=""></image>
  124. {{ item.createTime }}
  125. </view>
  126. <!-- <view class="c-items">
  127. <image src="../../static/images/voice.png" class="c-items-img" mode=""></image>
  128. {{ item.mm || '0' }}min
  129. </view> -->
  130. </view>
  131. </view>
  132. <view class="footer-button" v-if="item.status!=0">
  133. <view v-if="permissions.commonly4" class="footer1" @click.stop="addTime(item)">接待延时</view>
  134. <view v-if="permissions.commonly3" class="footer1" @click.stop="assign(item)">重新指派</view>
  135. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  136. </view>
  137. <view class="footer-button" v-if="item.status==0 && permissions.commonly3">
  138. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  139. </view>
  140. </view>
  141. <image v-if="permissions.commonly2" @click="addreception()" class="add" src="/static/images/add.png" mode="">
  142. </image>
  143. <image class="add2" @click="reshCustom()" src="https://static.quhouse.com/zhikong_xcx_img/refresh.png" mode="">
  144. </image>
  145. </view>
  146. </template>
  147. <script>
  148. var config = require("../../config");
  149. export default {
  150. data() {
  151. return {
  152. noClick: true,
  153. // tabbar配置项
  154. current: 0,
  155. //--- end --- tabbar配置项
  156. buildingID: '',
  157. waitCustomList: [],
  158. isAdd: '',
  159. dataCode: '',
  160. addAccount: '',
  161. permissions: {
  162. commonly1: false, //查看
  163. commonly2: false, //添加
  164. commonly3: false, //指派
  165. commonly4: false,
  166. commonly5: false,
  167. },
  168. };
  169. },
  170. computed: {
  171. timestamp() {
  172. return (e) => {
  173. if (!e) return
  174. let totalTime = new Date(e).getTime() / 1000 + 60 * 60 * 2
  175. let nowTime = new Date().getTime() / 1000
  176. return totalTime - nowTime
  177. }
  178. }
  179. // judgeHalfAnHour(){
  180. // return (e)=>{
  181. // }
  182. // }
  183. },
  184. onShow() {
  185. this.buildingID = uni.getStorageSync('buildingID').id;
  186. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  187. this.permissions.commonly1 = newmenulist.jd_ck;
  188. this.permissions.commonly2 = newmenulist.jd_xz;
  189. this.permissions.commonly3 = newmenulist.jd_zp;
  190. this.permissions.commonly4 = newmenulist.jdys;
  191. this.permissions.commonly5 = newmenulist.jsjd;
  192. const {
  193. addAccount,
  194. dataCode
  195. } = uni.getStorageSync("weapp_session_userInfo_data");
  196. this.addAccount = addAccount;
  197. this.dataCode = dataCode;
  198. this.init()
  199. this.queryHaveDept()
  200. this.updateInit()
  201. },
  202. onPullDownRefresh() {
  203. this.init()
  204. setTimeout(function() {
  205. uni.stopPullDownRefresh();
  206. }, 1000);
  207. },
  208. methods: {
  209. updateInit() {
  210. this.$u.get(config.service.notReadNum, {
  211. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  212. projectId: uni.getStorageSync('buildingID').id
  213. }).then(res => {
  214. console.log(res)
  215. if (res > 0) {
  216. uni.setTabBarBadge({ //显示数字
  217. index: 4, //tabbar下标
  218. text: `${res}`//数字
  219. })
  220. } else {
  221. uni.removeTabBarBadge({
  222. index: 4
  223. })
  224. }
  225. }).catch(e => {
  226. uni.removeTabBarBadge({
  227. index: 4
  228. })
  229. })
  230. },
  231. reshCustom() {
  232. this.init()
  233. },
  234. tapThevisiting(item) {
  235. if (this.permissions.commonly1 != true) {
  236. return
  237. }
  238. uni.showLoading({
  239. title: '加载中',
  240. mask: true
  241. });
  242. if (item.status == 0) {
  243. setTimeout(function() {
  244. uni.hideLoading();
  245. }, 2000);
  246. uni.showToast({
  247. icon: "none",
  248. title: "排队中"
  249. })
  250. return
  251. } else {
  252. const parames = {
  253. pageNum: 1,
  254. pageSize: 100,
  255. query: {
  256. customerId: item.id,
  257. }
  258. }
  259. var itemsd = {
  260. bg: 0,
  261. customerId: item.id,
  262. id: '',
  263. onebest: ''
  264. }
  265. this.$u.post("/corpus/findByPage", parames).then(res => {
  266. setTimeout(function() {
  267. uni.hideLoading();
  268. }, 2000);
  269. if (res) {
  270. let newobj = res[0];
  271. uni.navigateTo({
  272. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  273. })
  274. } else {
  275. uni.showToast({
  276. icon: "none",
  277. title: "暂无音频"
  278. })
  279. return
  280. }
  281. })
  282. }
  283. },
  284. queryHaveDept() {
  285. return new Promise((resolve, reject) => {
  286. this.$u.get("/user/queryHaveDept?houseId=" + this.buildingID).then(res => {
  287. this.isAdd = res;
  288. resolve();
  289. })
  290. })
  291. },
  292. init() {
  293. this.waitCustomList = []
  294. let parames = {
  295. itemId: this.buildingID
  296. }
  297. this.$u.post("/customer/reception", parames).then(data => {
  298. this.waitCustomList = data;
  299. });
  300. },
  301. //延时接待
  302. addTime(item) {
  303. uni.showModal({
  304. content: "确定延长半小时接待时间?",
  305. cancelColor: "#999999",
  306. success: res => {
  307. if (res.confirm) {
  308. this.$u.post("/customer/delayed", {
  309. cusId: item.id
  310. }).then(res => {
  311. uni.showToast({
  312. icon: "none",
  313. title: "操作成功"
  314. })
  315. });
  316. }
  317. }
  318. })
  319. },
  320. //结束接待
  321. changeEnd(id) {
  322. uni.showModal({
  323. content: "确定更改当前客户接待状态为结束?",
  324. cancelColor: "#999999",
  325. success: res => {
  326. if (this.noClick) {
  327. this.noClick = false;
  328. if (res.confirm) {
  329. this.$u.post("/customer/endReception", {
  330. id: id,
  331. houseId: this.buildingID
  332. }).then(res => {
  333. uni.showToast({
  334. icon: "none",
  335. title: "操作成功"
  336. })
  337. this.init();
  338. });
  339. }
  340. setTimeout(() => {
  341. this.noClick = true;
  342. }, 2000)
  343. } else {
  344. // 这里是重复点击的判断
  345. }
  346. }
  347. })
  348. },
  349. //新增接待
  350. addreception() {
  351. uni.navigateTo({
  352. url: '/pages/mine/reception/addreception'
  353. });
  354. },
  355. assign(item) {
  356. let url = `/pages/mine/reception/consultant?id=${item.id}`
  357. if (item.beforeAgentId) {
  358. url += `&beforeAgentId=${item.beforeAgentId}`;
  359. }
  360. uni.navigateTo({
  361. url: url
  362. })
  363. },
  364. },
  365. };
  366. </script>
  367. <style lang="scss" scoped>
  368. .cented-box {
  369. background: #F8F8F8;
  370. width: 100%;
  371. min-height: calc(100vh - var(--window-bottom) - var(--window-top));
  372. padding-bottom: 30rpx;
  373. display: flex;
  374. flex-direction: column;
  375. .empty {
  376. flex-grow: 1;
  377. display: flex;
  378. align-items: center;
  379. }
  380. }
  381. .customer {
  382. margin-top: 30rpx;
  383. width: 100%;
  384. background: #FFFFFF;
  385. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  386. .title {
  387. height: 90rpx;
  388. border-bottom: 1px solid #E0E0E0;
  389. display: flex;
  390. align-items: center;
  391. justify-content: space-between;
  392. .zuo {
  393. // width: 25%;
  394. height: 100%;
  395. display: flex;
  396. align-items: center;
  397. .zuoimg {
  398. width: 52rpx;
  399. height: 52rpx;
  400. border-radius: 50%;
  401. // border: 1px solid #C9C9C9;
  402. border: 1px solid #2671E2;
  403. font-size: 30rpx;
  404. color: #2671E2;
  405. font-weight: 400;
  406. line-height: 48rpx;
  407. text-align: center;
  408. margin-left: 30rpx;
  409. }
  410. .zuoname {
  411. font-size: 30rpx;
  412. font-weight: bold;
  413. color: #333333;
  414. line-height: 30rpx;
  415. margin-left: 20rpx;
  416. }
  417. }
  418. .cen {
  419. // width:50%;
  420. color: #E7483C;
  421. text-align: center;
  422. }
  423. .you {
  424. // width: 25%;
  425. height: 100%;
  426. display: flex;
  427. align-items: center;
  428. margin-right: 30rpx;
  429. .youimg1 {
  430. width: 12rpx;
  431. height: 12rpx;
  432. border-radius: 50%;
  433. background: #2B6EFF;
  434. }
  435. .you-img {
  436. width: 24rpx;
  437. height: 32rpx;
  438. margin-left: 24rpx;
  439. }
  440. .youimg1-1 {
  441. width: 12rpx;
  442. height: 12rpx;
  443. border-radius: 50%;
  444. background: #F2A269;
  445. }
  446. .youtext {
  447. font-size: 30rpx;
  448. font-weight: 400;
  449. color: #292929;
  450. line-height: 30rpx;
  451. margin-left: 10rpx;
  452. }
  453. }
  454. }
  455. .centerbox {
  456. .centerbox-che {
  457. width: 100%;
  458. margin-top: 30rpx;
  459. height: 30rpx;
  460. font-size: 30rpx;
  461. font-weight: 400;
  462. color: #666666;
  463. line-height: 30rpx;
  464. text-indent: 30rpx;
  465. .shizai {
  466. color: #333333;
  467. }
  468. }
  469. .centerbox-che2 {
  470. width: 100%;
  471. margin-top: 30rpx;
  472. height: 30rpx;
  473. font-size: 30rpx;
  474. font-weight: 400;
  475. color: #666666;
  476. line-height: 30rpx;
  477. text-indent: 30rpx;
  478. display: flex;
  479. .Workcard {
  480. width: 50%;
  481. }
  482. }
  483. }
  484. .footer-button {
  485. padding: 0 30rpx;
  486. width: 100%;
  487. height: 108rpx;
  488. display: flex;
  489. font-size: 30rpx;
  490. font-weight: 400;
  491. color: #333333;
  492. border-top: 1rpx solid #E0E0E0;
  493. justify-content: flex-end;
  494. line-height: 58rpx;
  495. .footer1 {
  496. // flex: 1;
  497. text-align: center;
  498. margin-top: 24rpx;
  499. // line-height: 90rpx;
  500. // border-right: 1rpx solid #E0E0E0;
  501. width: 156rpx;
  502. height: 60rpx;
  503. background: #FFFFFF;
  504. border-radius: 30rpx;
  505. border: 1px solid #999999;
  506. margin-left: 30rpx;
  507. }
  508. .footer3 {
  509. // flex: 1;
  510. text-align: center;
  511. margin-top: 24rpx;
  512. // line-height: 90rpx;
  513. width: 156rpx;
  514. height: 60rpx;
  515. background: #FFFFFF;
  516. border-radius: 30rpx;
  517. border: 1px solid #999999;
  518. margin-left: 30rpx;
  519. }
  520. }
  521. }
  522. .add {
  523. width: 90rpx;
  524. height: 90rpx;
  525. position: fixed;
  526. bottom: 270rpx;
  527. right: 44rpx;
  528. }
  529. .add2 {
  530. width: 90rpx;
  531. height: 90rpx;
  532. position: fixed;
  533. bottom: 150rpx;
  534. right: 44rpx;
  535. }
  536. .content-sec {
  537. padding: 28rpx 30rpx 32rpx;
  538. width: 100%;
  539. display: flex;
  540. justify-content: space-between;
  541. .left {
  542. flex-shrink: 0;
  543. width: 100%;
  544. display: flex;
  545. align-items: center;
  546. .adviser {
  547. flex-shrink: 0;
  548. margin-right: 10rpx;
  549. padding: 5rpx 11rpx;
  550. border-radius: 50%;
  551. border: 1rpx solid #2671E2;
  552. background: #2671E2;
  553. font-size: 30rpx;
  554. color: #fff;
  555. }
  556. .cus {
  557. font-size: 30rpx;
  558. font-weight: 400;
  559. color: #666666;
  560. overflow: hidden;
  561. /*超出部分隐藏*/
  562. text-overflow: ellipsis;
  563. /* 超出部分显示省略号 */
  564. white-space: nowrap;
  565. /*规定段落中的文本不进行换行 */
  566. }
  567. .arriveNum {
  568. flex-shrink: 0;
  569. font-size: 30rpx;
  570. font-weight: 400;
  571. margin-left: 10rpx;
  572. }
  573. }
  574. .right {
  575. flex-shrink: 0;
  576. font-size: 28rpx;
  577. font-weight: 400;
  578. color: #2671E2;
  579. display: flex;
  580. align-items: center;
  581. .img {
  582. margin-right: 10rpx;
  583. width: 32rpx;
  584. height: 32rpx;
  585. }
  586. }
  587. }
  588. .content-last {
  589. padding: 0 30rpx 34rpx;
  590. font-size: 30rpx;
  591. font-weight: 400;
  592. color: #666666;
  593. display: flex;
  594. align-items: center;
  595. justify-content: space-between;
  596. .c-items {
  597. flex-shrink: 0;
  598. display: flex;
  599. align-items: center;
  600. font-size: 28rpx;
  601. .c-items-img {
  602. margin-right: 10rpx;
  603. width: 32rpx;
  604. height: 32rpx;
  605. }
  606. }
  607. }
  608. </style>