list-item.vue 3.5 KB

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