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.
 
 
 

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