mainPosition.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <view class="u-swipe-content">
  3. <view class="header py3 p-relative">
  4. <view class="text-center py2 u-font-34 text-color-white">待保养总数</view>
  5. <view class="text-center f-size-50 text-color-white">{{ list.length>0? list[0].waitNum:0 }}</view>
  6. <u-row class="p3 p-absolute row" style="bottom:0;" gutter="16" justify="space-between">
  7. <u-col span="4">
  8. <view class="text-center py2 f-size-32 text-color-white">{{ list.length>0?list[0].sbNum:0 }}</view>
  9. <view class="text-center f-size-24 text-color-white">保养设备数</view>
  10. </u-col>
  11. <u-col span="4" >
  12. <view class="text-center py2 f-size-32 text-color-white">{{ list.length>0?list[0].monthNum:0 }}</view>
  13. <view class="text-center f-size-24 text-color-white">本月保养任务</view>
  14. </u-col>
  15. <u-col span="4">
  16. <view class="text-center py2 f-size-32 text-color-white">{{ list.length>0?list[0].compaleteNum:0 }}</view>
  17. <view class="text-center f-size-24 text-color-white">本月保养记录</view>
  18. </u-col>
  19. </u-row>
  20. </view>
  21. <view class="p2">
  22. <u-grid :col="3">
  23. <u-grid-item v-for="item in list" :key="item.positionId" @click="handleView(item.positionId)">
  24. <u-badge :count="item.subWaitNum" ></u-badge>
  25. <view class="grid-text">{{ item.positionName }}</view>
  26. </u-grid-item>
  27. </u-grid>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import { stringify } from 'qs';
  33. export default {
  34. data() {
  35. return {
  36. list: [],
  37. timeFlag: null
  38. }
  39. },
  40. onLoad(options) {
  41. console.log(options)
  42. this.timeFlag = options.timeFlag
  43. },
  44. onShow() {
  45. this.getData()
  46. },
  47. methods: {
  48. handleView(positionId) {
  49. const params = {
  50. positionId: positionId,
  51. timeFlag: this.timeFlag || null
  52. }
  53. uni.navigateTo({
  54. url: '/pages/maintain/main??' + stringify(params)
  55. });
  56. },
  57. getData() {
  58. this.$Http.getCheckJob({ timeFlag: this.timeFlag }).then(res => {
  59. console.log(res)
  60. this.list = res.data
  61. })
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .header{
  68. height:380rpx;
  69. width: 100vw;
  70. background: #0082FF;
  71. }
  72. .u-swipe-content{
  73. min-height: calc(100vh - 88rpx);
  74. }
  75. .grid-text{
  76. height: 150rpx;
  77. line-height: 150rpx;
  78. }
  79. </style>