AI销管
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 

697 líneas
17 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.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  134. <view v-if="permissions.commonly4" 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">
  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. const {
  352. dataCode,
  353. addAccount
  354. } = uni.getStorageSync("weapp_session_userInfo_data");
  355. if (dataCode == 6) {
  356. // if (addAccount != 0) {
  357. // uni.showToast({
  358. // title: '不允许自建客户!',
  359. // duration: 2000
  360. // });
  361. // return
  362. // }
  363. if (this.waitCustomList.length == 0) {
  364. uni.navigateTo({
  365. url: '/pages/mine/reception/addreception'
  366. })
  367. return
  368. } else {
  369. for (var i = 0; i < this.waitCustomList.length; i++) {
  370. if (this.waitCustomList[i].status == 1) {
  371. uni.showLoading({
  372. title: '当前还有未完成的客户项'
  373. });
  374. setTimeout(function() {
  375. uni.hideLoading();
  376. }, 1000);
  377. return
  378. } else {
  379. uni.navigateTo({
  380. url: '/pages/mine/reception/addreception'
  381. })
  382. return
  383. }
  384. }
  385. }
  386. } else {
  387. uni.navigateTo({
  388. url: '/pages/mine/reception/addreception'
  389. });
  390. }
  391. },
  392. assign(item) {
  393. let url = `/pages/mine/reception/consultant?id=${item.id}`
  394. if (item.beforeAgentId) {
  395. url += `&beforeAgentId=${item.beforeAgentId}`;
  396. }
  397. uni.navigateTo({
  398. url: url
  399. })
  400. },
  401. },
  402. };
  403. </script>
  404. <style lang="scss" scoped>
  405. .cented-box {
  406. background: #F8F8F8;
  407. width: 100%;
  408. min-height: calc(100vh - var(--window-bottom) - var(--window-top));
  409. padding-bottom: 30rpx;
  410. display: flex;
  411. flex-direction: column;
  412. .empty {
  413. flex-grow: 1;
  414. display: flex;
  415. align-items: center;
  416. }
  417. }
  418. .customer {
  419. margin-top: 30rpx;
  420. width: 100%;
  421. background: #FFFFFF;
  422. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  423. .title {
  424. height: 90rpx;
  425. border-bottom: 1px solid #E0E0E0;
  426. display: flex;
  427. align-items: center;
  428. justify-content: space-between;
  429. .zuo {
  430. // width: 25%;
  431. height: 100%;
  432. display: flex;
  433. align-items: center;
  434. .zuoimg {
  435. width: 52rpx;
  436. height: 52rpx;
  437. border-radius: 50%;
  438. // border: 1px solid #C9C9C9;
  439. border: 1px solid #2671E2;
  440. font-size: 30rpx;
  441. color: #2671E2;
  442. font-weight: 400;
  443. line-height: 48rpx;
  444. text-align: center;
  445. margin-left: 30rpx;
  446. }
  447. .zuoname {
  448. font-size: 30rpx;
  449. font-weight: bold;
  450. color: #333333;
  451. line-height: 30rpx;
  452. margin-left: 20rpx;
  453. }
  454. }
  455. .cen {
  456. // width:50%;
  457. color: #E7483C;
  458. text-align: center;
  459. }
  460. .you {
  461. // width: 25%;
  462. height: 100%;
  463. display: flex;
  464. align-items: center;
  465. margin-right: 30rpx;
  466. .youimg1 {
  467. width: 12rpx;
  468. height: 12rpx;
  469. border-radius: 50%;
  470. background: #2B6EFF;
  471. }
  472. .you-img {
  473. width: 24rpx;
  474. height: 32rpx;
  475. margin-left: 24rpx;
  476. }
  477. .youimg1-1 {
  478. width: 12rpx;
  479. height: 12rpx;
  480. border-radius: 50%;
  481. background: #F2A269;
  482. }
  483. .youtext {
  484. font-size: 30rpx;
  485. font-weight: 400;
  486. color: #292929;
  487. line-height: 30rpx;
  488. margin-left: 10rpx;
  489. }
  490. }
  491. }
  492. .centerbox {
  493. .centerbox-che {
  494. width: 100%;
  495. margin-top: 30rpx;
  496. height: 30rpx;
  497. font-size: 30rpx;
  498. font-weight: 400;
  499. color: #666666;
  500. line-height: 30rpx;
  501. text-indent: 30rpx;
  502. .shizai {
  503. color: #333333;
  504. }
  505. }
  506. .centerbox-che2 {
  507. width: 100%;
  508. margin-top: 30rpx;
  509. height: 30rpx;
  510. font-size: 30rpx;
  511. font-weight: 400;
  512. color: #666666;
  513. line-height: 30rpx;
  514. text-indent: 30rpx;
  515. display: flex;
  516. .Workcard {
  517. width: 50%;
  518. }
  519. }
  520. }
  521. .footer-button {
  522. // margin-top: 30rpx;
  523. width: 100%;
  524. height: 108rpx;
  525. display: flex;
  526. font-size: 30rpx;
  527. font-weight: 400;
  528. color: #333333;
  529. border-top: 1rpx solid #E0E0E0;
  530. justify-content: flex-end;
  531. line-height: 58rpx;
  532. .footer1 {
  533. // flex: 1;
  534. text-align: center;
  535. margin-top: 24rpx;
  536. // line-height: 90rpx;
  537. // border-right: 1rpx solid #E0E0E0;
  538. width: 156rpx;
  539. height: 60rpx;
  540. background: #FFFFFF;
  541. border-radius: 30rpx;
  542. border: 1px solid #999999;
  543. margin-left: 30rpx;
  544. }
  545. .footer3 {
  546. // flex: 1;
  547. text-align: center;
  548. margin-top: 24rpx;
  549. // line-height: 90rpx;
  550. width: 156rpx;
  551. height: 60rpx;
  552. background: #FFFFFF;
  553. border-radius: 30rpx;
  554. border: 1px solid #999999;
  555. margin-left: 30rpx;
  556. margin-right: 30rpx;
  557. }
  558. }
  559. }
  560. .add {
  561. width: 90rpx;
  562. height: 90rpx;
  563. position: fixed;
  564. bottom: 270rpx;
  565. right: 44rpx;
  566. }
  567. .add2 {
  568. width: 90rpx;
  569. height: 90rpx;
  570. position: fixed;
  571. bottom: 150rpx;
  572. right: 44rpx;
  573. }
  574. .content-sec {
  575. padding: 28rpx 30rpx 32rpx;
  576. width: 100%;
  577. display: flex;
  578. justify-content: space-between;
  579. .left {
  580. flex-shrink: 0;
  581. width: 100%;
  582. display: flex;
  583. align-items: center;
  584. .adviser {
  585. flex-shrink: 0;
  586. margin-right: 10rpx;
  587. padding: 5rpx 11rpx;
  588. border-radius: 50%;
  589. border: 1rpx solid #2671E2;
  590. background: #2671E2;
  591. font-size: 30rpx;
  592. color: #fff;
  593. }
  594. .cus {
  595. font-size: 30rpx;
  596. font-weight: 400;
  597. color: #666666;
  598. overflow: hidden;
  599. /*超出部分隐藏*/
  600. text-overflow: ellipsis;
  601. /* 超出部分显示省略号 */
  602. white-space: nowrap;
  603. /*规定段落中的文本不进行换行 */
  604. }
  605. .arriveNum {
  606. flex-shrink: 0;
  607. font-size: 30rpx;
  608. font-weight: 400;
  609. margin-left: 10rpx;
  610. }
  611. }
  612. .right {
  613. flex-shrink: 0;
  614. font-size: 28rpx;
  615. font-weight: 400;
  616. color: #2671E2;
  617. display: flex;
  618. align-items: center;
  619. .img {
  620. margin-right: 10rpx;
  621. width: 32rpx;
  622. height: 32rpx;
  623. }
  624. }
  625. }
  626. .content-last {
  627. padding: 0 30rpx 34rpx;
  628. font-size: 30rpx;
  629. font-weight: 400;
  630. color: #666666;
  631. display: flex;
  632. align-items: center;
  633. justify-content: space-between;
  634. .c-items {
  635. flex-shrink: 0;
  636. display: flex;
  637. align-items: center;
  638. font-size: 28rpx;
  639. .c-items-img {
  640. margin-right: 10rpx;
  641. width: 32rpx;
  642. height: 32rpx;
  643. }
  644. }
  645. }
  646. </style>