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.
 
 
 
 

643 lines
16 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view v-if="waitCustomList.length==0" style="width: 100%;height: 100%;display: flex;align-items: center;">
  4. <view style="width: 100%;padding-top: 200rpx;">
  5. <view style="width: 100%;text-align: center;">
  6. <image style="width: 220rpx;height: 200rpx;"
  7. src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode=""></image>
  8. </view>
  9. <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据</view>
  10. </view>
  11. </view>
  12. <!-- <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  13. @click="tapThevisiting(item)">
  14. <view class="title">
  15. <view class="zuo">
  16. <view class="zuoimg">A</view>
  17. <view class="zuoname">{{item.name}}</view>
  18. </view>
  19. <view class="you">
  20. <view class="youimg1" v-if="item.status!=0"></view>
  21. <view class="youimg1-1" v-if="item.status==0"></view>
  22. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view>
  23. </view>
  24. </view>
  25. <view class="centerbox" v-if="item.status!=0">
  26. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  27. <view class="centerbox-che">开始时间:<text class="shizai">{{item.createTime}}</text></view>
  28. <view class="centerbox-che">顾问姓名:<text class="shizai" style="color: #333333;">{{item.agentName}}</text>
  29. </view>
  30. <view class="centerbox-che2" v-if="item.status==1">
  31. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==0">设备状态:<text
  32. class="shizai" style="color: red;">离线</text></view>
  33. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine!=0">工牌电量:<text
  34. class="shizai" style="color: #333333;">{{item.zkEquipmentState.electricity}}%</text></view>
  35. <view class="Workcard" v-if="item.status==1&&item.zkEquipmentState.onLine==1">录音状态:
  36. <text v-if="item.zkEquipmentState.simAudioStatus=='true'" class="shizai"
  37. style="color: #333333;">使用中</text>
  38. <text v-if="item.zkEquipmentState.simAudioStatus=='false'" class="shizai"
  39. style="color: #333333;">未使用</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="footer-button" v-if="item.status!=0">
  44. <view v-if="permissions.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  45. <view v-if="permissions.commonly4" class="footer1" @click.stop="assign(item)">重新指派</view>
  46. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  47. </view>
  48. <view class="centerbox" v-if="item.status==0">
  49. <view class="centerbox-che">手机号码:<text class="shizai">{{item.phone || "--"}}</text></view>
  50. </view>
  51. <view class="footer-button" v-if="item.status==0">
  52. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  53. </view>
  54. </view> -->
  55. <view class="customer" v-if="waitCustomList.length!=0" v-for="(item,index) in waitCustomList" :key='index'
  56. @click="tapThevisiting(item)">
  57. <view class="title">
  58. <view class="zuo">
  59. <view class="zuoimg">顾</view>
  60. <view class="zuoname">{{item.agentName || '--'}}</view>
  61. </view>
  62. <view class="cen" v-if="timestamp(item.createTime)<30">
  63. <view v-if="item.status!=0">
  64. 自动结束 <u-count-down :timestamp="timestamp(item.createTime)" color="#E7483C"></u-count-down>
  65. </view>
  66. </view>
  67. <view class="you">
  68. <!-- <view class="youimg1" v-if="item.status!=0"></view>
  69. <view class="youimg1-1" v-if="item.status==0"></view>
  70. <view class="youtext">{{item.status==0?"排队中":item.status==1?"接待中":"已完成"}}</view> -->
  71. <view class="" v-if="item.status!=0" style="display: flex;">
  72. <block v-if="item.imei!=null || item.imei==''">
  73. <!-- 接待中 -->
  74. <view class="">
  75. <!-- 工牌标示 -->
  76. <image class="you-img"
  77. 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"
  86. src="../../static/images/cus5.png" mode=""></image>
  87. </view>
  88. <view class="">
  89. <!-- 录音 -->
  90. <image v-if="item.zkEquipmentState.simAudioStatus=='true'" class="you-img"
  91. src="../../static/images/cus3.png" mode=""></image>
  92. <image v-else class="you-img"
  93. src="../../static/images/cus6.png" mode=""></image>
  94. </view>
  95. </view>
  96. <!-- 离线 -->
  97. <view class="" v-else>
  98. <view class="">
  99. <!-- 录音 -->
  100. <image class="you-img"
  101. src="../../static/images/cus4.png" mode=""></image>
  102. </view>
  103. </view>
  104. </block>
  105. </view>
  106. <view class="youtext" v-else>
  107. <!--排队中 -->
  108. 排队中
  109. </view>
  110. </view>
  111. </view>
  112. <view class="centerbox">
  113. <view class="content-sec">
  114. <view class="left">
  115. <view class="adviser">客</view>
  116. <view class="cus">{{item.name || '--'}}</view>
  117. <!-- <view class="arriveNum">第{{item.visitRecord || "--"}}次接待</view> -->
  118. <view class="arriveNum">{{ item.phone ||'--' }}</view>
  119. </view>
  120. </view>
  121. <view class="content-last">
  122. <view class="c-items">
  123. <image src="../../static/images/people.png" class="c-items-img" mode=""></image>
  124. {{ item.visitRecord || "--" }}次到访
  125. </view>
  126. <view class="c-items">
  127. <image src="../../static/images/time.png" class="c-items-img" mode=""></image>
  128. {{ item.createTime }}
  129. </view>
  130. <!-- <view class="c-items">
  131. <image src="../../static/images/voice.png" class="c-items-img" mode=""></image>
  132. {{ item.mm || '0' }}min
  133. </view> -->
  134. </view>
  135. </view>
  136. <view class="footer-button" v-if="item.status!=0">
  137. <view v-if="permissions.commonly3" class="footer1" @click.stop="addTime(item)">接待延时</view>
  138. <view v-if="permissions.commonly4" class="footer1" @click.stop="assign(item)">重新指派</view>
  139. <view v-if="permissions.commonly5" class="footer3" @click.stop="changeEnd(item.id)">结束接待</view>
  140. </view>
  141. <view class="footer-button" v-if="item.status==0">
  142. <view class="footer3" @click.stop="assign(item)">指派顾问</view>
  143. </view>
  144. </view>
  145. <image v-if="permissions.commonly2" @click="addreception()" class="add" src="/static/images/add.png" mode="">
  146. </image>
  147. <image class="add2" @click="reshCustom()" src="https://static.quhouse.com/zhikong_xcx_img/refresh.png" mode="">
  148. </image>
  149. <!-- 底部导航栏 -->
  150. <u-tabbar :mid-button="true" activeColor="#1296db" inactiveColor="#999999" v-model="current" :list="tabbarList"></u-tabbar>
  151. </view>
  152. </template>
  153. <script>
  154. import tabbarList from '@/utils/tabbar.js'
  155. export default {
  156. data() {
  157. return {
  158. // tabbar配置项
  159. current: 0,
  160. tabbarList: tabbarList,
  161. //--- end --- tabbar配置项
  162. buildingID: '',
  163. waitCustomList: [],
  164. isAdd: '',
  165. dataCode: '',
  166. addAccount: '',
  167. permissions: {
  168. commonly1: false, //查看
  169. commonly2: false, //添加
  170. commonly3: false, //指派
  171. commonly4: false,
  172. commonly5: false,
  173. },
  174. };
  175. },
  176. onLoad() {
  177. uni.hideTabBar();
  178. },
  179. computed:{
  180. timestamp(){
  181. return (e)=>{
  182. let totalTime = new Date(e).getTime()/1000 + 60*60*2
  183. let nowTime = new Date().getTime()/1000
  184. return totalTime - nowTime
  185. }
  186. }
  187. // judgeHalfAnHour(){
  188. // return (e)=>{
  189. // }
  190. // }
  191. },
  192. onShow() {
  193. this.buildingID = uni.getStorageSync('buildingID').id;
  194. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  195. this.permissions.commonly1 = newmenulist.jd_ck;
  196. this.permissions.commonly2 = newmenulist.jd_xz;
  197. this.permissions.commonly3 = newmenulist.jd_zp;
  198. this.permissions.commonly4 = newmenulist.jdys;
  199. this.permissions.commonly5 = newmenulist.jsjd;
  200. const {
  201. addAccount,
  202. dataCode
  203. } = uni.getStorageSync("weapp_session_userInfo_data");
  204. this.addAccount = addAccount;
  205. this.dataCode = dataCode;
  206. this.init()
  207. this.queryHaveDept()
  208. },
  209. methods: {
  210. reshCustom() {
  211. this.init()
  212. },
  213. tapThevisiting(item) {
  214. if (this.permissions.commonly1 != true) {
  215. return
  216. }
  217. uni.showLoading({
  218. title: '加载中',
  219. mask: true
  220. });
  221. if (item.status == 0) {
  222. setTimeout(function() {
  223. uni.hideLoading();
  224. }, 2000);
  225. uni.showToast({
  226. icon: "none",
  227. title: "排队中"
  228. })
  229. return
  230. } else {
  231. const parames = {
  232. pageNum: 1,
  233. pageSize: 100,
  234. query: {
  235. customerId: item.id,
  236. }
  237. }
  238. var itemsd = {
  239. bg: 0,
  240. customerId: item.id,
  241. id: '',
  242. onebest: ''
  243. }
  244. this.$u.post("/corpus/findByPage", parames).then(res => {
  245. setTimeout(function() {
  246. uni.hideLoading();
  247. }, 2000);
  248. if (res) {
  249. let newobj = res[0];
  250. uni.navigateTo({
  251. url: `/pages/mine/details?customerId=${newobj.customerId}&status=${newobj.status}&itemobj=${JSON.stringify(itemsd)}&stateisshow=${"1"}`
  252. })
  253. } else {
  254. uni.showToast({
  255. icon: "none",
  256. title: "暂无音频"
  257. })
  258. return
  259. }
  260. })
  261. }
  262. },
  263. queryHaveDept() {
  264. return new Promise((resolve, reject) => {
  265. this.$u.get("/user/queryHaveDept?houseId=" + this.buildingID).then(res => {
  266. this.isAdd = res;
  267. resolve();
  268. })
  269. })
  270. },
  271. init() {
  272. this.waitCustomList = []
  273. let parames = {
  274. itemId: this.buildingID
  275. }
  276. this.$u.post("/customer/reception", parames).then(data => {
  277. this.waitCustomList = data;
  278. });
  279. },
  280. //延时接待
  281. addTime(item) {
  282. uni.showModal({
  283. content: "确定延长半小时接待时间?",
  284. cancelColor: "#999999",
  285. success: res => {
  286. if (res.confirm) {
  287. this.$u.post("/customer/delayed", {
  288. cusId: item.id
  289. }).then(res => {
  290. uni.showToast({
  291. icon: "none",
  292. title: "操作成功"
  293. })
  294. });
  295. }
  296. }
  297. })
  298. },
  299. //结束接待
  300. changeEnd(id) {
  301. uni.showModal({
  302. content: "确定更改当前客户接待状态为结束?",
  303. cancelColor: "#999999",
  304. success: res => {
  305. if (res.confirm) {
  306. this.$u.post("/customer/endReception", {
  307. id: id,
  308. houseId: this.buildingID
  309. }).then(res => {
  310. uni.showToast({
  311. icon: "none",
  312. title: "操作成功"
  313. })
  314. this.init();
  315. });
  316. }
  317. }
  318. })
  319. },
  320. //新增接待
  321. addreception() {
  322. const {
  323. dataCode,
  324. addAccount
  325. } = uni.getStorageSync("weapp_session_userInfo_data");
  326. if (dataCode == 6) {
  327. if (addAccount != 0) {
  328. uni.showToast({
  329. title: '不允许自建客户!',
  330. duration: 2000
  331. });
  332. return
  333. }
  334. if (this.waitCustomList.length == 0) {
  335. uni.navigateTo({
  336. url: '/pages/mine/reception/addreception'
  337. })
  338. return
  339. } else {
  340. for (var i = 0; i < this.waitCustomList.length; i++) {
  341. if (this.waitCustomList[i].status == 1) {
  342. uni.showLoading({
  343. title: '当前还有未完成的客户项'
  344. });
  345. setTimeout(function() {
  346. uni.hideLoading();
  347. }, 1000);
  348. return
  349. } else {
  350. uni.navigateTo({
  351. url: '/pages/mine/reception/addreception'
  352. })
  353. return
  354. }
  355. }
  356. }
  357. } else {
  358. uni.navigateTo({
  359. url: '/pages/mine/reception/addreception'
  360. });
  361. }
  362. },
  363. assign(item) {
  364. let url = `/pages/mine/reception/consultant?id=${item.id}`
  365. if (item.beforeAgentId) {
  366. url += `&beforeAgentId=${item.beforeAgentId}`;
  367. }
  368. uni.navigateTo({
  369. url: url
  370. })
  371. },
  372. },
  373. };
  374. </script>
  375. <style lang="scss" scoped>
  376. .cented-box {
  377. background: #F8F8F8;
  378. width: 100%;
  379. height: 100vh;
  380. padding-bottom: 30rpx;
  381. }
  382. .customer {
  383. margin-top: 30rpx;
  384. width: 100%;
  385. background: #FFFFFF;
  386. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  387. .title {
  388. height: 90rpx;
  389. border-bottom: 1px solid #E0E0E0;
  390. display: flex;
  391. align-items: center;
  392. justify-content: space-between;
  393. .zuo {
  394. // width: 25%;
  395. height: 100%;
  396. display: flex;
  397. align-items: center;
  398. .zuoimg {
  399. width: 52rpx;
  400. height: 52rpx;
  401. border-radius: 50%;
  402. // border: 1px solid #C9C9C9;
  403. border: 1px solid #2671E2;
  404. font-size: 30rpx;
  405. color: #2671E2;
  406. font-weight: 400;
  407. line-height: 48rpx;
  408. text-align: center;
  409. margin-left: 30rpx;
  410. }
  411. .zuoname {
  412. font-size: 30rpx;
  413. font-weight: bold;
  414. color: #333333;
  415. line-height: 30rpx;
  416. margin-left: 20rpx;
  417. }
  418. }
  419. .cen{
  420. // width:50%;
  421. color: #E7483C;
  422. text-align: center;
  423. }
  424. .you {
  425. // width: 25%;
  426. height: 100%;
  427. display: flex;
  428. align-items: center;
  429. margin-right: 30rpx;
  430. .youimg1 {
  431. width: 12rpx;
  432. height: 12rpx;
  433. border-radius: 50%;
  434. background: #2B6EFF;
  435. }
  436. .you-img{
  437. width: 24rpx;
  438. height: 32rpx;
  439. margin-left: 24rpx;
  440. }
  441. .youimg1-1 {
  442. width: 12rpx;
  443. height: 12rpx;
  444. border-radius: 50%;
  445. background: #F2A269;
  446. }
  447. .youtext {
  448. font-size: 30rpx;
  449. font-weight: 400;
  450. color: #292929;
  451. line-height: 30rpx;
  452. margin-left: 10rpx;
  453. }
  454. }
  455. }
  456. .centerbox {
  457. .centerbox-che {
  458. width: 100%;
  459. margin-top: 30rpx;
  460. height: 30rpx;
  461. font-size: 30rpx;
  462. font-weight: 400;
  463. color: #666666;
  464. line-height: 30rpx;
  465. text-indent: 30rpx;
  466. .shizai {
  467. color: #333333;
  468. }
  469. }
  470. .centerbox-che2 {
  471. width: 100%;
  472. margin-top: 30rpx;
  473. height: 30rpx;
  474. font-size: 30rpx;
  475. font-weight: 400;
  476. color: #666666;
  477. line-height: 30rpx;
  478. text-indent: 30rpx;
  479. display: flex;
  480. .Workcard {
  481. width: 50%;
  482. }
  483. }
  484. }
  485. .footer-button {
  486. // margin-top: 30rpx;
  487. width: 100%;
  488. height: 108rpx;
  489. display: flex;
  490. font-size: 30rpx;
  491. font-weight: 400;
  492. color: #333333;
  493. border-top: 1rpx solid #E0E0E0;
  494. justify-content:flex-end;
  495. line-height: 58rpx;
  496. .footer1 {
  497. // flex: 1;
  498. text-align: center;
  499. margin-top: 24rpx;
  500. // line-height: 90rpx;
  501. // border-right: 1rpx solid #E0E0E0;
  502. width: 156rpx;
  503. height: 60rpx;
  504. background: #FFFFFF;
  505. border-radius: 30rpx;
  506. border: 1px solid #999999;
  507. margin-left: 30rpx;
  508. }
  509. .footer3 {
  510. // flex: 1;
  511. text-align: center;
  512. margin-top: 24rpx;
  513. // line-height: 90rpx;
  514. width: 156rpx;
  515. height: 60rpx;
  516. background: #FFFFFF;
  517. border-radius: 30rpx;
  518. border: 1px solid #999999;
  519. margin-left: 30rpx;
  520. margin-right: 30rpx;
  521. }
  522. }
  523. }
  524. .add {
  525. width: 90upx;
  526. height: 90upx;
  527. position: fixed;
  528. bottom: 220upx;
  529. right: 44upx;
  530. }
  531. .add2 {
  532. width: 90upx;
  533. height: 90upx;
  534. position: fixed;
  535. bottom: 100upx;
  536. right: 44upx;
  537. }
  538. .content-sec {
  539. padding: 28rpx 30rpx 32rpx;
  540. display: flex;
  541. justify-content: space-between;
  542. .left {
  543. display: flex;
  544. align-items: center;
  545. .adviser {
  546. margin-right: 10rpx;
  547. padding: 5rpx 11rpx;
  548. border-radius: 50%;
  549. border: 1rpx solid #2671E2;
  550. background: #2671E2;
  551. font-size: 30rpx;
  552. color: #fff;
  553. }
  554. .cus {
  555. font-size: 30rpx;
  556. font-weight: 400;
  557. color: #666666;
  558. // line-height: 30rpx;
  559. }
  560. .arriveNum {
  561. font-size: 30rpx;
  562. font-weight: 400;
  563. margin-left: 10rpx;
  564. }
  565. }
  566. .right {
  567. font-size: 28rpx;
  568. font-weight: 400;
  569. color: #2671E2;
  570. display: flex;
  571. align-items: center;
  572. .img {
  573. margin-right: 10rpx;
  574. width: 32rpx;
  575. height: 32rpx;
  576. }
  577. }
  578. }
  579. .content-last {
  580. padding: 0 30rpx 34rpx;
  581. font-size: 30rpx;
  582. font-weight: 400;
  583. color: #666666;
  584. display: flex;
  585. align-items: center;
  586. justify-content: space-between;
  587. .c-items {
  588. flex-shrink: 0;
  589. display: flex;
  590. align-items: center;
  591. font-size: 28rpx;
  592. .c-items-img {
  593. margin-right: 10rpx;
  594. width: 32rpx;
  595. height: 32rpx;
  596. }
  597. }
  598. }
  599. </style>