CardList.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. <!-- 进度组件 -->
  5. <view class="kd-col">
  6. <text class="title">{{ item.code }}</text>
  7. <text>名称:{{ item.name }}</text>
  8. </view>
  9. <view class="kd-col">
  10. <text>报损报溢部门:{{ item.executeGroupName }}</text>
  11. <text>报损报溢人:{{ item.executorName }}</text>
  12. </view>
  13. <view class="kd-col">
  14. <text class="status" :class="statusList[item.status && item.status] && statusList[item.status && item.status].class">{{ statusList[item.status] && statusList[item.status].label }}</text>
  15. <text class="text-danger">报损报溢时间 {{ item.createTime }}</text>
  16. </view>
  17. <view class="kd-col">
  18. <text>仓库:{{ item.warehouseName }}</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. 0: { class: 'text-danger', label: '待审核' },
  38. 1: { class: 'normal', label: '审核中' },
  39. 2: { class: 'text-primary', label: '已审核' }
  40. }
  41. }
  42. },
  43. methods: {
  44. goDetail({ id }) {
  45. uni.navigateTo({
  46. url: `/pages/warehouse/reportLoss/detail?&id=${id}`
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. .marginTop {
  54. border-top: 20rpx solid $page-bg;
  55. .kd-row {
  56. font-size: 28rpx;
  57. padding: 14rpx 12rpx 6rpx;
  58. border-bottom: 1rpx solid $page-bg;
  59. .kd-col {
  60. display: flex;
  61. justify-content: space-between;
  62. align-items: center;
  63. padding: 2rpx;
  64. color: #aaaaaa;
  65. .status {
  66. display: inline-block;
  67. padding: 4rpx 10rpx;
  68. border-radius: 18rpx;
  69. &.normal {
  70. background-color: $page-bg;
  71. }
  72. &.text-danger {
  73. background-color: rgba($color: $uni-color-order-error, $alpha: 0.1);
  74. }
  75. &.text-primary {
  76. background-color: rgba($color: $j-primary-green, $alpha: 0.1);
  77. }
  78. }
  79. }
  80. .title {
  81. font-weight: bold;
  82. color: #333333;
  83. }
  84. }
  85. .center {
  86. text-align: center;
  87. margin-bottom: 10rpx;
  88. color: #999;
  89. }
  90. .no_data {
  91. position: fixed;
  92. top: 50%;
  93. left: 50%;
  94. transform: translate(-50%, -50%);
  95. color: #999;
  96. font-size: 28rpx;
  97. }
  98. }
  99. </style>