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.
 
 
 

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