confirmQh.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <view class="content" v-if="nowData">
  3. <view class="productInfo">
  4. <view><u-image :src="nowData.images" border-radius="16" width="160" height="160" bg-color="#EBEBEB"></u-image></view>
  5. <view><text class="item-no">{{ nowData.shelfPlaceCode }}</text><text>{{ nowData.code }}</text></view>
  6. <view class="item-name">
  7. <text>{{ nowData.name }}</text>
  8. </view>
  9. </view>
  10. <view class="number-input flex flex_column align_center justify_center">
  11. <view class="u-ninput">
  12. <u-number-box :min="1" :max="nowData.currentInven" v-model="qty" color="#000" bg-color="#fff" size="36" :input-height="80" :input-width="180"></u-number-box>
  13. </view>
  14. <view class="kucun">可用库存:<text>{{nowData.currentInven}}</text>{{nowData.unit}}</view>
  15. </view>
  16. <view class="buttons">
  17. <u-button :throttle-time="100" :loading="loading" @click="outShelfOrder" :custom-style="{ background: '#066cff', color: '#fff',width:'400rpx' }" shape="circle" type="info">
  18. 确认取货
  19. </u-button>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import { shelfOrderOnceCreate } from '@/api/shelf'
  25. export default {
  26. data() {
  27. return {
  28. loading:false,
  29. nowData: null,
  30. qty: 1
  31. }
  32. },
  33. onLoad(options) {
  34. this.nowData = JSON.parse(decodeURIComponent(options.data));
  35. },
  36. methods: {
  37. // 确认取货
  38. outShelfOrder(){
  39. this.loading = true
  40. shelfOrderOnceCreate({
  41. billSource: this.nowData.billSource,
  42. shelfOrderDetailList: [{
  43. "productSn": this.nowData.productSn,
  44. "totalQty": this.qty
  45. }]
  46. }).then(res => {
  47. if(res.status == 200){
  48. uni.showToast({
  49. icon:'none',
  50. title: res.message
  51. })
  52. uni.redirectTo({
  53. url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+res.data.shelfOrderSn
  54. })
  55. }
  56. this.loading = false
  57. })
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="less">
  63. .content{
  64. background-color: #fff;
  65. width: 100%;
  66. padding: 50rpx 30rpx;
  67. height: 100vh;
  68. .productInfo{
  69. > view{
  70. text-align: center;
  71. display: flex;
  72. justify-content: center;
  73. font-size: 32rpx;
  74. .item-no{
  75. font-weight: normal;
  76. margin-right: 6rpx;
  77. padding: 0 10rpx;
  78. background: rgba(3, 54, 146, 0.15);
  79. border-radius: 100rpx;
  80. color: #033692;
  81. font-size: 24rpx;
  82. }
  83. padding: 10rpx;
  84. }
  85. .item-name{
  86. margin-top: 20rpx;
  87. font-size: 28rpx;
  88. }
  89. }
  90. .number-input{
  91. padding: 30rpx 30rpx 10rpx;
  92. > view{
  93. padding: 20rpx 0;
  94. }
  95. .kucun{
  96. color: #999;
  97. text{
  98. color: #333;
  99. }
  100. }
  101. .u-ninput{
  102. border: 2rpx solid #eee;
  103. border-radius: 50rpx;
  104. padding: 0 12rpx;
  105. }
  106. /deep/ .u-icon-disabled{
  107. background: #fff!important;
  108. }
  109. /deep/ .u-number-input{
  110. margin: 0 2rpx;
  111. border: 2rpx solid #eee;
  112. border-top: 0;
  113. border-bottom: 0;
  114. }
  115. /deep/ .u-icon-plus, /deep/ .u-icon-minus{
  116. border-radius: 50rpx;
  117. }
  118. }
  119. .buttons{
  120. padding: 50rpx 0;
  121. > view{
  122. width: 80%;
  123. margin: 0 2%;
  124. }
  125. }
  126. }
  127. </style>