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.
 
 
 

691 lines
18 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view class="Switchingbox">
  4. <view class="Switching1">
  5. <image class="Switching1-img" src="../../static/images/building.png" mode=""></image>
  6. </view>
  7. <view class="Switching2">楼盘:</view>
  8. <view class="Switching3">{{buildingname}}</view>
  9. <view class="Switching4" v-if="buildingishow" @click="piskbuilding()">切换楼盘</view>
  10. </view>
  11. <view class="title" style="margin-top: 30rpx;" v-if="Myworkcard">我的工牌</view>
  12. <view v-if="Myworkcard">
  13. <view class="Workcard" v-if="Whetheroffline==true">
  14. <view class="Workcard-box">
  15. <view class="Workcardimg">
  16. <view class="Workcardimg1">
  17. <view v-if="percentage>20" class="bar" :style="{width : percentage + '%' }"></view>
  18. <view v-if="percentage<20" class="bar1" :style="{width : percentage + '%' }"></view>
  19. </view>
  20. </view>
  21. <view class="Workcardtext">电量:{{percentage}}%</view>
  22. </view>
  23. <view class="Workcard-box">
  24. <view class="Workcardimg">
  25. <image v-if="signalDevice==''" class="Workcardimg2" src="../../static/images/signal0.png"
  26. mode=""></image>
  27. <image v-else-if="signalDevice<20 && signalDevice>0" class="Workcardimg2"
  28. src="../../static/images/signal1.png" mode=""></image>
  29. <image v-else-if="signalDevice<50 && signalDevice>20" class="Workcardimg2"
  30. src="../../static/images/signal2.png" mode=""></image>
  31. <image v-else-if="signalDevice<70 && signalDevice>50" class="Workcardimg2"
  32. src="../../static/images/signal3.png" mode=""></image>
  33. <image v-else-if="signalDevice<90 && signalDevice>70" class="Workcardimg2"
  34. src="../../static/images/signal4.png" mode=""></image>
  35. <image v-else-if="signalDevice<=100 && signalDevice>90" class="Workcardimg2"
  36. src="../../static/images/signal5.png" mode=""></image>
  37. </view>
  38. <view class="Workcardtext">信号:{{signalDevicetext}}</view>
  39. </view>
  40. <view class="Workcard-box">
  41. <view class="Workcardimg">
  42. <image v-if="audioStatus=='true'" class="Workcardimg3"
  43. src="../../static/images/Thtapedrive1.png" mode=""></image>
  44. <image v-if="audioStatus=='false'" class="Workcardimg3"
  45. src="../../static/images/Thtapedrive2.png" mode=""></image>
  46. </view>
  47. <view v-if="audioStatus=='true'" class="Workcardtext">录音:已开启</view>
  48. <view v-if="audioStatus=='false'" class="Workcardtext">录音:未开启</view>
  49. </view>
  50. </view>
  51. <view class="Workcard" v-if="Whetheroffline==false">
  52. <view class="Workcard-box">
  53. <view class="Workcardimg">
  54. <image class="Workcardimg4" src="../../static/images/offline.png" mode=""></image>
  55. </view>
  56. <view class="Workcardtext">设备离线</view>
  57. </view>
  58. </view>
  59. </view>
  60. <view class="title" v-if="equipmentisshow">设备</view>
  61. <view class="shebenbox" v-if="equipmentisshow" @click="tapjumpequipment()">
  62. <view class="shebenche">
  63. <view class="shebenchenum">{{equipmentobj.totalNum || 0}}</view>
  64. <view class="shebenchetext">设备总数</view>
  65. </view>
  66. <view class="shebenche">
  67. <view class="shebenchenum">{{equipmentobj.onlineNum || 0}}</view>
  68. <view class="shebenchetext">在线</view>
  69. </view>
  70. <view class="shebenche">
  71. <view class="shebenchenum">{{equipmentobj.activeNum || 0}}</view>
  72. <view class="shebenchetext">活跃</view>
  73. </view>
  74. <view class="shebenche">
  75. <view class="shebenchenum" style="color: red;">{{equipmentobj.lowPowerNum || 0}}</view>
  76. <view class="shebenchetext">急需充电</view>
  77. </view>
  78. </view>
  79. <view class="title">实时统计</view>
  80. <view class="real-timebox">
  81. <view class="timebox">
  82. <view class="real" @click="tapjumpreception('1')">
  83. <view class="realnum">{{realtimeobj.receptionCount || 0}}</view>
  84. <view class="realtext">接待量</view>
  85. </view>
  86. <view class="real" @click="tapjumpreception('2')">
  87. <view class="realnum">{{realtimeobj.receivingCustomer || 0}}</view>
  88. <view class="realtext">正在接待</view>
  89. </view>
  90. <view class="real" @click="tapjumpreception('4')">
  91. <view class="realnum">{{realtimeobj.tagCustomer || 0}}</view>
  92. <view class="realtext">未标顾问</view>
  93. </view>
  94. </view>
  95. <view class="timebox" @click="tapjumpreception('1')">
  96. <view class="real">
  97. <view class="realnum" >{{realtimeobj.sumDuration || 0}}</view>
  98. <view class="realtext">接待时长</view>
  99. </view>
  100. <view class="real">
  101. <view class="realnum">{{realtimeobj.avgDuration|| 0}}</view>
  102. <view class="realtext">平均接待时长</view>
  103. </view>
  104. <view class="real">
  105. <view class="realnum">{{realtimeobj.fraction || 0}}%</view>
  106. <view class="realtext">平均执行率</view>
  107. </view>
  108. </view>
  109. </view>
  110. <view class="title">本周工作</view>
  111. <view class="real-timebox">
  112. <view class="timebox" @click="tapjumpreception('3')">
  113. <view class="real">
  114. <view class="realnum">{{Thisweekobj.receptionCount || 0}}</view>
  115. <view class="realtext">接待量</view>
  116. </view>
  117. <view class="real">
  118. <view class="realnum">{{Thisweekobj.fraction || 0}}%</view>
  119. <view class="realtext">平均执行率</view>
  120. </view>
  121. <view class="real">
  122. <view class="realnum">{{Thisweekobj.sumDuration || 0}}</view>
  123. <view class="realtext">录音时长</view>
  124. </view>
  125. <view class="real">
  126. <view class="realnum">{{Thisweekobj.avgDuration|| 0}}</view>
  127. <view class="realtext">平均接待时长</view>
  128. </view>
  129. </view>
  130. </view>
  131. <view class="title">常用功能</view>
  132. <view class="commonly-box">
  133. <view class="commonly" @click="Piabodata(item.name)" v-for="(item,index) in Menulist" :key='index'>
  134. <view class="commonly-img">
  135. <image v-if="item.name=='客户管理'" class="commonly-img1" src="../../static/images/function1.png"
  136. mode=""></image>
  137. <image v-if="item.name=='接待记录'" class="commonly-img1" src="../../static/images/function2.png"
  138. mode=""></image>
  139. <image v-if="item.name=='销讲数据'" class="commonly-img1" src="../../static/images/function4.png"
  140. mode=""></image>
  141. <image v-if="item.name=='设备管理'" class="commonly-img1" src="../../static/images/function5.png"
  142. mode=""></image>
  143. <image v-if="item.name=='值班顾问'" class="commonly-img1" src="../../static/images/function6.png"
  144. mode=""></image>
  145. <image v-if="item.name=='顾问排名'" class="commonly-img1" src="../../static/images/rankingguwen.png"
  146. mode=""></image>
  147. </view>
  148. <view class="commonly-text">{{item.name}}</view>
  149. </view>
  150. </view>
  151. <!-- 楼盘切换 -->
  152. <view v-if="Showhiddenunits">
  153. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="lpanlist"
  154. @cancel="cancel" @confirm="confirm"></u-select>
  155. </view>
  156. </view>
  157. </template>
  158. <script>
  159. var config = require("../../config");
  160. export default {
  161. data() {
  162. return {
  163. userInfo: {},
  164. Showhiddenunits: false,
  165. lpanlist: [], //楼盘列表
  166. buildingname: '', //楼盘名
  167. buildingID: '', //楼盘id
  168. buildingishow: false, //是否选择楼盘
  169. Myworkcard: false,
  170. percentage: '', //设备电量
  171. Whetheroffline: false, //是否离线
  172. signalDevice: 0, //信号
  173. signalDevicetext: "",
  174. audioStatus: false,
  175. equipmentisshow: false,
  176. equipmentobj: {
  177. totalNum: '',
  178. onlineNum: '',
  179. activeNum: '',
  180. lowPowerNum: '',
  181. },
  182. Menulist: [],
  183. realtimeobj: {
  184. sumCustomer: '',
  185. receivingCustomer: '',
  186. activeCustomer: '',
  187. sumDuration: '',
  188. tagCustomer: '',
  189. fraction: '',
  190. receptionCount:''
  191. },
  192. Thisweekobj: {
  193. sumCustomer: '',
  194. receivingCustomer: '',
  195. activeCustomer: '',
  196. sumDuration: '',
  197. tagCustomer: '',
  198. fraction: '',
  199. receptionCount:''
  200. }
  201. };
  202. },
  203. components: {},
  204. onShow() {
  205. this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
  206. this.Menulist = uni.getStorageSync('weapp_session_Menu_data');
  207. console.log(this.Menulist)
  208. if (this.userInfo.zkProperties.length == 1) {
  209. this.buildingID = uni.getStorageSync('buildingID').id;
  210. this.buildingname = uni.getStorageSync('buildingID').name;
  211. this.buildingishow = false;
  212. } else {
  213. this.buildingishow = true;
  214. this.buildingname = uni.getStorageSync('buildingID').name;
  215. this.buildingID = uni.getStorageSync('buildingID').id;
  216. this.userInfo.zkProperties.forEach(item => {
  217. item.label = item.propertyName;
  218. item.value = item.id
  219. })
  220. this.lpanlist = this.userInfo.zkProperties
  221. }
  222. if (this.userInfo.dataCode == 6) {
  223. this.Myworkcard = true;
  224. this.equipmentisshow = false;
  225. this.iniodianloang()
  226. } else {
  227. this.equipmentisshow = true;
  228. this.Myworkcard = false;
  229. this.initequipment()
  230. }
  231. this.initworkThisWeek()
  232. this.initrealTimeStatistics()
  233. },
  234. methods: {
  235. initworkThisWeek() {
  236. uni.request({
  237. url: config.service.workThisWeek,
  238. method: "POST",
  239. header: {
  240. 'content-type': 'application/json',
  241. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  242. },
  243. data: {
  244. houseId: this.buildingID
  245. },
  246. success: (data) => {
  247. if (data.data.data == null) {
  248. return
  249. } else {
  250. this.Thisweekobj = {
  251. sumCustomer: data.data.data.sumCustomer,
  252. receivingCustomer: data.data.data.receivingCustomer,
  253. activeCustomer: data.data.data.activeCustomer,
  254. sumDuration: Math.floor(data.data.data.sumDuration/60) ||0,
  255. avgDuration: Math.floor(data.data.data.avgDuration/60) ||0,
  256. tagCustomer: data.data.data.tagCustomer,
  257. fraction: data.data.data.fraction,
  258. receptionCount:data.data.data.receptionCount
  259. }
  260. }
  261. }
  262. })
  263. },
  264. //实时统计
  265. initrealTimeStatistics() {
  266. uni.request({
  267. url: config.service.realTimeStatistics,
  268. method: "POST",
  269. header: {
  270. 'content-type': 'application/json',
  271. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  272. },
  273. data: {
  274. houseId: this.buildingID
  275. },
  276. success: (data) => {
  277. if (data.data.data == null) {
  278. return
  279. } else {
  280. this.realtimeobj = {
  281. sumCustomer: data.data.data.sumCustomer,
  282. receivingCustomer: data.data.data.receivingCustomer,
  283. activeCustomer: data.data.data.activeCustomer,
  284. sumDuration:Math.floor(data.data.data.sumDuration/60) || 0,
  285. avgDuration: Math.floor(data.data.data.avgDuration/60) ||0,
  286. tagCustomer: data.data.data.tagCustomer,
  287. fraction: data.data.data.fraction,
  288. receptionCount:data.data.data.receptionCount
  289. }
  290. }
  291. }
  292. })
  293. },
  294. //设备
  295. initequipment() {
  296. uni.request({
  297. url: config.service.findEquipmentState,
  298. method: "POST",
  299. header: {
  300. 'content-type': 'application/json',
  301. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  302. },
  303. data: {
  304. propertyId: this.buildingID
  305. },
  306. success: (data) => {
  307. if (data.data.data == null) {
  308. return
  309. } else {
  310. this.equipmentobj = {
  311. totalNum: data.data.data.totalNum,
  312. onlineNum: data.data.data.onlineNum,
  313. activeNum: data.data.data.activeNum,
  314. lowPowerNum: data.data.data.lowPowerNum,
  315. }
  316. }
  317. }
  318. })
  319. },
  320. //我的工牌
  321. iniodianloang() {
  322. uni.request({
  323. url: config.service.findElectricity,
  324. method: "POST",
  325. header: {
  326. 'content-type': 'application/json',
  327. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  328. },
  329. data: {},
  330. success: (data) => {
  331. if (data.data.data == null) {
  332. return
  333. } else {
  334. if (data.data.data > 100) {
  335. this.percentage = 100;
  336. } else {
  337. if (data.data.data.onLine == 0) {
  338. this.Whetheroffline = false;
  339. } else {
  340. this.Whetheroffline = true;
  341. this.percentage = data.data.data.electricity;
  342. this.signalDevice = data.data.data.signalDevice / 1;
  343. console.log(this.signalDevice)
  344. this.audioStatus = data.data.data.audioStatus;
  345. if (this.signalDevice > 80) {
  346. this.signalDevicetext = '高';
  347. } else {
  348. if (this.signalDevice == 0) {
  349. this.signalDevicetext = '无';
  350. } else {
  351. this.signalDevicetext = '低';
  352. }
  353. }
  354. }
  355. }
  356. }
  357. }
  358. })
  359. },
  360. //选择楼盘弹框
  361. piskbuilding() {
  362. this.Showhiddenunits = true;
  363. },
  364. // 楼盘选择确认
  365. confirm(e) {
  366. this.buildingname = e[0].label;
  367. this.buildingID = e[0].value;
  368. let lopan = {
  369. id: e[0].value,
  370. name: e[0].label
  371. }
  372. uni.setStorageSync("buildingID", lopan); //楼盘id写入缓存
  373. this.initworkThisWeek()
  374. this.initrealTimeStatistics()
  375. },
  376. // 楼盘选择取消
  377. cancel() {
  378. this.Showhiddenunits = false;
  379. },
  380. tapjumpequipment(){
  381. this.Menulist.forEach(item=>{
  382. if(item.name=='设备管理'){
  383. uni.navigateTo({
  384. url: '/pages/mine/equipment/index'
  385. });
  386. }
  387. })
  388. },
  389. tapjumpreception(i){
  390. this.Menulist.forEach(item=>{
  391. if(item.name=='接待记录'){
  392. if(i==1){
  393. uni.navigateTo({
  394. url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'0'
  395. });
  396. }else if(i==2){
  397. uni.switchTab({
  398. url: '/pages/index/customer'
  399. });
  400. }else if(i==3){
  401. uni.navigateTo({
  402. url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal='+'2'
  403. });
  404. }else{
  405. uni.navigateTo({
  406. url: '/pages/center/records/index?refresh='+'refresh'+'&activeTotal=0'+'&markAdvisor=0'
  407. });
  408. }
  409. }
  410. })
  411. },
  412. Piabodata(item) {
  413. if (item == '销讲数据') {
  414. uni.navigateTo({
  415. url: '/pages/center/Piabodata/index'
  416. });
  417. } else if (item == '接待记录') {
  418. uni.navigateTo({
  419. url: '/pages/center/records/index?refresh='+'refresh'
  420. });
  421. } else if (item == '值班顾问') {
  422. uni.navigateTo({
  423. url: '/pages/mine/consultanonduty/index'
  424. });
  425. } else if (item == '设备管理') {
  426. uni.navigateTo({
  427. url: '/pages/mine/equipment/index'
  428. });
  429. } else if(item == '顾问排名') {
  430. uni.navigateTo({
  431. url: '/pages/center/Piabodata/Employeesstatistics'
  432. });
  433. }else{
  434. uni.navigateTo({
  435. url: '/pages/center/consumer/index?refresh='+'refresh'
  436. });
  437. }
  438. },
  439. },
  440. };
  441. </script>
  442. <style lang="scss" scoped>
  443. .cented-box {
  444. padding: 30rpx;
  445. background: #F8F8F8;
  446. width: 100%;
  447. height: 100%;
  448. }
  449. .Switchingbox {
  450. width: 100%;
  451. height: 44rpx;
  452. display: flex;
  453. align-items: center;
  454. .Switching1 {
  455. width: 44rpx;
  456. height: 44rpx;
  457. .Switching1-img {
  458. width: 44rpx;
  459. height: 44rpx;
  460. }
  461. }
  462. .Switching2 {
  463. margin-left: 12rpx;
  464. font-size: 32rpx;
  465. color: #303030;
  466. font-weight: 500;
  467. }
  468. .Switching3 {
  469. width: calc(100% - 280rpx);
  470. font-size: 32rpx;
  471. color: #303030;
  472. font-weight: 500;
  473. }
  474. .Switching4 {
  475. width: 112rpx;
  476. font-size: 28rpx;
  477. color: #303030;
  478. font-weight: 400;
  479. text-align: right;
  480. text-decoration: underline
  481. }
  482. }
  483. .Workcard {
  484. width: 100%;
  485. background: #FFFFFF;
  486. height: 154rpx;
  487. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  488. border-radius: 12rpx;
  489. display: flex;
  490. .Workcard-box {
  491. flex: 1;
  492. height: 100%;
  493. .Workcardimg {
  494. width: 100%;
  495. display: flex;
  496. justify-content: center;
  497. margin-top: 42rpx;
  498. .Workcardimg1 {
  499. width: 64rpx;
  500. height: 36rpx;
  501. background-image: url(../../static/images/battery.png);
  502. background-size: 100% 100%;
  503. padding: 8rpx;
  504. .bar {
  505. background-color: #43CD80;
  506. height: 100%;
  507. border-radius: 4rpx;
  508. }
  509. .bar1 {
  510. background-color: red;
  511. height: 100%;
  512. border-radius: 4rpx;
  513. }
  514. }
  515. .Workcardimg2 {
  516. width: 56rpx;
  517. height: 36rpx;
  518. }
  519. .Workcardimg3 {
  520. width: 34rpx;
  521. height: 36rpx;
  522. }
  523. .Workcardimg4 {
  524. width: 50rpx;
  525. height: 40rpx;
  526. }
  527. }
  528. .Workcardtext {
  529. width: 100%;
  530. text-align: center;
  531. font-size: 24rpx;
  532. font-weight: 400;
  533. color: #666666;
  534. margin-top: 20rpx;
  535. }
  536. }
  537. }
  538. .title {
  539. width: 100%;
  540. height: 30rpx;
  541. font-size: 30rpx;
  542. font-weight: 600;
  543. color: #333333;
  544. margin-top: 40rpx;
  545. margin-bottom: 24rpx;
  546. }
  547. .shebenbox {
  548. width: 100%;
  549. height: 156rpx;
  550. background: #FFFFFF;
  551. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  552. border-radius: 12rpx;
  553. display: flex;
  554. .shebenche {
  555. width: 25%;
  556. height: 100%;
  557. .shebenchenum {
  558. width: 100%;
  559. font-size: 36rpx;
  560. font-weight: 600;
  561. color: #333333;
  562. text-align: center;
  563. margin-top: 28rpx;
  564. }
  565. .shebenchetext {
  566. width: 100%;
  567. font-size: 24rpx;
  568. font-weight: 400;
  569. color: #666666;
  570. text-align: center;
  571. margin-top: 24rpx;
  572. }
  573. }
  574. }
  575. .real-timebox {
  576. width: 100%;
  577. background: #FFFFFF;
  578. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  579. border-radius: 12rpx;
  580. padding-bottom: 36rpx;
  581. .timebox {
  582. width: 100%;
  583. display: flex;
  584. .real {
  585. flex: 1;
  586. height: 100%;
  587. .realnum {
  588. width: 100%;
  589. font-size: 36rpx;
  590. font-weight: 600;
  591. color: #333333;
  592. text-align: center;
  593. margin-top: 36rpx;
  594. }
  595. .realtext {
  596. width: 100%;
  597. font-size: 24rpx;
  598. font-weight: 400;
  599. color: #666666;
  600. text-align: center;
  601. margin-top: 24rpx;
  602. }
  603. }
  604. }
  605. }
  606. .commonly-box {
  607. width: 100%;
  608. background: #FFFFFF;
  609. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  610. border-radius: 12rpx;
  611. display: flex;
  612. flex-wrap: wrap;
  613. padding-bottom: 36rpx;
  614. .commonly {
  615. width: 25%;
  616. margin-top: 36rpx;
  617. .commonly-img {
  618. width: 100%;
  619. height: 68rpx;
  620. text-align: center;
  621. .commonly-img1 {
  622. width: 68rpx;
  623. height: 68rpx;
  624. border-radius: 50%;
  625. }
  626. }
  627. .commonly-text {
  628. width: 100%;
  629. text-align: center;
  630. font-size: 24rpx;
  631. font-weight: 400;
  632. color: #333333;
  633. margin-top: 16rpx;
  634. }
  635. }
  636. }
  637. </style>