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.
 
 
 
 

652 rivejä
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="CHECKAUTHORITY('jdys')" class="footer1" @click.stop="addTime(item)">接待延时</view>
  134. <view v-if="CHECKAUTHORITY('jd_zp')" class="footer1" @click.stop="assign(item)">重新指派</view>
  135. <view v-if="CHECKAUTHORITY('jsjd')" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  136. </view>
  137. <view class="footer-button" v-if="item.status==0">
  138. <view v-if="CHECKAUTHORITY('scjd')" @tap.stop="deleteReception(item)" class="footer3">删除接待</view>
  139. <view v-if="CHECKAUTHORITY('jd_zp')" class="footer3" @click.stop="assign(item)">指派顾问</view>
  140. </view>
  141. </view>
  142. <image v-if="CHECKAUTHORITY('jd_xz')" @click="addreception()" class="add" src="/static/images/add.png" mode="">
  143. </image>
  144. <image class="add2" @click="reshCustom()" src="https://static.quhouse.com/zhikong_xcx_img/refresh.png" mode="">
  145. </image>
  146. </view>
  147. </template>
  148. <script>
  149. var config = require("../../config");
  150. export default {
  151. data() {
  152. return {
  153. noClick: true,
  154. // tabbar配置项
  155. current: 0,
  156. //--- end --- tabbar配置项
  157. buildingID: '',
  158. waitCustomList: [],
  159. dataCode: '',
  160. addAccount: '',
  161. };
  162. },
  163. computed: {
  164. timestamp() {
  165. return (e) => {
  166. if (!e) return
  167. let totalTime = new Date(e).getTime() / 1000 + 60 * 60 * 2
  168. let nowTime = new Date().getTime() / 1000
  169. return totalTime - nowTime
  170. }
  171. }
  172. },
  173. onShow() {
  174. this.buildingID = uni.getStorageSync('buildingID').id;
  175. const {
  176. addAccount,
  177. dataCode
  178. } = uni.getStorageSync("weapp_session_userInfo_data");
  179. this.addAccount = addAccount;
  180. this.dataCode = dataCode;
  181. this.init()
  182. this.updateInit()
  183. },
  184. onPullDownRefresh() {
  185. this.init()
  186. setTimeout(function() {
  187. uni.stopPullDownRefresh();
  188. }, 1000);
  189. },
  190. methods: {
  191. // 删除接待
  192. deleteReception(data) {
  193. uni.showModal({
  194. content: `确认删除“${data.name}”接待吗?`,
  195. cancelColor: "#999999",
  196. success: res => {
  197. if (res.confirm) {
  198. this.$u.get(`/customer/delete?id=${data.id}`).then(res => {
  199. if (!res) {
  200. this.init()
  201. }
  202. }).catch(e => {
  203. console.log(e)
  204. uni.showToast({
  205. title: '网络异常,请稍后重试~',
  206. icon: 'none'
  207. });
  208. })
  209. }
  210. }
  211. })
  212. },
  213. // 未读消息数量
  214. updateInit() {
  215. this.$u.get(config.service.notReadNum, {
  216. id: uni.getStorageSync('weapp_session_userInfo_data').accountId,
  217. projectId: uni.getStorageSync('buildingID').id
  218. }).then(res => {
  219. if (res > 0) {
  220. uni.setTabBarBadge({ //显示数字
  221. index: 4, //tabbar下标
  222. text: `${res}` //数字
  223. })
  224. } else {
  225. uni.removeTabBarBadge({
  226. index: 4
  227. })
  228. }
  229. }).catch(e => {
  230. uni.removeTabBarBadge({
  231. index: 4
  232. })
  233. })
  234. },
  235. reshCustom() {
  236. this.init()
  237. },
  238. tapThevisiting(item) {
  239. if (this.CHECKAUTHORITY('jd_ck') != true) {
  240. return
  241. }
  242. uni.showLoading({
  243. title: '加载中',
  244. mask: true
  245. });
  246. if (item.status == 0) {
  247. setTimeout(function() {
  248. uni.hideLoading();
  249. }, 2000);
  250. uni.showToast({
  251. icon: "none",
  252. title: "排队中"
  253. })
  254. return
  255. } else {
  256. const parames = {
  257. pageNum: 1,
  258. pageSize: 100,
  259. query: {
  260. customerId: item.id,
  261. }
  262. }
  263. var itemsd = {
  264. bg: 0,
  265. customerId: item.id,
  266. id: '',
  267. onebest: ''
  268. }
  269. this.$u.post("/corpus/findByPage", parames).then(res => {
  270. setTimeout(function() {
  271. uni.hideLoading();
  272. }, 2000);
  273. if (res) {
  274. let newobj = res[0];
  275. uni.navigateTo({
  276. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  277. })
  278. } else {
  279. uni.showToast({
  280. icon: "none",
  281. title: "暂无音频"
  282. })
  283. return
  284. }
  285. })
  286. }
  287. },
  288. init() {
  289. this.waitCustomList = []
  290. let parames = {
  291. itemId: this.buildingID
  292. }
  293. this.$u.post("/customer/reception", parames).then(data => {
  294. this.waitCustomList = data;
  295. });
  296. },
  297. //延时接待
  298. addTime(item) {
  299. uni.showModal({
  300. content: "确定延长半小时接待时间?",
  301. cancelColor: "#999999",
  302. success: res => {
  303. if (res.confirm) {
  304. this.$u.post("/customer/delayed", {
  305. cusId: item.id
  306. }).then(res => {
  307. uni.showToast({
  308. icon: "none",
  309. title: "操作成功"
  310. })
  311. });
  312. }
  313. }
  314. })
  315. },
  316. //结束接待
  317. changeEnd(id) {
  318. uni.showModal({
  319. content: "确定更改当前客户接待状态为结束?",
  320. cancelColor: "#999999",
  321. success: res => {
  322. if (this.noClick) {
  323. this.noClick = false;
  324. if (res.confirm) {
  325. this.$u.post("/customer/endReception", {
  326. id: id,
  327. houseId: this.buildingID
  328. }).then(res => {
  329. uni.showToast({
  330. icon: "none",
  331. title: "操作成功"
  332. })
  333. this.init();
  334. });
  335. }
  336. setTimeout(() => {
  337. this.noClick = true;
  338. }, 2000)
  339. } else {
  340. // 这里是重复点击的判断
  341. }
  342. }
  343. })
  344. },
  345. //新增接待
  346. addreception() {
  347. uni.navigateTo({
  348. url: '/pages/mine/reception/addreception'
  349. });
  350. },
  351. assign(item) {
  352. let url = `/pages/mine/reception/consultant?id=${item.id}`
  353. if (item.beforeAgentId) {
  354. url += `&beforeAgentId=${item.beforeAgentId}`;
  355. }
  356. uni.navigateTo({
  357. url: url
  358. })
  359. },
  360. },
  361. };
  362. </script>
  363. <style lang="scss" scoped>
  364. .cented-box {
  365. background: #F8F8F8;
  366. width: 100%;
  367. min-height: calc(100vh - var(--window-bottom) - var(--window-top));
  368. padding-bottom: 30rpx;
  369. display: flex;
  370. flex-direction: column;
  371. .empty {
  372. flex-grow: 1;
  373. display: flex;
  374. align-items: center;
  375. }
  376. }
  377. .customer {
  378. margin-top: 30rpx;
  379. width: 100%;
  380. background: #FFFFFF;
  381. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  382. .title {
  383. height: 90rpx;
  384. border-bottom: 1px solid #E0E0E0;
  385. display: flex;
  386. align-items: center;
  387. justify-content: space-between;
  388. .zuo {
  389. // width: 25%;
  390. height: 100%;
  391. display: flex;
  392. align-items: center;
  393. .zuoimg {
  394. width: 52rpx;
  395. height: 52rpx;
  396. border-radius: 50%;
  397. // border: 1px solid #C9C9C9;
  398. border: 1px solid #2671E2;
  399. font-size: 30rpx;
  400. color: #2671E2;
  401. font-weight: 400;
  402. line-height: 48rpx;
  403. text-align: center;
  404. margin-left: 30rpx;
  405. }
  406. .zuoname {
  407. font-size: 30rpx;
  408. font-weight: bold;
  409. color: #333333;
  410. line-height: 30rpx;
  411. margin-left: 20rpx;
  412. }
  413. }
  414. .cen {
  415. // width:50%;
  416. color: #E7483C;
  417. text-align: center;
  418. }
  419. .you {
  420. // width: 25%;
  421. height: 100%;
  422. display: flex;
  423. align-items: center;
  424. margin-right: 30rpx;
  425. .youimg1 {
  426. width: 12rpx;
  427. height: 12rpx;
  428. border-radius: 50%;
  429. background: #2B6EFF;
  430. }
  431. .you-img {
  432. width: 24rpx;
  433. height: 32rpx;
  434. margin-left: 24rpx;
  435. }
  436. .youimg1-1 {
  437. width: 12rpx;
  438. height: 12rpx;
  439. border-radius: 50%;
  440. background: #F2A269;
  441. }
  442. .youtext {
  443. font-size: 30rpx;
  444. font-weight: 400;
  445. color: #292929;
  446. line-height: 30rpx;
  447. margin-left: 10rpx;
  448. }
  449. }
  450. }
  451. .centerbox {
  452. .centerbox-che {
  453. width: 100%;
  454. margin-top: 30rpx;
  455. height: 30rpx;
  456. font-size: 30rpx;
  457. font-weight: 400;
  458. color: #666666;
  459. line-height: 30rpx;
  460. text-indent: 30rpx;
  461. .shizai {
  462. color: #333333;
  463. }
  464. }
  465. .centerbox-che2 {
  466. width: 100%;
  467. margin-top: 30rpx;
  468. height: 30rpx;
  469. font-size: 30rpx;
  470. font-weight: 400;
  471. color: #666666;
  472. line-height: 30rpx;
  473. text-indent: 30rpx;
  474. display: flex;
  475. .Workcard {
  476. width: 50%;
  477. }
  478. }
  479. }
  480. .footer-button {
  481. padding: 0 30rpx;
  482. width: 100%;
  483. height: 108rpx;
  484. display: flex;
  485. font-size: 30rpx;
  486. font-weight: 400;
  487. color: #333333;
  488. border-top: 1rpx solid #E0E0E0;
  489. justify-content: flex-end;
  490. line-height: 58rpx;
  491. .footer1 {
  492. // flex: 1;
  493. text-align: center;
  494. margin-top: 24rpx;
  495. // line-height: 90rpx;
  496. // border-right: 1rpx solid #E0E0E0;
  497. width: 156rpx;
  498. height: 60rpx;
  499. background: #FFFFFF;
  500. border-radius: 30rpx;
  501. border: 1px solid #999999;
  502. margin-left: 30rpx;
  503. }
  504. .footer3 {
  505. // flex: 1;
  506. text-align: center;
  507. margin-top: 24rpx;
  508. // line-height: 90rpx;
  509. width: 156rpx;
  510. height: 60rpx;
  511. background: #FFFFFF;
  512. border-radius: 30rpx;
  513. border: 1px solid #999999;
  514. margin-left: 30rpx;
  515. }
  516. }
  517. }
  518. .add {
  519. width: 90rpx;
  520. height: 90rpx;
  521. position: fixed;
  522. bottom: 270rpx;
  523. right: 44rpx;
  524. }
  525. .add2 {
  526. width: 90rpx;
  527. height: 90rpx;
  528. position: fixed;
  529. bottom: 150rpx;
  530. right: 44rpx;
  531. }
  532. .content-sec {
  533. padding: 28rpx 30rpx 32rpx;
  534. width: 100%;
  535. display: flex;
  536. justify-content: space-between;
  537. .left {
  538. flex-shrink: 0;
  539. width: 100%;
  540. display: flex;
  541. align-items: center;
  542. .adviser {
  543. flex-shrink: 0;
  544. margin-right: 10rpx;
  545. padding: 5rpx 11rpx;
  546. border-radius: 50%;
  547. border: 1rpx solid #2671E2;
  548. background: #2671E2;
  549. font-size: 30rpx;
  550. color: #fff;
  551. }
  552. .cus {
  553. font-size: 30rpx;
  554. font-weight: 400;
  555. color: #666666;
  556. overflow: hidden;
  557. /*超出部分隐藏*/
  558. text-overflow: ellipsis;
  559. /* 超出部分显示省略号 */
  560. white-space: nowrap;
  561. /*规定段落中的文本不进行换行 */
  562. }
  563. .arriveNum {
  564. flex-shrink: 0;
  565. font-size: 30rpx;
  566. font-weight: 400;
  567. margin-left: 10rpx;
  568. }
  569. }
  570. .right {
  571. flex-shrink: 0;
  572. font-size: 28rpx;
  573. font-weight: 400;
  574. color: #2671E2;
  575. display: flex;
  576. align-items: center;
  577. .img {
  578. margin-right: 10rpx;
  579. width: 32rpx;
  580. height: 32rpx;
  581. }
  582. }
  583. }
  584. .content-last {
  585. padding: 0 30rpx 34rpx;
  586. font-size: 30rpx;
  587. font-weight: 400;
  588. color: #666666;
  589. display: flex;
  590. align-items: center;
  591. justify-content: space-between;
  592. .c-items {
  593. flex-shrink: 0;
  594. display: flex;
  595. align-items: center;
  596. font-size: 28rpx;
  597. .c-items-img {
  598. margin-right: 10rpx;
  599. width: 32rpx;
  600. height: 32rpx;
  601. }
  602. }
  603. }
  604. </style>