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.
 
 
 

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