25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 

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