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.
 
 
 
 

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