DeliveryRoom.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <div class="deliveryRoom">
  3. <section class="section">
  4. <ul class="ul">
  5. <li @click="toDetail(item.type, '产房00'+(index+1))" class="li" v-for="(item, index) in list" :key="index">
  6. <h5>产房00{{ index+1 }}</h5>
  7. <img class="img" :src="typeImgUrl[item.type - 1]" />
  8. <p v-if="item.type == 1" class="info fontC">空床时间{{ 4 }}天</p>
  9. <div class="info" v-if="item.type == 2">
  10. <p class="p">
  11. <span class="title">母猪耳标:</span>
  12. <span class="content">{{ item.id }}</span>
  13. </p>
  14. <p class="p">
  15. <span class="title">入床时间:</span>
  16. <span class="content">2020-07-25</span>
  17. </p>
  18. <p class="p">
  19. <span class="title">预计产仔:</span>
  20. <span class="content">2020-08-1</span>
  21. </p>
  22. </div>
  23. <div class="info" v-else-if="item.type == 3">
  24. <p class="p">
  25. <span class="title">母猪耳标:</span>
  26. <span class="content">{{ item.id }}</span>
  27. </p>
  28. <p class="p">
  29. <span class="title">产子时间:</span>
  30. <span class="content">2020-07-20</span>
  31. </p>
  32. <p class="p">
  33. <span class="title">仔猪日龄:</span>
  34. <span class="content">10天</span>
  35. </p>
  36. <p class="p">
  37. <span class="title">产仔数:</span>
  38. <span class="content">9</span>
  39. </p>
  40. </div>
  41. <div class="info" v-else-if="item.type == 4">
  42. <p class="p">
  43. <span class="title">母猪耳标:</span>
  44. <span class="content">{{ item.id }}</span>
  45. </p>
  46. <p class="p">
  47. <span class="title">断奶时间:</span>
  48. <span class="content">2020-07-20</span>
  49. </p>
  50. <p class="p">
  51. <span class="title">断奶活仔数:</span>
  52. <span class="content">8</span>
  53. </p>
  54. <p class="p">
  55. <span class="title">断奶活仔率:</span>
  56. <span class="content">98%</span>
  57. </p>
  58. </div>
  59. </li>
  60. </ul>
  61. <el-row type="flex" justify="center">
  62. <el-col :span="8" class="pagination">
  63. <el-pagination
  64. @current-change="pageChange"
  65. background
  66. layout="prev, pager, next"
  67. :page-count="1"
  68. ></el-pagination>
  69. </el-col>
  70. </el-row>
  71. </section>
  72. </div>
  73. </template>
  74. <script>
  75. import typeImgUrl_1 from "@/assets/deliveryRoom_1.jpg";
  76. import typeImgUrl_2 from "@/assets/deliveryRoom_2.jpg";
  77. import typeImgUrl_3 from "@/assets/deliveryRoom_3.jpg";
  78. import typeImgUrl_4 from "@/assets/deliveryRoom_4.jpg";
  79. // import { reqDeliveryRoomList } from "@/api/deliveryRoomManagement.js"
  80. // 每页数据条数
  81. const pageSize = 10;
  82. let list = [
  83. {
  84. type: 1,
  85. id: 16532
  86. },
  87. {
  88. type: 4,
  89. id: 16546
  90. },
  91. {
  92. type: 3,
  93. id: 16548
  94. },
  95. {
  96. type: 4,
  97. id: 16566
  98. },
  99. {
  100. type: 2,
  101. id: 16596
  102. },
  103. {
  104. type: 3,
  105. id: 16540
  106. },
  107. {
  108. type: 3,
  109. id: 16551
  110. }
  111. ];
  112. export default {
  113. name: "deliveryRoom",
  114. data() {
  115. return {
  116. list,
  117. typeImgUrl: [
  118. typeImgUrl_1,
  119. typeImgUrl_2,
  120. typeImgUrl_3,
  121. typeImgUrl_4
  122. ],
  123. pageSize,
  124. page: 1
  125. };
  126. },
  127. created() {
  128. },
  129. methods: {
  130. toDetail(type, roomNum) {
  131. // if(type == 1) {
  132. // this.$message.warning("产床为空!")
  133. // return
  134. // }
  135. this.$router.push({path: "Detail",query: {type,roomNum}})
  136. },
  137. pageChange(p) {
  138. console.log(p);
  139. this.page = p;
  140. // this.getDeviceList();
  141. }
  142. }
  143. };
  144. </script>
  145. <style lang="scss" scoped>
  146. .deliveryRoom {
  147. .section {
  148. background-color: #eee;
  149. .ul {
  150. display: flex;
  151. flex-direction: row;
  152. flex-wrap: wrap;
  153. .li {
  154. background-color: #fff;
  155. border: 2px solid #fff;
  156. padding: 5px;
  157. margin: 6px;
  158. display: flex;
  159. flex-direction: column;
  160. width: 200px;
  161. height: 420px;
  162. h5 {
  163. text-align: center;
  164. font-size: 30px;
  165. color: #424242;
  166. background-color: #D2E4F0;
  167. }
  168. .img {
  169. width: 100%;
  170. }
  171. .info {
  172. flex: 1;
  173. display: flex;
  174. padding-left: 20px;
  175. flex-direction: column;
  176. justify-content: space-around;
  177. .p {
  178. .title {
  179. font-size: 14px;
  180. font-weight: 600;
  181. color: rgb(136, 127, 127);
  182. }
  183. .content {
  184. color: #777;
  185. }
  186. }
  187. }
  188. .fontC {
  189. align-items: center;
  190. padding-left: 0px;
  191. color: rgb(80, 183, 231);
  192. font-size: 20px;
  193. font-weight: 600;
  194. }
  195. }
  196. .li:hover{
  197. border: 2px solid #32ADF4;
  198. }
  199. }
  200. }
  201. }
  202. // border: 1px solid #00f;
  203. .pagination {
  204. margin-top: 5px;
  205. }
  206. </style>