sparePart.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <!-- 备品备件 -->
  3. <view class="">
  4. <Charts></Charts>
  5. <view class="box-bar">
  6. <view class="title">
  7. <image src="@/static/u24.svg" class="icon" mode=""></image>
  8. <view class="text"> 备品备件实时库存 </view>
  9. </view>
  10. <template v-if="order_list.length > 0">
  11. <view
  12. class="order-list"
  13. v-for="(item, index) in order_list"
  14. :key="index"
  15. >
  16. <view class="s1 item">
  17. <view class="b1">
  18. {{ item.assetName }}
  19. </view>
  20. <view class="b2">
  21. {{ item.inventorySum }}
  22. </view>
  23. </view>
  24. <view class="s2 item">
  25. <view class="b1">
  26. {{ item.assetType && item.assetType.descp }}
  27. </view>
  28. <view class="b2">
  29. {{ item.modelType }}
  30. </view>
  31. </view>
  32. <view class="s3 item">
  33. <view class="b1">
  34. {{ item.warehouseName }}
  35. </view>
  36. <view class="b2"> </view>
  37. </view>
  38. </view>
  39. </template>
  40. <view class="u-empty" v-else>
  41. <u-empty mode="data"> </u-empty>
  42. </view>
  43. </view>
  44. </view>
  45. </template>
  46. <script>
  47. import Charts from './components/Charts.vue'
  48. import { get } from '@/utils/api.js'
  49. export default {
  50. components: {
  51. Charts
  52. },
  53. data () {
  54. return {
  55. order_list: []
  56. }
  57. },
  58. created () {
  59. // this.getData()
  60. },
  61. methods: {
  62. getData () {
  63. get(
  64. this.apiUrl + '/home/page/sparepart/sparePartInventoryCountList'
  65. ).then(res => {
  66. if (res.success) {
  67. this.order_list = res.data.records
  68. }
  69. })
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .u-empty {
  76. padding: 30rpx;
  77. }
  78. .box-bar {
  79. background-color: #fff;
  80. margin-top: 20rpx;
  81. .title {
  82. display: flex;
  83. padding: 20rpx;
  84. align-items: center;
  85. .text {
  86. font-size: 32rpx;
  87. color: #333333;
  88. }
  89. .icon {
  90. width: 37rpx;
  91. height: 37rpx;
  92. margin-right: 10rpx;
  93. }
  94. }
  95. }
  96. .order-list {
  97. background-color: #fff;
  98. & + .order-list {
  99. border-top: 1px solid #f2f2f2;
  100. }
  101. padding: 15rpx;
  102. .item {
  103. font-size: 28rpx;
  104. color: rgb(170, 170, 170);
  105. display: flex;
  106. justify-content: space-between;
  107. & + .item {
  108. margin-top: 15rpx;
  109. }
  110. &.s1 {
  111. .b1 {
  112. color: #333333;
  113. font-size: 28rpx;
  114. font-weight: bold;
  115. }
  116. }
  117. }
  118. }
  119. </style>