card.vue 2.8 KB

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