CardList.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <!-- 进度组件 -->
  11. <view class="kd-col">
  12. <text class="title">{{ item.code }}</text>
  13. <text>名称:{{ item.name }}</text>
  14. </view>
  15. <view class="kd-col">
  16. <text>报损报溢部门:{{ item.reportDeptName }}</text>
  17. <text>审核人:{{ item.auditName }}</text>
  18. </view>
  19. <view class="kd-col">
  20. <text
  21. class="status"
  22. :class="
  23. statusList[item.status && item.status] &&
  24. statusList[item.status && item.status].class
  25. "
  26. >{{ statusList[item.status] && statusList[item.status].label }}</text
  27. >
  28. <text class="text-danger">创建时间 {{ item.createTime }}</text>
  29. </view>
  30. </view>
  31. <view v-show="list.length === 0" class="no_data">
  32. <u-empty mode="data" textSize="22"></u-empty>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. list: {
  40. type: Array,
  41. default: () => []
  42. }
  43. },
  44. data () {
  45. return {
  46. statusList: {
  47. 1: { class: 'normal', label: '待审核' },
  48. 0: { class: 'text-danger', label: '驳回' },
  49. 3: { class: 'normal', label: '草稿' },
  50. 2: { class: 'text-primary', label: '通过' }
  51. }
  52. }
  53. },
  54. methods: {
  55. goDetail ({ id }) {
  56. uni.navigateTo({
  57. url: `/pages/warehouse/reportLoss/detail?&id=${id}`
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss" scoped>
  64. .marginTop {
  65. border-top: 20rpx solid $page-bg;
  66. .kd-row {
  67. font-size: 28rpx;
  68. padding: 14rpx 12rpx 6rpx;
  69. border-bottom: 1rpx solid $page-bg;
  70. .kd-col {
  71. display: flex;
  72. justify-content: space-between;
  73. align-items: center;
  74. padding: 2rpx;
  75. color: #aaaaaa;
  76. .status {
  77. display: inline-block;
  78. padding: 4rpx 10rpx;
  79. border-radius: 18rpx;
  80. &.normal {
  81. background-color: $page-bg;
  82. }
  83. &.text-danger {
  84. background-color: rgba($color: $uni-color-order-error, $alpha: 0.1);
  85. }
  86. &.text-primary {
  87. background-color: rgba($color: $j-primary-green, $alpha: 0.1);
  88. }
  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. </style>