clean.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view class="container">
  3. <view class="clean-box over" v-if="overdueList.length">
  4. <view class="box-header">
  5. <view class="box-title">逾期未清洗</view>
  6. <view class="box-tool">
  7. <text class="num">{{ overdueList.length }}</text>
  8. </view>
  9. </view>
  10. <view class="box-body">
  11. <div class="list">
  12. <div class="item" v-for="(item, index) in overdueList" :key="index">{{ item }}</div>
  13. </div>
  14. </view>
  15. </view>
  16. <view class="clean-box week" v-if="weekCleanList.length">
  17. <view class="box-header">
  18. <view class="box-title">一周待清洗</view>
  19. <view class="box-tool">
  20. <text class="num">{{ weekCleanList.length }}</text>
  21. </view>
  22. </view>
  23. <view class="box-body">
  24. <div class="list">
  25. <div class="item" v-for="(item, index) in weekCleanList" :key="index">{{ item }}</div>
  26. </div>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import api from "@/common/api.js";
  33. import { log } from "@/utils/base.js";
  34. export default {
  35. data() {
  36. return {
  37. overdueList: [],
  38. weekCleanList: [],
  39. };
  40. },
  41. mounted() {
  42. this.getInfo();
  43. },
  44. methods: {
  45. getInfo() {
  46. api.getCleanCompany().then(({ data }) => {
  47. //data.overdue_companyList.push(...["1", "2", "33", "1", "2", "33", "1", "2", "33", "1", "2", "33"]);
  48. //data.week_clean_companyList.push(...["1", "2", "33", "1", "2", "33", "1", "2", "33", "1", "2", "33"]);
  49. this.overdueList = data.overdue_companyList;
  50. this.weekCleanList = data.week_clean_companyList;
  51. });
  52. },
  53. },
  54. };
  55. </script>
  56. <style lang="scss">
  57. .container {
  58. padding: 0px 15px;
  59. font-size: 14px;
  60. line-height: 24px;
  61. }
  62. .clean-box {
  63. display: flex;
  64. flex-direction: column;
  65. border: 1px solid $uni-color-error;
  66. border-radius: 5px;
  67. margin: 10px 0;
  68. .box-header {
  69. height: 40px;
  70. display: flex;
  71. padding: 0 10px;
  72. justify-content: space-between;
  73. align-items: center;
  74. background-color: $uni-color-error;
  75. color: $uni-text-color-inverse;
  76. .num {
  77. margin: 0 3px;
  78. font-weight: 600;
  79. }
  80. }
  81. .box-body {
  82. width: 100%;
  83. max-height: 200px;
  84. overflow-y: scroll;
  85. }
  86. .list {
  87. .item {
  88. height: 35px;
  89. line-height: 35px;
  90. color: $uni-color-error;
  91. border-top: 1px solid $uni-color-error;
  92. font-size: 14px;
  93. font-weight: 600;
  94. overflow: hidden;
  95. text-overflow: ellipsis;
  96. white-space: nowrap;
  97. text-align: center;
  98. &:nth-of-type(2n + 1) {
  99. background: linear-gradient(rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05));
  100. }
  101. }
  102. }
  103. &.week {
  104. border-color: $uni-color-warning;
  105. .box-header {
  106. background-color: $uni-color-warning;
  107. }
  108. .list {
  109. .item {
  110. color: $uni-color-warning;
  111. border-bottom: 1px solid $uni-color-warning;
  112. }
  113. }
  114. }
  115. }
  116. .charts-box {
  117. width: 100%;
  118. height: 300px;
  119. }
  120. </style>