card.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="marginTop">
  3. <view
  4. v-for="(item, index) in list"
  5. class="kd-row"
  6. :key="item.id"
  7. @click="goDetail(item)"
  8. v-show="list.length !== 0"
  9. >
  10. <view class="kd-col">
  11. <text class="title">{{ item.dialNumber }}</text>
  12. <text>{{ item.dialType == 1 ? '库内调拨' : '库外调拨' }}</text>
  13. </view>
  14. <view class="kd-col">
  15. <text class="warehouse"
  16. >{{ item.warehouseName }} <text class="arrow"></text>
  17. {{
  18. item.dialType == 1 ? item.warehouseName : item.inWarehouseName
  19. }}</text
  20. >
  21. <text>{{ item.createUserName }}</text>
  22. </view>
  23. <view class="kd-col">
  24. <text class="">{{ item.createTime }}</text>
  25. <text
  26. class="status"
  27. :class="
  28. statusList[item.auditStatus] && statusList[item.auditStatus].class
  29. "
  30. >{{
  31. statusList[item.auditStatus] && statusList[item.auditStatus].label
  32. }}</text
  33. >
  34. </view>
  35. </view>
  36. <view v-show="list.length === 0" class="no_data">
  37. <u-empty mode="data" textSize="22"></u-empty>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. props: {
  44. list: {
  45. type: Array,
  46. default: () => []
  47. }
  48. },
  49. data () {
  50. return {
  51. statusList: {
  52. 4: { class: '', label: '草稿' },
  53. 1: { class: '', label: '待审核' },
  54. 0: { class: 'text-danger', label: '已驳回' },
  55. 2: { class: 'text-primary', label: '已完成' }
  56. }
  57. }
  58. },
  59. methods: {
  60. goDetail ({ id, auditStatus }) {
  61. uni.navigateTo({
  62. url:
  63. auditStatus === 4
  64. ? `/pages/warehouse/inventoryAllocation/edit?&id=${id}`
  65. : `/pages/warehouse/inventoryAllocation/detail?&id=${id}`
  66. })
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .marginTop {
  73. border-top: 20rpx solid $page-bg;
  74. .kd-row {
  75. font-size: 28rpx;
  76. padding: 14rpx 12rpx 6rpx;
  77. border-bottom: 1rpx solid $page-bg;
  78. .kd-col {
  79. display: flex;
  80. justify-content: space-between;
  81. align-items: center;
  82. padding: 2rpx;
  83. color: #aaaaaa;
  84. .status {
  85. background-color: $page-bg;
  86. display: inline-block;
  87. padding: 4rpx 10rpx;
  88. border-radius: 18rpx;
  89. }
  90. }
  91. .title {
  92. font-weight: bold;
  93. color: #333333;
  94. }
  95. }
  96. .center {
  97. text-align: center;
  98. margin-bottom: 10rpx;
  99. color: #999;
  100. }
  101. .no_data {
  102. position: fixed;
  103. top: 50%;
  104. left: 50%;
  105. transform: translate(-50%, -50%);
  106. color: #999;
  107. font-size: 28rpx;
  108. }
  109. }
  110. .warehouse {
  111. display: flex;
  112. align-items: center;
  113. }
  114. .arrow {
  115. display: inline-block;
  116. position: relative;
  117. width: 50rpx;
  118. height: 10rpx;
  119. margin: 0 20rpx;
  120. &::after,
  121. &::before {
  122. content: '';
  123. position: absolute;
  124. }
  125. &::after {
  126. border-top: 4rpx solid #aaaaaa;
  127. border-right: 4rpx solid #aaaaaa;
  128. width: 12rpx;
  129. height: 12rpx;
  130. right: 0rpx;
  131. top: -6rpx;
  132. transform: rotate(45deg);
  133. }
  134. &::before {
  135. height: 4rpx;
  136. background-color: #aaaaaa;
  137. width: 50rpx;
  138. }
  139. }
  140. </style>