AI销管
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 

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