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.
 
 
 

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