list-item.vue 4.1 KB

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