Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

658 Zeilen
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.sumCustomer || 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.activeCustomer || 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.sumCustomer || 0}}</view>
  123. <view class="realtext">接待量</view>
  124. </view>
  125. <view class="real">
  126. <view class="realnum">{{Thisweekobj.activeCustomer || 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. },
  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. this.initworkThisWeek()
  383. this.initrealTimeStatistics()
  384. },
  385. // 楼盘选择取消
  386. cancel() {
  387. this.Showhiddenunits = false;
  388. },
  389. Piabodata(item) {
  390. if (item == '销讲数据') {
  391. uni.navigateTo({
  392. url: '/pages/center/Piabodata/index'
  393. });
  394. } else if (item == '接待记录') {
  395. uni.navigateTo({
  396. url: '/pages/center/records/index'
  397. });
  398. } else if (item == '值班顾问') {
  399. uni.navigateTo({
  400. url: '/pages/mine/consultanonduty/index'
  401. });
  402. } else if (item == '设备管理') {
  403. uni.navigateTo({
  404. url: '/pages/mine/equipment/index'
  405. });
  406. } else {
  407. uni.navigateTo({
  408. url: '/pages/center/consumer/index'
  409. });
  410. }
  411. },
  412. },
  413. };
  414. </script>
  415. <style lang="scss" scoped>
  416. .cented-box {
  417. padding: 30rpx;
  418. background: #F8F8F8;
  419. width: 100%;
  420. height: 100%;
  421. }
  422. .Switchingbox {
  423. width: 100%;
  424. height: 44rpx;
  425. display: flex;
  426. align-items: center;
  427. .Switching1 {
  428. width: 44rpx;
  429. height: 44rpx;
  430. .Switching1-img {
  431. width: 44rpx;
  432. height: 44rpx;
  433. }
  434. }
  435. .Switching2 {
  436. margin-left: 12rpx;
  437. font-size: 32rpx;
  438. color: #303030;
  439. font-weight: 500;
  440. }
  441. .Switching3 {
  442. width: calc(100% - 280rpx);
  443. font-size: 32rpx;
  444. color: #303030;
  445. font-weight: 500;
  446. }
  447. .Switching4 {
  448. width: 112rpx;
  449. font-size: 28rpx;
  450. color: #303030;
  451. font-weight: 400;
  452. text-align: right;
  453. text-decoration: underline
  454. }
  455. }
  456. .Workcard {
  457. width: 100%;
  458. background: #FFFFFF;
  459. height: 154rpx;
  460. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  461. border-radius: 12rpx;
  462. display: flex;
  463. .Workcard-box {
  464. flex: 1;
  465. height: 100%;
  466. .Workcardimg {
  467. width: 100%;
  468. display: flex;
  469. justify-content: center;
  470. margin-top: 42rpx;
  471. .Workcardimg1 {
  472. width: 64rpx;
  473. height: 36rpx;
  474. background-image: url(../../static/images/battery.png);
  475. background-size: 100% 100%;
  476. padding: 8rpx;
  477. .bar {
  478. background-color: #43CD80;
  479. height: 100%;
  480. border-radius: 4rpx;
  481. }
  482. .bar1 {
  483. background-color: red;
  484. height: 100%;
  485. border-radius: 4rpx;
  486. }
  487. }
  488. .Workcardimg2 {
  489. width: 56rpx;
  490. height: 36rpx;
  491. }
  492. .Workcardimg3 {
  493. width: 34rpx;
  494. height: 36rpx;
  495. }
  496. .Workcardimg4 {
  497. width: 50rpx;
  498. height: 40rpx;
  499. }
  500. }
  501. .Workcardtext {
  502. width: 100%;
  503. text-align: center;
  504. font-size: 24rpx;
  505. font-weight: 400;
  506. color: #666666;
  507. margin-top: 20rpx;
  508. }
  509. }
  510. }
  511. .title {
  512. width: 100%;
  513. height: 30rpx;
  514. font-size: 30rpx;
  515. font-weight: 600;
  516. color: #333333;
  517. margin-top: 40rpx;
  518. margin-bottom: 24rpx;
  519. }
  520. .shebenbox {
  521. width: 100%;
  522. height: 156rpx;
  523. background: #FFFFFF;
  524. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  525. border-radius: 12rpx;
  526. display: flex;
  527. .shebenche {
  528. width: 25%;
  529. height: 100%;
  530. .shebenchenum {
  531. width: 100%;
  532. font-size: 36rpx;
  533. font-weight: 600;
  534. color: #333333;
  535. text-align: center;
  536. margin-top: 36rpx;
  537. }
  538. .shebenchetext {
  539. width: 100%;
  540. font-size: 24rpx;
  541. font-weight: 400;
  542. color: #666666;
  543. text-align: center;
  544. margin-top: 24rpx;
  545. }
  546. }
  547. }
  548. .real-timebox {
  549. width: 100%;
  550. background: #FFFFFF;
  551. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  552. border-radius: 12rpx;
  553. padding-bottom: 36rpx;
  554. .timebox {
  555. width: 100%;
  556. display: flex;
  557. .real {
  558. flex: 1;
  559. height: 100%;
  560. .realnum {
  561. width: 100%;
  562. font-size: 36rpx;
  563. font-weight: 600;
  564. color: #333333;
  565. text-align: center;
  566. margin-top: 36rpx;
  567. }
  568. .realtext {
  569. width: 100%;
  570. font-size: 24rpx;
  571. font-weight: 400;
  572. color: #666666;
  573. text-align: center;
  574. margin-top: 24rpx;
  575. }
  576. }
  577. }
  578. }
  579. .commonly-box {
  580. width: 100%;
  581. background: #FFFFFF;
  582. box-shadow: 0px 0px 12px 0px rgba(224, 224, 224, 0.3);
  583. border-radius: 12rpx;
  584. display: flex;
  585. flex-wrap: wrap;
  586. padding-bottom: 36rpx;
  587. .commonly {
  588. width: 25%;
  589. margin-top: 36rpx;
  590. .commonly-img {
  591. width: 100%;
  592. height: 68rpx;
  593. text-align: center;
  594. .commonly-img1 {
  595. width: 68rpx;
  596. height: 68rpx;
  597. border-radius: 50%;
  598. }
  599. }
  600. .commonly-text {
  601. width: 100%;
  602. text-align: center;
  603. font-size: 24rpx;
  604. font-weight: 400;
  605. color: #333333;
  606. margin-top: 16rpx;
  607. }
  608. }
  609. }
  610. </style>