operationRoom.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <div class="hui-flex operation-room">
  3. <div class="hui-flex-box hui-no-tips" v-if="list.length === 0">
  4. <empty description="暂未设置房间"></empty>
  5. </div>
  6. <div class="hui-flex-box operation-room-list" v-else>
  7. <div class="operation-room-item" v-for="(item,index) in list" :key="index">
  8. <div class="operation-room-box">
  9. <div class="operation-room-title">
  10. <i class="iconfont huifont-shouye"></i>
  11. <span class="label">{{item.roomNumber}}</span>
  12. <div>
  13. <div v-if="item.state == 1" class="hui-state">
  14. <span class="hui-state-bage hui-state-primary"></span>
  15. <span class="hui-state-label">空闲</span>
  16. </div>
  17. <div v-if="item.state == 2" class="hui-state">
  18. <span class="hui-state-bage hui-state-common"></span>
  19. <span class="hui-state-label">即将到期</span>
  20. </div>
  21. <div v-if="item.state == 3" class="hui-state">
  22. <span class="hui-state-bage hui-state-success"></span>
  23. <span class="hui-state-label">租赁中</span>
  24. </div>
  25. <div v-if="item.state == 4" class="hui-state">
  26. <span class="hui-state-bage hui-state-error"></span>
  27. <span class="hui-state-label">已逾期</span>
  28. </div>
  29. </div>
  30. </div>
  31. <div class="operation-room-content">
  32. <div class="room-title">
  33. <div class="iconfont-box">
  34. <i class="iconfont huifont-moxingguanli"></i>
  35. </div>
  36. <span class="label">面积</span>
  37. </div>
  38. <div class="room-content">{{item.area}}</div>
  39. <div class="room-title">
  40. <div class="iconfont-box">
  41. <i class="iconfont huifont-zuzhiguanli"></i>
  42. </div>
  43. <span class="label">入驻公司</span>
  44. </div>
  45. <div class="room-content">{{item.merchantName||item.clientName||'-'}}</div>
  46. <div class="room-title">
  47. <div class="iconfont-box">
  48. <i class="iconfont huifont-shijian" style="font-size: 13px;"></i>
  49. </div>
  50. <span class="label">入驻时间</span>
  51. </div>
  52. <div class="room-content">{{item.startDate || '-'}}</div>
  53. <div class="room-title">
  54. <div class="iconfont-box">
  55. <i class="iconfont huifont-shebeiguanli"></i>
  56. </div>
  57. <span class="label">合同日期</span>
  58. </div>
  59. <div class="room-content" style="font-size: 13px;">
  60. {{item.startDate ? (item.startDate+'至'+item.endDate) :'-'}}
  61. </div>
  62. <div class="room-title">
  63. <div class="iconfont-box">
  64. <i class="iconfont huifont-guanlipingtai"></i>
  65. </div>
  66. <span class="label">负责人</span>
  67. </div>
  68. <div class="room-content">{{item.chargePersonName}}</div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </template>
  75. <script>
  76. import {
  77. getHouseListByLevel
  78. } from '@/httpApi/space'
  79. export default {
  80. props: ['target'],
  81. data() {
  82. return {
  83. list: []
  84. }
  85. },
  86. mounted() {
  87. this.init()
  88. },
  89. methods: {
  90. init() {
  91. getHouseListByLevel(this.target.id).then(res => {
  92. if (res.state) {
  93. this.list = res.data.map(node => {
  94. if (node.contractList.length === 0) {
  95. node['state'] = 1;
  96. return node
  97. };
  98. let contract = node.contractList(node.contractList.length - 1);
  99. let state = 3;
  100. let nowDate = this.dayjs(),
  101. endDate = this.$dayjs(contract.endDate);
  102. if (nowDate.isBefore(endDate)) {
  103. state = 4;
  104. } else {
  105. if (endDate.diff(nowDate, 'day') <= 7) state = 2;
  106. }
  107. let obj = {
  108. merchantName: contract.merchantName,
  109. clientName: contract.clientName,
  110. startDate: contract.startDate,
  111. endDate: contract.endDate,
  112. state: state
  113. }
  114. return Object.assign(node, obj);
  115. });
  116. }
  117. })
  118. }
  119. },
  120. }
  121. </script>
  122. <style lang="scss">
  123. .operation-room {
  124. background: $--box-background;
  125. .operation-room-list {
  126. display: flex;
  127. flex-wrap: wrap;
  128. padding: 10px;
  129. align-content: flex-start;
  130. }
  131. .operation-room-title {
  132. height: 40px;
  133. display: flex;
  134. align-items: center;
  135. background: #2B3446;
  136. padding: 0 13px;
  137. border-bottom: 1px solid $--color-border;
  138. .label {
  139. flex: 1;
  140. }
  141. .huifont-shouye {
  142. font-size: 22px;
  143. margin-right: 4px;
  144. }
  145. .hui-state-label {
  146. font-size: 12px;
  147. }
  148. }
  149. .operation-room-item {
  150. padding: 10px;
  151. }
  152. .operation-room-box {
  153. width: 220px;
  154. background: #232A37;
  155. }
  156. .operation-room-content {
  157. padding: 10px 10px 5px 10px;
  158. .iconfont-box {
  159. width: 20px;
  160. text-align: center;
  161. }
  162. .room-title {
  163. opacity: 0.8;
  164. display: flex;
  165. align-items: center;
  166. .label {
  167. font-size: 12px;
  168. }
  169. }
  170. .room-content {
  171. padding: 5px 0 10px 0;
  172. padding-left: 20px;
  173. }
  174. }
  175. }
  176. </style>