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.
 
 
 
 

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