ing.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="implementing-container">
  3. <div class="implementing-title">
  4. <img src="@/assets/images/nz.png" class="title-icon" />
  5. 进行中的实施服务
  6. </div>
  7. <vueSeamless
  8. :data="data"
  9. :class-option="optionScroll"
  10. class="implementing-list"
  11. >
  12. <div
  13. v-for="(item, index) in data"
  14. :key="index"
  15. class="implementing-item"
  16. :class="{ 'even-item': index % 2 === 1 }"
  17. >
  18. <el-row class="item-content">
  19. <el-col :span="3" class="item-date">{{
  20. dayjsObj(item.created_at)
  21. }}</el-col>
  22. <el-col :span="3" class="item-city">
  23. {{ item | safeGet("residence.location.region_name", "-") }}
  24. </el-col>
  25. <el-col :span="7" class="project-info">
  26. <div class="project-name">
  27. {{ item | safeGet("residence.residence_name", "-") }}
  28. </div>
  29. <div class="company-name">
  30. {{ item | safeGet("service.customer.customer_name", "-") }}
  31. </div>
  32. </el-col>
  33. <el-col :span="11" class="project-stats">
  34. <el-row class="project-row">
  35. <el-col :span="3" class="stat-item" style="text-align: right">
  36. <span class="stat-value">{{
  37. item | safeGet("residence_contracted_households", "-")
  38. }}</span>
  39. <span class="stat-label">户</span>
  40. </el-col>
  41. <el-col :span="4" class="stat-item">
  42. <span class="stat-value">{{
  43. item | safeGet("service.liable_person.real_name", "-")
  44. }}</span>
  45. </el-col>
  46. <el-col :span="3" class="stat-item">
  47. <div class="progress-wrapper">
  48. <span class="progress-text"
  49. >{{ item | safeGet("service.perform_ratio", "-") }}%</span
  50. >
  51. </div>
  52. </el-col>
  53. <el-col :span="10" class="stat-item service-item">
  54. <span class="service-content">{{
  55. item | safeGet("service.work_template.display_name", "-")
  56. }}</span>
  57. </el-col>
  58. <el-col :span="4" class="stat-item">
  59. <span class="period text-overflow">{{ item.updated_at }}</span>
  60. </el-col>
  61. </el-row>
  62. </el-col>
  63. </el-row>
  64. </div>
  65. </vueSeamless>
  66. </div>
  67. </template>
  68. <script>
  69. import dayjs from "dayjs"
  70. import { mapState } from "vuex"
  71. import vueSeamless from "vue-seamless-scroll"
  72. export default {
  73. name: "ImplementingServices",
  74. components: {
  75. vueSeamless,
  76. },
  77. props: {
  78. data: {
  79. type: Array,
  80. default: () => [],
  81. },
  82. },
  83. data() {
  84. return {}
  85. },
  86. computed: {
  87. ...mapState(["entCode", "communityId"]),
  88. optionScroll() {
  89. return {
  90. singleHeight: 68,
  91. waitTime: 5000
  92. }
  93. },
  94. },
  95. methods: {
  96. dayjsObj(date) {
  97. return dayjs(date).format("YYYY-MM-DD")
  98. },
  99. },
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. @import "@/assets/css/theme.scss";
  104. .implementing-container {
  105. background: var(--content-bg);
  106. border-radius: var(--radius);
  107. display: flex;
  108. flex-direction: column;
  109. }
  110. .implementing-title {
  111. background: var(--title-bg);
  112. font-size: halfW(14);
  113. color: var(--title-primary);
  114. padding: halfH(4) halfW(10);
  115. border-radius: var(--radius);
  116. display: flex;
  117. align-items: center;
  118. }
  119. .implementing-list {
  120. flex: 1;
  121. overflow-y: auto;
  122. padding: 0px halfW(10);
  123. height: calc(100% - halfH(36));
  124. }
  125. .implementing-item {
  126. background: var(--content-bg); // 第一个项目使用--content-bg
  127. padding: 16px;
  128. &:last-child {
  129. margin-bottom: 0;
  130. }
  131. }
  132. // 偶数项使用--title-bg作为背景色
  133. .implementing-item.even-item {
  134. background: var(--title-bg);
  135. }
  136. .item-content {
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. gap: halfW(10);
  141. .item-date {
  142. color: var(--title-secondary);
  143. font-size: halfW(14);
  144. }
  145. .item-city {
  146. color: var(--title-primary);
  147. font-size: halfW(14);
  148. font-weight: 500;
  149. width: halfW(80);
  150. padding: halfH(2) 0px;
  151. border-radius: var(--radius);
  152. }
  153. .project-info {
  154. flex: 1 1 0%;
  155. text-align: left;
  156. .project-name {
  157. flex: 0 0 1;
  158. color: var(--title-primary);
  159. font-size: halfW(14);
  160. margin-bottom: halfH(8);
  161. font-weight: 400;
  162. }
  163. .company-name {
  164. color: var(--title-secondary);
  165. font-size: halfW(14);
  166. white-space: nowrap;
  167. overflow: hidden;
  168. text-overflow: ellipsis;
  169. }
  170. }
  171. .project-stats {
  172. .project-row {
  173. display: flex;
  174. align-items: center;
  175. flex-wrap: nowrap;
  176. gap: halfW(10);
  177. }
  178. }
  179. .stat-item {
  180. // flex: 1 1 0%;
  181. display: flex;
  182. align-items: center;
  183. text-align: left;
  184. // width: halfW(50);
  185. &:first-child {
  186. .stat-value {
  187. color: var(--primary);
  188. }
  189. }
  190. .stat-value {
  191. color: #fff;
  192. font-size: halfW(14);
  193. font-weight: 500;
  194. margin-right: halfW(4);
  195. }
  196. .stat-label {
  197. color: #fff;
  198. font-size: halfW(14);
  199. }
  200. .progress-wrapper {
  201. display: flex;
  202. align-items: center;
  203. gap: halfW(8);
  204. .progress-text {
  205. color: #40d9ac;
  206. font-size: halfW(14);
  207. font-weight: 500;
  208. width: halfW(35);
  209. }
  210. }
  211. .service-content {
  212. color: #ffffff;
  213. font-size: halfW(14);
  214. }
  215. .period {
  216. color: #a0b3d6;
  217. font-size: halfW(14);
  218. text-align: right;
  219. }
  220. }
  221. .service-item {
  222. min-width: halfW(100);
  223. .service-content {
  224. white-space: nowrap;
  225. overflow: hidden;
  226. text-overflow: ellipsis;
  227. }
  228. }
  229. }
  230. </style>