fxyk-timeline.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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="projectInfo[3]" :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) === 0 ) {
  61. return ['进行中', {'background-color': '#E7AE5E'}, '#E7AE5E','clock-fill']
  62. } else if ( parseInt(this.projectStatus) === 1 ) {
  63. return ['逾期完成', {'background-color': '#4CB1FF'}, '#4CB1FF','checkmark-circle-fill']
  64. } else if ( parseInt(this.projectStatus) === 2 ) {
  65. return ['逾期完成', {'background-color': '#F17E38'}, '#F17E38','checkmark-circle-fill']
  66. } else {
  67. return ['项目终止', {'background-color': '#FF0014'}, '#FF0014','close-circle-fill']
  68. }
  69. },
  70. projectPlan() {
  71. switch(parseInt(this.projectIndex)) {
  72. case 1:
  73. return '立项审批'
  74. case 2:
  75. return '设计委托'
  76. case 3:
  77. return '初设评审'
  78. case 4:
  79. return '占地进度'
  80. case 5:
  81. return '现场施工'
  82. case 6:
  83. return '竣工验收'
  84. case 7:
  85. return '物资管理'
  86. case 8:
  87. return '工程结算'
  88. case 9:
  89. return '资料归档'
  90. }
  91. }
  92. },
  93. methods: {
  94. // 跳到节点批示页
  95. jump_project_info_point_order() {
  96. uni.navigateTo({
  97. url: '/pages/index/projectInfoPointOrder'
  98. })
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .tag {
  105. width: 110rpx;
  106. height: 36rpx;
  107. border-radius: 8rpx;
  108. text-align: center;
  109. line-height: 36rpx;
  110. font-size: 21rpx;
  111. font-family: SimSun;
  112. color: #FFFFFF;
  113. margin-top:5rpx;
  114. }
  115. .icon-bgcolor {
  116. background-color: #F7FBFF;
  117. }
  118. .card-style{
  119. width: 560rpx;
  120. height: 130rpx;
  121. background: #FFFFFF;
  122. box-shadow: 0rpx 2rpx 13rpx rgba(0, 0, 0, 0.16);
  123. border-radius: 17rpx;
  124. margin-left: -15rpx;
  125. padding: 12rpx 5rpx;
  126. .word-one {
  127. width: 117rpx;
  128. height: 29rpx;
  129. font-size: 29rpx;
  130. font-family: SimSun;
  131. font-weight: 400;
  132. line-height: 40rpx;
  133. color: #000000;
  134. margin-right: 27rpx;
  135. }
  136. .word-two {
  137. width: 213rpx;
  138. height: 25rpx;
  139. font-size: 25rpx;
  140. font-family: SimSun;
  141. font-weight: 400;
  142. line-height: 33rpx;
  143. color: #000000;
  144. margin-right: 54rpx;
  145. }
  146. .word-three {
  147. width: 75rpx;
  148. height: 25rpx;
  149. font-size: 25rpx;
  150. font-family: SimSun;
  151. font-weight: 400;
  152. line-height: 33rpx;
  153. color: #000000;
  154. }
  155. .word-four {
  156. width: 163rpx;
  157. height: 25rpx;
  158. font-size: 25rpx;
  159. font-family: SimSun;
  160. font-weight: 400;
  161. line-height: 33rpx;
  162. color: #000000;
  163. }
  164. .word-five {
  165. width: 63rpx;
  166. height: 33rpx;
  167. background: #4CB2FF;
  168. border-radius: 8rpx;
  169. font-size: 21rpx;
  170. font-family: SimSun;
  171. font-weight: 400;
  172. line-height: 33rpx;
  173. color: #FFFFFF;
  174. text-align: center;
  175. margin-left: 60rpx;
  176. }
  177. .word-six {
  178. width: 106rpx;
  179. height: 33rpx;
  180. background: #4CB2FF;
  181. border-radius: 8rpx;
  182. font-size: 21rpx;
  183. font-family: SimSun;
  184. font-weight: 400;
  185. line-height: 33rpx;
  186. color: #FFFFFF;
  187. text-align: center;
  188. margin-left: 17rpx;
  189. }
  190. .word-seven {
  191. width: 375rpx;
  192. height: 25rpx;
  193. font-size: 25rpx;
  194. font-family: SimSun;
  195. font-weight: 400;
  196. line-height: 25rpx;
  197. color: #F97D35;
  198. margin-top: 10rpx;
  199. margin-left: 35rpx;
  200. }
  201. }
  202. </style>