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.
 
 
 

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