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.
 
 
 
 

655 lines
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.visitRecord || "--"}}次接待</view> -->
  115. <view class="arriveNum">{{ item.phone ||'--' }}</view>
  116. </view>
  117. </view>
  118. <view class="content-last">
  119. <view class="c-items">
  120. <image src="../../static/images/people.png" class="c-items-img" mode=""></image>
  121. {{ item.visitRecord || "--" }}次到访
  122. </view>
  123. <view class="c-items">
  124. <image src="../../static/images/time.png" class="c-items-img" mode=""></image>
  125. {{ item.createTime }}
  126. </view>
  127. <!-- <view class="c-items">
  128. <image src="../../static/images/voice.png" class="c-items-img" mode=""></image>
  129. {{ item.mm || '0' }}min
  130. </view> -->
  131. </view>
  132. </view>
  133. <view class="footer-button" v-if="item.status!=0">
  134. <view v-if="permissions.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  135. <view v-if="permissions.commonly4" class="footer1" @click.stop="assign(item)">重新指派</view>
  136. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  137. </view>
  138. <view class="footer-button" v-if="item.status==0">
  139. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  140. </view>
  141. </view>
  142. <image v-if="permissions.commonly2" @click="addreception()" class="add" src="/static/images/add.png" mode="">
  143. </image>
  144. <image class="add2" @click="reshCustom()" src="https://static.quhouse.com/zhikong_xcx_img/refresh.png" mode="">
  145. </image>
  146. <!-- 底部导航栏 -->
  147. <u-tabbar :mid-button="true" activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList">
  148. </u-tabbar>
  149. </view>
  150. </template>
  151. <script>
  152. import tabbarList from '@/utils/tabbar.js'
  153. export default {
  154. data() {
  155. return {
  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. 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 (res.confirm) {
  305. this.$u.post("/customer/endReception", {
  306. id: id,
  307. houseId: this.buildingID
  308. }).then(res => {
  309. uni.showToast({
  310. icon: "none",
  311. title: "操作成功"
  312. })
  313. this.init();
  314. });
  315. }
  316. }
  317. })
  318. },
  319. //新增接待
  320. addreception() {
  321. const {
  322. dataCode,
  323. addAccount
  324. } = uni.getStorageSync("weapp_session_userInfo_data");
  325. if (dataCode == 6) {
  326. // if (addAccount != 0) {
  327. // uni.showToast({
  328. // title: '不允许自建客户!',
  329. // duration: 2000
  330. // });
  331. // return
  332. // }
  333. if (this.waitCustomList.length == 0) {
  334. uni.navigateTo({
  335. url: '/pages/mine/reception/addreception'
  336. })
  337. return
  338. } else {
  339. for (var i = 0; i < this.waitCustomList.length; i++) {
  340. if (this.waitCustomList[i].status == 1) {
  341. uni.showLoading({
  342. title: '当前还有未完成的客户项'
  343. });
  344. setTimeout(function() {
  345. uni.hideLoading();
  346. }, 1000);
  347. return
  348. } else {
  349. uni.navigateTo({
  350. url: '/pages/mine/reception/addreception'
  351. })
  352. return
  353. }
  354. }
  355. }
  356. } else {
  357. uni.navigateTo({
  358. url: '/pages/mine/reception/addreception'
  359. });
  360. }
  361. },
  362. assign(item) {
  363. let url = `/pages/mine/reception/consultant?id=${item.id}`
  364. if (item.beforeAgentId) {
  365. url += `&beforeAgentId=${item.beforeAgentId}`;
  366. }
  367. uni.navigateTo({
  368. url: url
  369. })
  370. },
  371. },
  372. };
  373. </script>
  374. <style lang="scss" scoped>
  375. .cented-box {
  376. background: #F8F8F8;
  377. width: 100%;
  378. min-height: calc(100vh - var(--window-bottom) - var(--window-top));
  379. padding-bottom: 30rpx;
  380. display: flex;
  381. flex-direction: column;
  382. .empty {
  383. flex-grow: 1;
  384. display: flex;
  385. align-items: center;
  386. }
  387. }
  388. .customer {
  389. margin-top: 30rpx;
  390. width: 100%;
  391. background: #FFFFFF;
  392. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  393. .title {
  394. height: 90rpx;
  395. border-bottom: 1px solid #E0E0E0;
  396. display: flex;
  397. align-items: center;
  398. justify-content: space-between;
  399. .zuo {
  400. // width: 25%;
  401. height: 100%;
  402. display: flex;
  403. align-items: center;
  404. .zuoimg {
  405. width: 52rpx;
  406. height: 52rpx;
  407. border-radius: 50%;
  408. // border: 1px solid #C9C9C9;
  409. border: 1px solid #2671E2;
  410. font-size: 30rpx;
  411. color: #2671E2;
  412. font-weight: 400;
  413. line-height: 48rpx;
  414. text-align: center;
  415. margin-left: 30rpx;
  416. }
  417. .zuoname {
  418. font-size: 30rpx;
  419. font-weight: bold;
  420. color: #333333;
  421. line-height: 30rpx;
  422. margin-left: 20rpx;
  423. }
  424. }
  425. .cen {
  426. // width:50%;
  427. color: #E7483C;
  428. text-align: center;
  429. }
  430. .you {
  431. // width: 25%;
  432. height: 100%;
  433. display: flex;
  434. align-items: center;
  435. margin-right: 30rpx;
  436. .youimg1 {
  437. width: 12rpx;
  438. height: 12rpx;
  439. border-radius: 50%;
  440. background: #2B6EFF;
  441. }
  442. .you-img {
  443. width: 24rpx;
  444. height: 32rpx;
  445. margin-left: 24rpx;
  446. }
  447. .youimg1-1 {
  448. width: 12rpx;
  449. height: 12rpx;
  450. border-radius: 50%;
  451. background: #F2A269;
  452. }
  453. .youtext {
  454. font-size: 30rpx;
  455. font-weight: 400;
  456. color: #292929;
  457. line-height: 30rpx;
  458. margin-left: 10rpx;
  459. }
  460. }
  461. }
  462. .centerbox {
  463. .centerbox-che {
  464. width: 100%;
  465. margin-top: 30rpx;
  466. height: 30rpx;
  467. font-size: 30rpx;
  468. font-weight: 400;
  469. color: #666666;
  470. line-height: 30rpx;
  471. text-indent: 30rpx;
  472. .shizai {
  473. color: #333333;
  474. }
  475. }
  476. .centerbox-che2 {
  477. width: 100%;
  478. margin-top: 30rpx;
  479. height: 30rpx;
  480. font-size: 30rpx;
  481. font-weight: 400;
  482. color: #666666;
  483. line-height: 30rpx;
  484. text-indent: 30rpx;
  485. display: flex;
  486. .Workcard {
  487. width: 50%;
  488. }
  489. }
  490. }
  491. .footer-button {
  492. // margin-top: 30rpx;
  493. width: 100%;
  494. height: 108rpx;
  495. display: flex;
  496. font-size: 30rpx;
  497. font-weight: 400;
  498. color: #333333;
  499. border-top: 1rpx solid #E0E0E0;
  500. justify-content: flex-end;
  501. line-height: 58rpx;
  502. .footer1 {
  503. // flex: 1;
  504. text-align: center;
  505. margin-top: 24rpx;
  506. // line-height: 90rpx;
  507. // border-right: 1rpx solid #E0E0E0;
  508. width: 156rpx;
  509. height: 60rpx;
  510. background: #FFFFFF;
  511. border-radius: 30rpx;
  512. border: 1px solid #999999;
  513. margin-left: 30rpx;
  514. }
  515. .footer3 {
  516. // flex: 1;
  517. text-align: center;
  518. margin-top: 24rpx;
  519. // line-height: 90rpx;
  520. width: 156rpx;
  521. height: 60rpx;
  522. background: #FFFFFF;
  523. border-radius: 30rpx;
  524. border: 1px solid #999999;
  525. margin-left: 30rpx;
  526. margin-right: 30rpx;
  527. }
  528. }
  529. }
  530. .add {
  531. width: 90upx;
  532. height: 90upx;
  533. position: fixed;
  534. bottom: 220upx;
  535. right: 44upx;
  536. }
  537. .add2 {
  538. width: 90upx;
  539. height: 90upx;
  540. position: fixed;
  541. bottom: 100upx;
  542. right: 44upx;
  543. }
  544. .content-sec {
  545. padding: 28rpx 30rpx 32rpx;
  546. display: flex;
  547. justify-content: space-between;
  548. .left {
  549. display: flex;
  550. align-items: center;
  551. .adviser {
  552. margin-right: 10rpx;
  553. padding: 5rpx 11rpx;
  554. border-radius: 50%;
  555. border: 1rpx solid #2671E2;
  556. background: #2671E2;
  557. font-size: 30rpx;
  558. color: #fff;
  559. }
  560. .cus {
  561. font-size: 30rpx;
  562. font-weight: 400;
  563. color: #666666;
  564. // line-height: 30rpx;
  565. }
  566. .arriveNum {
  567. font-size: 30rpx;
  568. font-weight: 400;
  569. margin-left: 10rpx;
  570. }
  571. }
  572. .right {
  573. font-size: 28rpx;
  574. font-weight: 400;
  575. color: #2671E2;
  576. display: flex;
  577. align-items: center;
  578. .img {
  579. margin-right: 10rpx;
  580. width: 32rpx;
  581. height: 32rpx;
  582. }
  583. }
  584. }
  585. .content-last {
  586. padding: 0 30rpx 34rpx;
  587. font-size: 30rpx;
  588. font-weight: 400;
  589. color: #666666;
  590. display: flex;
  591. align-items: center;
  592. justify-content: space-between;
  593. .c-items {
  594. flex-shrink: 0;
  595. display: flex;
  596. align-items: center;
  597. font-size: 28rpx;
  598. .c-items-img {
  599. margin-right: 10rpx;
  600. width: 32rpx;
  601. height: 32rpx;
  602. }
  603. }
  604. }
  605. </style>