list-item.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="mission-list-item" @click="gotoDetails(task.id)">
  3. <view v-if="!isDetails && !isComplete" class="time">
  4. <text class="com-text">{{ task.recordTime }}</text>
  5. </view>
  6. <view class="card">
  7. <view class="top-box">
  8. <view v-show="!isDetails" :class="['bg-box', isComplete ? 'disabled-bg' : 'hight-bg']">
  9. <text>{{isComplete ? '改善结案' : '改善中'}}</text>
  10. </view>
  11. <text class="title">{{ task.checkPointName }}</text>
  12. <view class="row">
  13. <view class="col">
  14. <image class="com-icon" src="/static/search-icon.png"></image>
  15. <text class="com-text">{{ task.checkPlan }}</text>
  16. </view>
  17. <view class="col">
  18. <image class="com-icon" src="/static/location-icon.png"></image>
  19. <text class="com-text">{{ task.deptName }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="bottom-box">
  24. <text class="com-text">情境名称:{{ task.situationName }}</text>
  25. <text class="com-text">改善人:{{ task.improveEmpName }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props: {
  33. // 当前遍历的任务
  34. task: {
  35. type: Object,
  36. default: () => {
  37. return {}
  38. }
  39. },
  40. // 是否结案
  41. isComplete: {
  42. type: Boolean,
  43. default: false
  44. },
  45. // 是否是详情页面
  46. isDetails: {
  47. type: Boolean,
  48. default: false
  49. }
  50. },
  51. computed: {
  52. bgImage(){
  53. return `../../../static/${!this.isComplete ? 'hight' : 'disabled'}-bg.png`;
  54. }
  55. },
  56. methods: {
  57. // 跳转详情页面(改善任务)
  58. gotoDetails(id){
  59. uni.navigateTo({
  60. url: `/pages/mission-details/mission-details?taskId=${id}`
  61. });
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="less">
  67. .mission-list-item {
  68. margin-bottom: 25rpx;
  69. overflow: hidden;
  70. .time {
  71. height: 47.5rpx;
  72. line-height: 45rpx;
  73. padding-left: 25rpx;
  74. }
  75. .card {
  76. position: relative;
  77. display: flex;
  78. flex-direction: column;
  79. height: 203.75rpx;
  80. background-color: #fff;
  81. padding: 0 25rpx;
  82. .top-box {
  83. display: flex;
  84. flex-direction: column;
  85. justify-content: space-between;
  86. flex: 1;
  87. margin-top: 35rpx;
  88. margin-bottom: 28.12rpx;
  89. }
  90. .title {
  91. line-height: 25rpx;
  92. font-size: 25rpx;
  93. font-weight: bold;
  94. color: #292C33;
  95. }
  96. .row {
  97. display: flex;
  98. align-items: center;
  99. .col {
  100. display: flex;
  101. align-items: center;
  102. height: 20rpx;
  103. &:first-child {
  104. margin-right: 50rpx;
  105. }
  106. .com-icon {
  107. margin-right: 9.37rpx;
  108. width: 20rpx;
  109. height: 20rpx;
  110. }
  111. }
  112. }
  113. .bottom-box {
  114. display: flex;
  115. justify-content: space-between;
  116. align-items: center;
  117. height: 70rpx;
  118. border-top: 0.62rpx solid #DADEE6;
  119. }
  120. .bg-box {
  121. position: absolute;
  122. top: 0;
  123. right: 0;
  124. width: 112.5rpx;
  125. height: 35rpx;
  126. background-size: 100% 100%;
  127. padding-left: 12.5rpx;
  128. text-align: center;
  129. >text {
  130. line-height: 35rpx;
  131. font-size: 17.5rpx;
  132. color: #fff;
  133. }
  134. }
  135. .hight-bg {
  136. background-image: url('~@/static/hight-bg.png');
  137. }
  138. .disabled-bg {
  139. background-image: url('~@/static/disabled-bg.png');
  140. }
  141. }
  142. .com-text {
  143. font-size: 22.5rpx;
  144. color: #666F80;
  145. }
  146. }
  147. </style>