AI销管
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

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