replenishmentRecordDetails.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="container">
  3. <u-navbar leftIconColor="#fff" titleStyle="color:#fff;fontSize:36rpx;" :autoBack="true" bgColor="#2C6FF3"
  4. :placeholder="true" title="补货记录详情"></u-navbar>
  5. <view class="topTip">总共补了{{replenishmentList.length}}种商品<!-- 数量是{{total}} --></view>
  6. <scroll-view class="scrollview" :scroll-with-animation="true" scroll-y lower-threshold="100" :style="{'height':fullHeight}">
  7. <view class="replenishmentrecord-container" v-for="(item,index) in replenishmentList" :key="item.id">
  8. <view class="">
  9. 设备商品:{{item.goodsName}}
  10. </view>
  11. <view class="" style="margin-top: 20rpx;">
  12. 设备商品Id:{{item.deviceGoodsId}}
  13. </view>
  14. <view class="flex align-center"
  15. style="margin-top: 15rpx;background-color: #f5f8fb;padding: 10rpx;border-radius: 15rpx;">
  16. <view class="">
  17. <u--image radius='15rpx' :showLoading="true" :src="item.cover" width="80px" height="80px"
  18. @click="click"></u--image>
  19. </view>
  20. <view class="flex flex-direction align-start" style="margin-left: 35rpx;">
  21. <view class="flex align-center justify-around" v-if="item.oldStock!=item.newStock">
  22. <view class="flex flex-sub width">原库存:{{item.oldStock}}</view>
  23. <view class="flex">新库存:{{item.newStock}}</view>
  24. </view>
  25. <view class="flex align-center justify-around" v-if="item.oldStock!=item.newStock">
  26. <view class="flex flex-sub" style="color: red;">补货数量:{{item.newStock-item.oldStock}}</view>
  27. </view>
  28. <view class="flex align-center justify-around" v-if="item.oldCapacity!=item.newCapacity">
  29. <view class="flex flex-sub width">原容量:{{item.oldCapacity}}</view>
  30. <view class="flex">新容量:{{item.newCapacity}}</view>
  31. </view>
  32. <view class="flex align-center justify-around" v-if="item.newPrice!=null&&item.oldPrice!=item.newPrice">
  33. <view class="flex flex-sub width">原价格:¥{{(Number(item.oldPrice)/100).toFixed(2)}}</view>
  34. <view class="flex">新价格:¥{{(Number(item.newPrice)/100).toFixed(2)}}</view>
  35. </view>
  36. <view class="flex align-center justify-around" v-if="item.oldWarning!=item.newWarning">
  37. <view class="flex flex-sub width">原预警值:{{item.oldWarning}}</view>
  38. <view class="flex">新预警值:{{item.newWarning}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </scroll-view>
  44. </view>
  45. </template>
  46. <script>
  47. import {
  48. obj
  49. } from "@/api/replenishment/replenishment.js"
  50. export default {
  51. data() {
  52. return {
  53. replenishmentList: [],
  54. isEmpty: false,
  55. id: '',
  56. total: 0,
  57. fullHeight:0,
  58. }
  59. },
  60. onLoad(e) {
  61. let _this = this;
  62. const query = uni.createSelectorQuery().in(this);
  63. query.select(".scrollview").boundingClientRect((data) => {
  64. uni.getSystemInfo({
  65. success(res) {
  66. _this.fullHeight = 2 * (res.windowHeight - data.top) + 'rpx';
  67. },
  68. });
  69. }).exec();
  70. this.id = e.id
  71. this.getObj()
  72. },
  73. methods: {
  74. getObj() {
  75. obj({
  76. "id": this.id,
  77. "activityId": 0
  78. }).then(res => {
  79. if (res.data.goods == null) {
  80. this.isEmpty = true
  81. }
  82. this.replenishmentList = res.data.goods;
  83. this.replenishmentList.forEach(item => {
  84. this.total = 0
  85. this.total += item.newStock - item.oldStock
  86. })
  87. this.isEmpty = this.replenishmentList.length == 0;
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. page {
  95. background-color: #f7f7f7;
  96. }
  97. </style>
  98. <style lang="scss" scoped>
  99. .container {
  100. .margintop {
  101. margin-top: 20rpx;
  102. }
  103. .marleft {
  104. margin-left: 10rpx;
  105. }
  106. .scrollview {}
  107. .topTip {
  108. padding: 15rpx;
  109. text-align: center;
  110. background-color: #fdf6ec;
  111. color: #faba5a;
  112. }
  113. .empty {
  114. margin-top: 120rpx
  115. }
  116. .width {
  117. width: 220rpx;
  118. }
  119. .magin {
  120. margin: 10rpx 20rpx;
  121. }
  122. .replenishmentrecord-container {
  123. background-color: #fff;
  124. padding: 20rpx;
  125. border-radius: 15rpx;
  126. margin: 0 20rpx 20rpx 20rpx;
  127. box-shadow: 0 5rpx 4rpx rgba(179, 179, 179, 0.3);
  128. }
  129. }
  130. </style>