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.
 
 
 
 

678 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. <!-- 底部导航栏 -->
  146. <!-- <u-tabbar :mid-button="true" activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList">
  147. </u-tabbar> -->
  148. </view>
  149. </template>
  150. <script>
  151. import tabbarList from '@/utils/tabbar.js'
  152. export default {
  153. data() {
  154. return {
  155. noClick:true,
  156. // tabbar配置项
  157. current: 0,
  158. tabbarList: tabbarList,
  159. //--- end --- tabbar配置项
  160. buildingID: '',
  161. waitCustomList: [],
  162. isAdd: '',
  163. dataCode: '',
  164. addAccount: '',
  165. permissions: {
  166. commonly1: false, //查看
  167. commonly2: false, //添加
  168. commonly3: false, //指派
  169. commonly4: false,
  170. commonly5: false,
  171. },
  172. };
  173. },
  174. onLoad() {
  175. uni.hideTabBar();
  176. },
  177. computed: {
  178. timestamp() {
  179. return (e) => {
  180. if (!e) return
  181. let totalTime = new Date(e).getTime() / 1000 + 60 * 60 * 2
  182. let nowTime = new Date().getTime() / 1000
  183. return totalTime - nowTime
  184. }
  185. }
  186. // judgeHalfAnHour(){
  187. // return (e)=>{
  188. // }
  189. // }
  190. },
  191. onShow() {
  192. this.buildingID = uni.getStorageSync('buildingID').id;
  193. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  194. this.permissions.commonly1 = newmenulist.jd_ck;
  195. this.permissions.commonly2 = newmenulist.jd_xz;
  196. this.permissions.commonly3 = newmenulist.jd_zp;
  197. this.permissions.commonly4 = newmenulist.jdys;
  198. this.permissions.commonly5 = newmenulist.jsjd;
  199. const {
  200. addAccount,
  201. dataCode
  202. } = uni.getStorageSync("weapp_session_userInfo_data");
  203. this.addAccount = addAccount;
  204. this.dataCode = dataCode;
  205. this.init()
  206. this.queryHaveDept()
  207. },
  208. onPullDownRefresh(){
  209. this.init()
  210. setTimeout(function () {
  211. uni.stopPullDownRefresh();
  212. }, 1000);
  213. },
  214. methods: {
  215. reshCustom() {
  216. this.init()
  217. },
  218. tapThevisiting(item) {
  219. if (this.permissions.commonly1 != true) {
  220. return
  221. }
  222. uni.showLoading({
  223. title: '加载中',
  224. mask: true
  225. });
  226. if (item.status == 0) {
  227. setTimeout(function() {
  228. uni.hideLoading();
  229. }, 2000);
  230. uni.showToast({
  231. icon: "none",
  232. title: "排队中"
  233. })
  234. return
  235. } else {
  236. const parames = {
  237. pageNum: 1,
  238. pageSize: 100,
  239. query: {
  240. customerId: item.id,
  241. }
  242. }
  243. var itemsd = {
  244. bg: 0,
  245. customerId: item.id,
  246. id: '',
  247. onebest: ''
  248. }
  249. this.$u.post("/corpus/findByPage", parames).then(res => {
  250. setTimeout(function() {
  251. uni.hideLoading();
  252. }, 2000);
  253. if (res) {
  254. let newobj = res[0];
  255. uni.navigateTo({
  256. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  257. })
  258. } else {
  259. uni.showToast({
  260. icon: "none",
  261. title: "暂无音频"
  262. })
  263. return
  264. }
  265. })
  266. }
  267. },
  268. queryHaveDept() {
  269. return new Promise((resolve, reject) => {
  270. this.$u.get("/user/queryHaveDept?houseId=" + this.buildingID).then(res => {
  271. this.isAdd = res;
  272. resolve();
  273. })
  274. })
  275. },
  276. init() {
  277. this.waitCustomList = []
  278. let parames = {
  279. itemId: this.buildingID
  280. }
  281. this.$u.post("/customer/reception", parames).then(data => {
  282. this.waitCustomList = data;
  283. });
  284. },
  285. //延时接待
  286. addTime(item) {
  287. uni.showModal({
  288. content: "确定延长半小时接待时间?",
  289. cancelColor: "#999999",
  290. success: res => {
  291. if (res.confirm) {
  292. this.$u.post("/customer/delayed", {
  293. cusId: item.id
  294. }).then(res => {
  295. uni.showToast({
  296. icon: "none",
  297. title: "操作成功"
  298. })
  299. });
  300. }
  301. }
  302. })
  303. },
  304. //结束接待
  305. changeEnd(id) {
  306. uni.showModal({
  307. content: "确定更改当前客户接待状态为结束?",
  308. cancelColor: "#999999",
  309. success: res => {
  310. if (this.noClick) {
  311. this.noClick= false;
  312. if (res.confirm) {
  313. this.$u.post("/customer/endReception", {
  314. id: id,
  315. houseId: this.buildingID
  316. }).then(res => {
  317. uni.showToast({
  318. icon: "none",
  319. title: "操作成功"
  320. })
  321. this.init();
  322. });
  323. }
  324. setTimeout(()=> {
  325. this.noClick= true;
  326. }, 2000)
  327. } else {
  328. // 这里是重复点击的判断
  329. }
  330. }
  331. })
  332. },
  333. //新增接待
  334. addreception() {
  335. const {
  336. dataCode,
  337. addAccount
  338. } = uni.getStorageSync("weapp_session_userInfo_data");
  339. if (dataCode == 6) {
  340. // if (addAccount != 0) {
  341. // uni.showToast({
  342. // title: '不允许自建客户!',
  343. // duration: 2000
  344. // });
  345. // return
  346. // }
  347. if (this.waitCustomList.length == 0) {
  348. uni.navigateTo({
  349. url: '/pages/mine/reception/addreception'
  350. })
  351. return
  352. } else {
  353. for (var i = 0; i < this.waitCustomList.length; i++) {
  354. if (this.waitCustomList[i].status == 1) {
  355. uni.showLoading({
  356. title: '当前还有未完成的客户项'
  357. });
  358. setTimeout(function() {
  359. uni.hideLoading();
  360. }, 1000);
  361. return
  362. } else {
  363. uni.navigateTo({
  364. url: '/pages/mine/reception/addreception'
  365. })
  366. return
  367. }
  368. }
  369. }
  370. } else {
  371. uni.navigateTo({
  372. url: '/pages/mine/reception/addreception'
  373. });
  374. }
  375. },
  376. assign(item) {
  377. let url = `/pages/mine/reception/consultant?id=${item.id}`
  378. if (item.beforeAgentId) {
  379. url += `&beforeAgentId=${item.beforeAgentId}`;
  380. }
  381. uni.navigateTo({
  382. url: url
  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. // margin-top: 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. margin-right: 30rpx;
  541. }
  542. }
  543. }
  544. .add {
  545. width: 90upx;
  546. height: 90upx;
  547. position: fixed;
  548. bottom: 270upx;
  549. right: 44upx;
  550. }
  551. .add2 {
  552. width: 90upx;
  553. height: 90upx;
  554. position: fixed;
  555. bottom: 150upx;
  556. right: 44upx;
  557. }
  558. .content-sec {
  559. padding: 28rpx 30rpx 32rpx;
  560. width: 100%;
  561. display: flex;
  562. justify-content: space-between;
  563. .left {
  564. flex-shrink: 0;
  565. width: 100%;
  566. display: flex;
  567. align-items: center;
  568. .adviser {
  569. flex-shrink: 0;
  570. margin-right: 10rpx;
  571. padding: 5rpx 11rpx;
  572. border-radius: 50%;
  573. border: 1rpx solid #2671E2;
  574. background: #2671E2;
  575. font-size: 30rpx;
  576. color: #fff;
  577. }
  578. .cus {
  579. font-size: 30rpx;
  580. font-weight: 400;
  581. color: #666666;
  582. overflow: hidden;/*超出部分隐藏*/
  583. text-overflow:ellipsis;/* 超出部分显示省略号 */
  584. white-space: nowrap;/*规定段落中的文本不进行换行 */
  585. }
  586. .arriveNum {
  587. flex-shrink: 0;
  588. font-size: 30rpx;
  589. font-weight: 400;
  590. margin-left: 10rpx;
  591. }
  592. }
  593. .right {
  594. flex-shrink: 0;
  595. font-size: 28rpx;
  596. font-weight: 400;
  597. color: #2671E2;
  598. display: flex;
  599. align-items: center;
  600. .img {
  601. margin-right: 10rpx;
  602. width: 32rpx;
  603. height: 32rpx;
  604. }
  605. }
  606. }
  607. .content-last {
  608. padding: 0 30rpx 34rpx;
  609. font-size: 30rpx;
  610. font-weight: 400;
  611. color: #666666;
  612. display: flex;
  613. align-items: center;
  614. justify-content: space-between;
  615. .c-items {
  616. flex-shrink: 0;
  617. display: flex;
  618. align-items: center;
  619. font-size: 28rpx;
  620. .c-items-img {
  621. margin-right: 10rpx;
  622. width: 32rpx;
  623. height: 32rpx;
  624. }
  625. }
  626. }
  627. </style>