選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 

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