up2.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <div id="up2">
  3. <div class="bg-color-black">
  4. <div class="up mt-4">
  5. <div class="d-flex pt-1 pl-2 jc-center mb-5">
  6. <span class="fs-xxl text mx-2 fw-b">出入库情况</span>
  7. </div>
  8. <div class="body-box d-flex">
  9. <div class="item d-flex jc-center flex-column">
  10. <div class="location">
  11. <div class="circle-hollow">
  12. <div class="info">
  13. <h2 class="pb-2">{{inQty}}</h2>
  14. <p class="fs-xxl pt-2">
  15. 入库数量
  16. </p>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="item d-flex jc-center flex-column">
  22. <div class="circle-hollow">
  23. <div class="info">
  24. <h2 class="pb-2">{{outQty}}</h2>
  25. <p class="fs-xxl pt-2">
  26. 出货数量
  27. </p>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. <div class="down">
  34. <div class="body-box">
  35. <div class="d-flex jc-center fs-xxl fw-b rate flex-column">
  36. <div>需备料单据数:{{finishQty}} </div>
  37. <div class="mt-3">已完成备料数:{{unfinishQty}}</div>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {
  48. timing:null,
  49. finishQty:0,
  50. unfinishQty:0,
  51. inQty:10000,
  52. outQty:10000,
  53. }
  54. },
  55. components: {},
  56. mounted() {
  57. this.refreshdata();
  58. },
  59. beforeDestroy () {
  60. clearInterval(this.timing)
  61. },
  62. methods: {
  63. refreshdata() {
  64. this.setdata(); //获取数据
  65. this.timing = setInterval(() => {
  66. this.setdata(); //获取-主题词
  67. }, 15000);
  68. },
  69. async setdata() {
  70. this.finishQty = 0;
  71. this.unfinishQty = 0;
  72. this.inQty = 0;
  73. this.outQty = 0;
  74. //备料完成情况
  75. caller = 'KB!WHPREMADEData1';
  76. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  77. params: {
  78. condition: "1=1"
  79. }
  80. }).then((result) => {
  81. let dataList = JSON.parse(result.data.data);
  82. if(dataList.length>0){
  83. this.inQty = dataList[0].inqty;
  84. this.outQty = dataList[0].outqty;
  85. }
  86. }, (result) => {
  87. console.error(result)
  88. }
  89. );
  90. //备料单据数
  91. var caller = 'KB!WHPREMADEData2';
  92. await this.$http.get("kanban/datalist.action?caller="+caller+"&_noc=1&page=1&pageSize=100",{
  93. params: {
  94. condition: "1=1"
  95. }
  96. }).then((result) => {
  97. let dataList = JSON.parse(result.data.data);
  98. if(dataList.length>0){
  99. this.finishQty = dataList[0].finishqty;
  100. this.unfinishQty = dataList[0].unfinishqty;
  101. }
  102. }, (result) => {
  103. console.error(result)
  104. }
  105. );
  106. }
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. $box-height: 475px;
  112. $box-width: 100%;
  113. #up2 {
  114. padding: 13px;
  115. // padding: 5px;
  116. height: $box-height;
  117. width: $box-width;
  118. border-radius: 5px;
  119. .bg-color-black {
  120. padding: 5px;
  121. height: $box-height - 25px;
  122. // width: width - 5px;
  123. border-radius: 10px;
  124. }
  125. .text {
  126. color: #c3cbde;
  127. font-size: 25px;
  128. }
  129. .down {
  130. width: 100%;
  131. margin-top: 60px;
  132. .rate{
  133. justify-content: center; /* 水平居中 */
  134. align-items: center;
  135. }
  136. }
  137. .up{
  138. .body-box {
  139. margin-top: 30px;
  140. flex-wrap: wrap;
  141. justify-content: space-around;
  142. }
  143. .item {
  144. width: 50%;
  145. align-items: center;
  146. /*.location{
  147. position: absolute;
  148. left: 20%;
  149. }*/
  150. .circle-hollow {
  151. width: 170px;
  152. height: 170px;
  153. border: 3px solid #4ecdc4; /* 边框样式 */
  154. border-radius: 50%;
  155. background-color: transparent; /* 透明背景 */
  156. display: flex;
  157. justify-content: center;
  158. align-items: center;
  159. letter-spacing:2px;
  160. flex-direction: column; /* 文字垂直排列 */
  161. box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* 阴影效果 */
  162. .info{
  163. text-align: center;
  164. width: 140px;
  165. p{
  166. border-top: 1px solid #ddd;
  167. }
  168. }
  169. }
  170. }
  171. }
  172. .body-box {
  173. border-radius: 10px;
  174. .percent {
  175. width: 100%;
  176. display: flex;
  177. flex-wrap: wrap;
  178. .item {
  179. width: 33.3%;
  180. height: 120px;
  181. span {
  182. //margin-top: 8px;
  183. font-size: 20px;
  184. display: flex;
  185. justify-content: center;
  186. }
  187. }
  188. }
  189. }
  190. }
  191. </style>