confirmQh.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. }else{
  56. uni.showModal({
  57. title: '取货失败',
  58. content: res.message,
  59. confirmText: '知道了',
  60. showCancel: false,
  61. })
  62. }
  63. this.loading = false
  64. })
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="less">
  70. .content{
  71. background-color: #fff;
  72. width: 100%;
  73. padding: 50rpx 30rpx;
  74. height: 100vh;
  75. .productInfo{
  76. > view{
  77. text-align: center;
  78. display: flex;
  79. justify-content: center;
  80. font-size: 32rpx;
  81. .item-no{
  82. font-weight: normal;
  83. margin-right: 6rpx;
  84. padding: 0 10rpx;
  85. background: rgba(3, 54, 146, 0.15);
  86. border-radius: 100rpx;
  87. color: #033692;
  88. font-size: 24rpx;
  89. }
  90. padding: 10rpx;
  91. }
  92. .item-name{
  93. margin-top: 20rpx;
  94. font-size: 28rpx;
  95. }
  96. }
  97. .number-input{
  98. padding: 30rpx 30rpx 10rpx;
  99. > view{
  100. padding: 20rpx 0;
  101. }
  102. .kucun{
  103. color: #999;
  104. text{
  105. color: #333;
  106. }
  107. }
  108. .u-ninput{
  109. border: 2rpx solid #eee;
  110. border-radius: 50rpx;
  111. padding: 0 12rpx;
  112. }
  113. /deep/ .u-icon-disabled{
  114. background: #fff!important;
  115. }
  116. /deep/ .u-number-input{
  117. margin: 0 2rpx;
  118. border: 2rpx solid #eee;
  119. border-top: 0;
  120. border-bottom: 0;
  121. }
  122. /deep/ .u-icon-plus, /deep/ .u-icon-minus{
  123. border-radius: 50rpx;
  124. }
  125. }
  126. .buttons{
  127. padding: 50rpx 0;
  128. > view{
  129. width: 80%;
  130. margin: 0 2%;
  131. }
  132. }
  133. }
  134. </style>