fxyk-timeline.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="d-flex">
  3. <view class="flex-s tag" :style="projectInfo[1]" >{{ projectInfo[0] }}</view>
  4. <u-time-line-item nodeTop="2" class="u-margin-left-62 u-margin-bottom-0">
  5. <!-- 此处自定义了左边内容,用一个图标替代 -->
  6. <template v-slot:node>
  7. <!-- 此处为uView的icon组件 -->
  8. <u-icon class="icon-bgcolor" name="checkmark-circle-fill" :size="42" :color="projectInfo[2]"></u-icon>
  9. </template>
  10. <template v-slot:content>
  11. <view class="card-style">
  12. <view class="d-flex">
  13. <view class="word-one">{{ projectPlan }}</view>
  14. <view>
  15. <text class="word-two">
  16. <text>2019.6.7</text>
  17. -
  18. <text>2019.6.9</text>
  19. </text>
  20. <text class="word-three">营销部</text>
  21. <view class="word-four u-maring-top-12">额定天数: 4天</view>
  22. <view class="d-flex" style="margin-top:8rpx">
  23. <view class="word-four">实际天数: 4天</view>
  24. <view class="word-five" @click.stop="jump_project_info_point_order"><text>批示</text></view>
  25. <view class="word-six"><text>查看附件</text></view>
  26. </view>
  27. </view>
  28. </view>
  29. <!-- <view class="word-seven">逾期原因:现场施工逾期一天完成</view> -->
  30. </view>
  31. <u-line v-if="projectIndex !== 9" style="margin-left: -15rpx;" length="560rpx" color="black" margin="10.5rpx" border-style="dashed"/>
  32. </template>
  33. </u-time-line-item>
  34. </view>
  35. </template>
  36. <script>
  37. export default {
  38. props: {
  39. // 是否逾期 决定左侧文字背景颜色 图标颜色 进程颜色 实际天数颜色 逾期原因的展示
  40. // 1 如期完成 2 预期完成 3项目终止
  41. projectStatus: {
  42. type: [ Number, String ],
  43. default: 1
  44. },
  45. // 项目进度
  46. projectIndex: {
  47. type: [ Number, String ],
  48. default: 1
  49. },
  50. // 项目数据
  51. // projectData: {
  52. // type: Object,
  53. // default: () => {
  54. // return {}
  55. // }
  56. // }
  57. },
  58. computed: {
  59. projectInfo() {
  60. if ( parseInt(this.projectStatus) === 1 ) {
  61. return ['如期完成', {'background-color': '#4CB1FF'}, '#4CB1FF']
  62. } else if ( parseInt(this.projectStatus) === 2 ) {
  63. return ['逾期完成', {'background-color': '#F17E38'}, '#F17E38']
  64. } else {
  65. return ['项目终止', {'background-color': '#FF0014'}, '#FF0014']
  66. }
  67. },
  68. projectPlan() {
  69. switch(parseInt(this.projectIndex)) {
  70. case 1:
  71. return '立项审批'
  72. case 2:
  73. return '设计委托'
  74. case 3:
  75. return '初设评审'
  76. case 4:
  77. return '占地进度'
  78. case 5:
  79. return '现场施工'
  80. case 6:
  81. return '竣工验收'
  82. case 7:
  83. return '物资管理'
  84. case 8:
  85. return '工程结算'
  86. case 9:
  87. return '资料归档'
  88. }
  89. }
  90. },
  91. methods: {
  92. // 跳到节点批示页
  93. jump_project_info_point_order() {
  94. uni.navigateTo({
  95. url: '/pages/index/projectInfoPointOrder'
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss" scoped>
  102. .tag {
  103. width: 110rpx;
  104. height: 33rpx;
  105. border-radius: 8rpx;
  106. text-align: center;
  107. line-height: 33rpx;
  108. font-size: 21rpx;
  109. font-family: SimSun;
  110. color: #FFFFFF;
  111. margin-top:5rpx;
  112. }
  113. .icon-bgcolor {
  114. background-color: #F7FBFF;
  115. }
  116. .card-style{
  117. width: 560rpx;
  118. height: 130rpx;
  119. background: #FFFFFF;
  120. box-shadow: 0rpx 2rpx 13rpx rgba(0, 0, 0, 0.16);
  121. border-radius: 17rpx;
  122. margin-left: -15rpx;
  123. padding: 12rpx 5rpx;
  124. .word-one {
  125. width: 117rpx;
  126. height: 29rpx;
  127. font-size: 29rpx;
  128. font-family: SimSun;
  129. font-weight: 400;
  130. line-height: 40rpx;
  131. color: #000000;
  132. margin-right: 27rpx;
  133. }
  134. .word-two {
  135. width: 213rpx;
  136. height: 25rpx;
  137. font-size: 25rpx;
  138. font-family: SimSun;
  139. font-weight: 400;
  140. line-height: 33rpx;
  141. color: #000000;
  142. margin-right: 54rpx;
  143. }
  144. .word-three {
  145. width: 75rpx;
  146. height: 25rpx;
  147. font-size: 25rpx;
  148. font-family: SimSun;
  149. font-weight: 400;
  150. line-height: 33rpx;
  151. color: #000000;
  152. }
  153. .word-four {
  154. width: 163rpx;
  155. height: 25rpx;
  156. font-size: 25rpx;
  157. font-family: SimSun;
  158. font-weight: 400;
  159. line-height: 33rpx;
  160. color: #000000;
  161. }
  162. .word-five {
  163. width: 63rpx;
  164. height: 33rpx;
  165. background: #4CB2FF;
  166. border-radius: 8rpx;
  167. font-size: 21rpx;
  168. font-family: SimSun;
  169. font-weight: 400;
  170. line-height: 33rpx;
  171. color: #FFFFFF;
  172. text-align: center;
  173. margin-left: 60rpx;
  174. }
  175. .word-six {
  176. width: 106rpx;
  177. height: 33rpx;
  178. background: #4CB2FF;
  179. border-radius: 8rpx;
  180. font-size: 21rpx;
  181. font-family: SimSun;
  182. font-weight: 400;
  183. line-height: 33rpx;
  184. color: #FFFFFF;
  185. text-align: center;
  186. margin-left: 17rpx;
  187. }
  188. .word-seven {
  189. width: 375rpx;
  190. height: 25rpx;
  191. font-size: 25rpx;
  192. font-family: SimSun;
  193. font-weight: 400;
  194. line-height: 25rpx;
  195. color: #F97D35;
  196. margin-top: 10rpx;
  197. margin-left: 35rpx;
  198. }
  199. }
  200. </style>