fxyk-card.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <u-card :style="bgColor" :show-head="showHead" :showFoot="false">
  3. <view v-if="showHead" slot="head" class="card_head">
  4. <u-icon name="order" size="50" class="card_head_one"></u-icon>
  5. <text class="card_head_two">项目信息</text>
  6. </view>
  7. <view v-if="bodyInfo === 1" slot="body" class="u-padding-20 card_body">
  8. <view class="over_style u-margin-bottom-12">项目名称:&ensp;{{ projectInfo.name }}</view>
  9. <view class="over_style u-margin-bottom-12">项目编号:&ensp;{{ projectInfo.code }}</view>
  10. <view class="d-flex u-margin-bottom-12">
  11. <view class="flex-s u-margin-right-20">项目内容:</view>
  12. <view>{{ projectInfo.text }}</view>
  13. </view>
  14. <view class="d-flex u-margin-bottom-12">
  15. <view class="u-margin-right-20">项目规模:</view>
  16. <view>
  17. <view class="u-margin-bottom-12">线路长度:&ensp;{{ projectInfo.large }}</view>
  18. <view>变电容量:&ensp;{{ projectInfo.space }}</view>
  19. </view>
  20. </view>
  21. <view class="u-margin-bottom-12">总投资:&ensp;{{ projectInfo.invest }}</view>
  22. <view class="u-margin-bottom-12">负责人:&ensp;{{ projectInfo.people }}</view>
  23. <view>联系电话:&ensp;{{ projectInfo.phone }}</view>
  24. </view>
  25. <view v-else slot="body">
  26. <view class="d-flex a-center j-center u-margin-left-129 u-margin-bottom-38">
  27. <view class="u-margin-right-20 word-one">额定项目天数:&ensp;{{ projectTime.edTime }}天</view>|
  28. <view class="u-margin-left-20 word-one">已完成天数:&ensp;{{ projectTime.wcTime }}天</view>
  29. </view>
  30. <view style="padding: 0 60rpx">
  31. <fxyk-progress :status="2" :wcDay="projectTime.wcTime" :edDay="projectTime.edTime"/>
  32. </view>
  33. <view class="d-flex j-sb" style="padding: 12rpx 12rpx 8rpx 12rpx">
  34. <view class="word-two">{{ projectTime.start | showtime }}</view>
  35. <view class="word-two">{{ projectTime.end | showtime }}</view>
  36. </view>
  37. </view>
  38. </u-card>
  39. </template>
  40. <script>
  41. import { formatDate } from '@/utils/datetime'
  42. export default {
  43. props: {
  44. // 项目信息数据
  45. projectInfo: {
  46. type: Object,
  47. default: () => {
  48. return {}
  49. }
  50. },
  51. // 项目工期数据
  52. projectTime: {
  53. type: Object,
  54. default: () => {
  55. return {}
  56. }
  57. },
  58. // 是否需要表头
  59. showHead: {
  60. type: Boolean,
  61. default: true
  62. },
  63. // 表体信息 1:项目信息 2:项目工期
  64. bodyInfo: {
  65. type: Number,
  66. default: 1
  67. }
  68. },
  69. computed: {
  70. bgColor() {
  71. if (this.showHead) {
  72. return {'background-color': '#40349C'}
  73. } else {
  74. return {'background-color': '#fff'}
  75. }
  76. }
  77. },
  78. filters: {
  79. showtime(value) {
  80. let date = new Date(value*1000);
  81. return formatDate(date, 'yyyy.MM.dd')
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .card_head {
  88. height: 40rpx;
  89. display: flex;
  90. align-items: center;
  91. .card_head_one {
  92. color: #fff;
  93. margin-right: 10rpx;
  94. }
  95. .card_head_two {
  96. font-size: 27rpx;
  97. font-family: SimSun;
  98. font-weight: 400;
  99. line-height: 38rpx;
  100. color: #FAFAFA;
  101. margin-top: 10rpx;
  102. }
  103. }
  104. .card_body {
  105. font-size: 25rpx;
  106. font-family: SimSun;
  107. font-weight: 400;
  108. line-height: 33rpx;
  109. color: #FFFFFF;
  110. }
  111. .word-one {
  112. font-size: 25rpx;
  113. font-family: SimSun;
  114. font-weight: 400;
  115. color: #000000;
  116. }
  117. .word-two {
  118. font-size: 27rpx;
  119. font-family: SimSun;
  120. font-weight: 400;
  121. line-height: 38rpx;
  122. color: #000000;
  123. }
  124. </style>