examineStatus.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="examine-status">
  3. <view class="container-header">
  4. <view v-if="item.createUser" class="container-msg">
  5. <wk-avatar :name="item.createUser.realname" :avatar="item.createUser.img" :size="14" class="avatar" />
  6. <view class="container-user-msg">
  7. <view>{{ item.createUser.realname }}</view>
  8. <view class="time">
  9. {{ item.createTime }}
  10. </view>
  11. </view>
  12. </view>
  13. <template v-if="statusShow[item.examineStatus]">
  14. <view v-if="isList" class="container-header-right">
  15. <text class="status-icon" :class="statusShow[item.examineStatus].color" />
  16. <text>{{ item.categoryTitle }}-{{ statusShow[item.examineStatus].text }}</text>
  17. </view>
  18. <view v-if="!isList" class="status-img">
  19. <!-- 审核状态 -->
  20. <image
  21. :class="statusShow[item.examineStatus].className"
  22. :src="statusShow[item.examineStatus].src"
  23. class="pic" />
  24. </view>
  25. </template>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. export default {
  31. name: 'ExamineStatus',
  32. props: {
  33. // 列表页还是详情页
  34. isList: {
  35. type: Boolean,
  36. default: true
  37. },
  38. item: {
  39. type: Object,
  40. required: true
  41. }
  42. },
  43. data() {
  44. return {
  45. // 审核状态 0 未审核 1 审核通过 2 审核拒绝 3 审核中 4 已撤回
  46. statusShow: {
  47. 0: {text: '待审', src: this.$static('images/oa/examine_await.png'), className: 'await-examine', color: 'warning'},
  48. 1: {text: '通过', src: this.$static('images/oa/examine_pass.png'), className: 'examine-feedback', color: 'success'},
  49. 2: {text: '拒绝', src: this.$static('images/oa/examine_refuse.png'), className: 'examine-feedback', color: 'error'},
  50. 3: {text: '审批中', src: this.$static('images/oa/examining.png'), className: 'await-examine', color: 'warning'},
  51. 4: {text: '撤回', src: this.$static('images/oa/examine_recall.png'), className: 'examine-feedback', color: 'error'},
  52. },
  53. status: 1
  54. }
  55. },
  56. }
  57. </script>
  58. <style lang="scss" scoped>
  59. .examine-status {
  60. background-color: white;
  61. padding: 10rpx 0;
  62. .container-header {
  63. position: relative;
  64. display: flex;
  65. align-items: center;
  66. justify-content: space-between;
  67. .container-msg {
  68. display: flex;
  69. align-items: center;
  70. .avatar {
  71. width: 80rpx;
  72. height: 80rpx;
  73. border-radius: 50%;
  74. }
  75. .container-user-msg {
  76. font-size: 30rpx;
  77. padding-left: 20rpx;
  78. .time {
  79. color: $light;
  80. font-size: 24rpx;
  81. }
  82. }
  83. }
  84. .container-header-right {
  85. display: flex;
  86. align-items: center;
  87. font-size: 26rpx;
  88. .status-icon {
  89. width: 18rpx;
  90. height: 18rpx;
  91. border-radius: 50%;
  92. margin-right: 15rpx;
  93. }
  94. }
  95. .status-img {
  96. position: absolute;
  97. right: 0;
  98. top: 0;
  99. .await-examine {
  100. margin-top: 30rpx;
  101. width: 138rpx;
  102. height: 85rpx;
  103. }
  104. .examine-feedback {
  105. width: 160rpx;
  106. height: 154rpx;
  107. }
  108. }
  109. }
  110. }
  111. .success {
  112. background-color: $success;
  113. }
  114. .warning {
  115. background-color: $warning;
  116. }
  117. .error {
  118. background-color: $error;
  119. }
  120. </style>