InventoryItems.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. <!--
  2. * @Author: your name
  3. * @Date: 2021-10-11 10:10:26
  4. * @LastEditTime: 2021-12-02 10:21:07
  5. * @LastEditors: Please set LastEditors
  6. * @Description: 存栏情况 - 下面 item 的数字
  7. * @FilePath: \hyyfClient\src\views\PdcData\analysis\InventoryItems.vue
  8. -->
  9. <template>
  10. <div class="inventory-items">
  11. <inventory-item>
  12. <template v-slot:picture>
  13. <div class="picture01 picture"></div>
  14. </template>
  15. <template v-slot:dataName>
  16. <span>母猪存栏</span>
  17. </template>
  18. <template v-slot:dataNum>
  19. <span>{{ data[0] }}</span>
  20. </template>
  21. </inventory-item>
  22. <inventory-item>
  23. <template v-slot:picture>
  24. <div class="picture02 picture"></div>
  25. </template>
  26. <template v-slot:dataName>
  27. <div>
  28. 妊娠猪存栏
  29. </div>
  30. </template>
  31. <template v-slot:dataNum>
  32. <div>
  33. {{ data[1] }}
  34. </div>
  35. </template>
  36. </inventory-item>
  37. <inventory-item>
  38. <template v-slot:picture>
  39. <div class="picture03 picture"></div>
  40. </template>
  41. <template v-slot:dataName>
  42. <div>
  43. 哺乳母猪存栏
  44. </div>
  45. </template>
  46. <template v-slot:dataNum>
  47. <div>
  48. {{ data[2] }}
  49. </div>
  50. </template>
  51. </inventory-item>
  52. <inventory-item>
  53. <template v-slot:picture>
  54. <div class="parent">
  55. <div class="picture04 picture"></div>
  56. <div class="blank"></div>
  57. </div>
  58. </template>
  59. <template v-slot:dataName>
  60. <div>
  61. 空怀猪存栏
  62. </div>
  63. </template>
  64. <template v-slot:dataNum>
  65. <div>
  66. {{ data[3] }}
  67. </div>
  68. </template>
  69. </inventory-item>
  70. <inventory-item>
  71. <template v-slot:picture>
  72. <div class="picture05 picture"></div>
  73. </template>
  74. <template v-slot:dataName>
  75. <div>
  76. 公猪存栏
  77. </div>
  78. </template>
  79. <template v-slot:dataNum>
  80. <div>
  81. {{ data[4] }}
  82. </div>
  83. </template>
  84. </inventory-item>
  85. <inventory-item>
  86. <template v-slot:picture>
  87. <div class="parent">
  88. <div class="picture06 picture"></div>
  89. <div class="sale"></div>
  90. </div>
  91. </template>
  92. <template v-slot:dataName>
  93. <div>
  94. 商品猪存栏
  95. </div>
  96. </template>
  97. <template v-slot:dataNum>
  98. <div>
  99. {{ data[5] }}
  100. </div>
  101. </template>
  102. </inventory-item>
  103. </div>
  104. </template>
  105. <script>
  106. import InventoryItem from "components/erp/InventoryItem.vue";
  107. export default {
  108. props: {
  109. data: {
  110. type: Array,
  111. default: () => [],
  112. },
  113. },
  114. data() {
  115. return {
  116. getData: [],
  117. };
  118. },
  119. components: {
  120. InventoryItem,
  121. },
  122. mounted() {
  123. // console.log("-----------------------");
  124. // console.log(this.data);
  125. },
  126. watch: {
  127. data: {
  128. handler(newValue) {
  129. this.getData = newValue;
  130. },
  131. deep: true,
  132. },
  133. },
  134. };
  135. </script>
  136. <style scoped>
  137. .inventory-items {
  138. margin: 10px 5px 0px;
  139. display: flex;
  140. }
  141. /* 图片统一格式 */
  142. .picture {
  143. width: 150px;
  144. height: 100px;
  145. }
  146. /* 母猪存栏图片 */
  147. .picture01 {
  148. background: url("~assets/images/erpAnalysis/u3827.svg") no-repeat 50%;
  149. background-size: 50%;
  150. }
  151. /* 妊娠 */
  152. .picture02 {
  153. background: url("~assets/images/erpAnalysis/u3828.svg") no-repeat 50%;
  154. background-size: 50%;
  155. }
  156. /* 哺乳 */
  157. .picture03 {
  158. background: url("~assets/images/erpAnalysis/u3829.svg") no-repeat 50%;
  159. background-size: 50%;
  160. }
  161. /* 空怀 */
  162. .picture04 {
  163. background: url("~assets/images/erpAnalysis/u3831.svg") no-repeat 50%;
  164. background-size: 50%;
  165. }
  166. .parent {
  167. position: relative;
  168. }
  169. .blank {
  170. background: url("~assets/images/erpAnalysis/u3832.svg") no-repeat 50%;
  171. position: absolute;
  172. top: 0;
  173. left: 5px;
  174. width: 150px;
  175. height: 100px;
  176. }
  177. /* 公猪 */
  178. .picture05 {
  179. background: url("~assets/images/erpAnalysis/u3686.svg") no-repeat 50%;
  180. background-size: 50%;
  181. }
  182. /* 商品 */
  183. .picture06 {
  184. background: url("~assets/images/erpAnalysis/u3834.svg") no-repeat 50%;
  185. background-size: 50%;
  186. }
  187. .sale {
  188. background: url("~assets/images/erpAnalysis/u3835.svg") no-repeat 50%;
  189. position: absolute;
  190. top: 30px;
  191. right: 53px;
  192. width: 30px;
  193. height: 30px;
  194. background-size: 80%;
  195. }
  196. </style>