confirmQh.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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="0" :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="onSubmit" :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 = this.$store.state.vuex_tempData
  35. },
  36. methods: {
  37. onSubmit(){
  38. const _this = this
  39. uni.showModal({
  40. title: '提示',
  41. content: '取货后扣减库存,确认取货吗?',
  42. confirmText: '确定',
  43. success(res) {
  44. if(res.confirm){
  45. _this.outShelfOrder()
  46. }
  47. }
  48. })
  49. },
  50. // 确认取货
  51. outShelfOrder(){
  52. this.loading = true
  53. shelfOrderOnceCreate({
  54. billSource: this.nowData.billSource,
  55. shelfOrderDetailList: [{
  56. "productSn": this.nowData.productSn,
  57. "totalQty": this.qty
  58. }]
  59. }).then(res => {
  60. if(res.status == 200){
  61. uni.showToast({
  62. icon:'none',
  63. title: res.message,
  64. duration: 4000
  65. })
  66. uni.$emit("updateQueryByCodeList")
  67. uni.redirectTo({
  68. url: "/pages/digitalShelf/orderDetail?shelfOrderSn="+res.data.shelfOrderSn
  69. })
  70. }else{
  71. uni.showModal({
  72. title: res.errCode == 'VALIDATE_STOCK_LACK' ? '以下产品库存不足' : '提示',
  73. content: res.message,
  74. confirmText: '知道了',
  75. showCancel: false
  76. })
  77. }
  78. this.loading = false
  79. })
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="less">
  85. .content{
  86. background-color: #fff;
  87. width: 100%;
  88. padding: 50rpx 30rpx;
  89. height: 100vh;
  90. .productInfo{
  91. > view{
  92. text-align: center;
  93. display: flex;
  94. justify-content: center;
  95. font-size: 32rpx;
  96. .item-no{
  97. font-weight: normal;
  98. margin-right: 6rpx;
  99. padding: 0 10rpx;
  100. background: rgba(3, 54, 146, 0.15);
  101. border-radius: 20rpx;
  102. color: #033692;
  103. font-size: 24rpx;
  104. }
  105. padding: 10rpx;
  106. }
  107. .item-name{
  108. margin-top: 20rpx;
  109. font-size: 28rpx;
  110. }
  111. }
  112. .number-input{
  113. padding: 30rpx 30rpx 10rpx;
  114. > view{
  115. padding: 20rpx 0;
  116. }
  117. .kucun{
  118. color: #999;
  119. text{
  120. color: #333;
  121. }
  122. }
  123. .u-ninput{
  124. border: 2rpx solid #eee;
  125. border-radius: 50rpx;
  126. padding: 0 12rpx;
  127. }
  128. /deep/ .u-icon-disabled{
  129. background: #fff!important;
  130. }
  131. /deep/ .u-number-input{
  132. margin: 0 2rpx;
  133. border: 2rpx solid #eee;
  134. border-top: 0;
  135. border-bottom: 0;
  136. }
  137. /deep/ .u-icon-plus, /deep/ .u-icon-minus{
  138. border-radius: 50rpx;
  139. }
  140. }
  141. .buttons{
  142. padding: 50rpx 0;
  143. > view{
  144. width: 80%;
  145. margin: 0 2%;
  146. }
  147. }
  148. }
  149. </style>