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.
 
 
 
 

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