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.
 
 
 

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