inventory.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="order-list content">
  3. <view class="swiper-box">
  4. <template v-if="content.materialShelves.length">
  5. <view class="order-card shelf-card" v-for="item in content.materialShelves" :key="item.id">
  6. <view class="order-info">
  7. <p class="info-line">
  8. <text class="label">货架:</text>
  9. <text class="info">{{item.shelf}}</text>
  10. </p>
  11. <p class="info-line">
  12. <text class="label">货层:</text>
  13. <text class="info">{{item.floor}}</text>
  14. </p>
  15. <p class="info-line">
  16. <text class="label">货位:</text>
  17. <text class="info">{{item.seat}}</text>
  18. </p>
  19. <p class="info-line">
  20. <text class="label">附加码:</text>
  21. <text class="info">{{item.sign}}</text>
  22. </p>
  23. <p class="info-line">
  24. <text class="label">当前库存:</text>
  25. <text class="info">{{item.shelfNum}}</text>
  26. </p>
  27. <p class="info-line">
  28. <text class="label">盘点数量:</text>
  29. <u-input class="info" type="number"
  30. suffixIcon="edit-pen"
  31. border="none"
  32. :clearable="false"
  33. v-model="item.inventoryNum">
  34. </u-input>
  35. </p>
  36. <p class="info-line">
  37. <text class="label">盘盈盘亏:</text>
  38. <text class="info">{{item.inventoryNum?(item.inventoryNum - item.shelfNum):''}}</text>
  39. </p>
  40. </view>
  41. </view>
  42. </template>
  43. <template v-else>
  44. <u-empty mode="list" icon="https://cdn.uviewui.com/uview/empty/list.png">
  45. </u-empty>
  46. </template>
  47. </view>
  48. <view class="btn-wrap" >
  49. <u-button type="primary" color='#4680F9' @click="submit">{{$t('base.common.submit')}}</u-button>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {saveInventory} from '../../api/stock'
  55. export default {
  56. components:{
  57. },
  58. data() {
  59. return {
  60. content:{},
  61. };
  62. },
  63. onLoad(options) {
  64. this.content = JSON.parse(options.content)
  65. this.content.materialShelves.forEach(item=>{
  66. item.inventoryNum = item.shelfNum
  67. })
  68. },
  69. methods: {
  70. submit(){
  71. let num = 0
  72. this.content.materialShelves.forEach(item=>{
  73. item.inventoryNum = Number(item.inventoryNum)
  74. num+=item.inventoryNum
  75. })
  76. this.content.totalNum = num
  77. saveInventory(this.content).then(res=>{
  78. if(res.data.code == 0){
  79. uni.showModal({
  80. title: '提示',
  81. content: '保存成功',
  82. showCancel: false,
  83. success: ({ confirm, cancel }) => {
  84. if(confirm){
  85. uni.navigateBack({ delta: 1 })
  86. }
  87. }
  88. })
  89. }
  90. })
  91. }
  92. },
  93. };
  94. </script>
  95. <style>
  96. /* #ifndef APP-NVUE */
  97. view {
  98. display: flex;
  99. box-sizing: border-box;
  100. flex-direction: column;
  101. }
  102. page {
  103. box-sizing: border-box;
  104. /* padding: 40rpx 40rpx 80rpx; */
  105. height: 100%;
  106. }
  107. /* #endif*/
  108. </style>
  109. <style lang="scss" scoped>
  110. @import '../../common/css/public.scss';
  111. .order-list {
  112. padding-bottom: 160rpx;
  113. background-color: #f8f8f8;
  114. .qrcode-wrap{
  115. padding: 24rpx;
  116. text-align: center;
  117. .info-line{
  118. text-align: center;
  119. font-size: 32rpx;
  120. margin-top: 24rpx;
  121. }
  122. }
  123. }
  124. .swiper-box{
  125. padding:24rpx;
  126. }
  127. .popupShow {
  128. overflow: hidden;
  129. position: fixed;
  130. }
  131. .picker-card{
  132. padding: 32rpx 32rpx 144rpx;
  133. position: relative;
  134. height: 100%;
  135. overflow-y: scroll;
  136. display: block;
  137. .card-oper{
  138. position: absolute;
  139. width: 100%;
  140. bottom: 0;
  141. left:0;
  142. display: flex;
  143. flex-direction: row;
  144. justify-content: space-between;
  145. padding: 24rpx;
  146. .btn{
  147. width: 100%;
  148. }
  149. }
  150. }
  151. .shelf-card{
  152. margin: 0 0 24rpx;
  153. display: block;
  154. .order-info{
  155. flex-direction: row;
  156. flex-wrap: wrap;
  157. .info-line{
  158. width: 50%;
  159. .label{
  160. width: 120rpx;
  161. }
  162. }
  163. }
  164. }
  165. .btn-wrap{
  166. position: fixed;
  167. bottom: 0;
  168. padding: 32rpx;
  169. width: 100%;
  170. z-index: 200;
  171. background-color: #fff;
  172. }
  173. </style>