confirmQh.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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 style="display: block;"><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 flex justify_center">
  15. <view class="pcode" v-if="showPrice[0]">
  16. <view v-if="showPrice[1]=='PURCHASES_PRICE'">
  17. 价格:<text class="item-price" v-if="isAdmin || showPrice[2]">{{nowData.cost||0}}</text>
  18. </view>
  19. <view v-else>
  20. 价格:<text class="item-price">{{nowData.price||0}}</text>
  21. </view>
  22. </view>
  23. <view>
  24. 可用库存:<text>{{nowData.currentInven}}</text>{{nowData.unit}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="buttons">
  29. <u-button :throttle-time="100" :loading="loading" @click="onSubmit" :custom-style="{ background: '#066cff', color: '#fff',width:'400rpx' }" shape="circle" type="info">
  30. 确认拿货
  31. </u-button>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { shelfOrderOnceCreate } from '@/api/shelf'
  37. export default {
  38. data() {
  39. return {
  40. loading:false,
  41. nowData: null,
  42. qty: 1
  43. }
  44. },
  45. onLoad(options) {
  46. this.nowData = this.$store.state.vuex_tempData
  47. },
  48. computed: {
  49. userInfo(){
  50. return this.$store.state.vuex_userInfo
  51. },
  52. showPrice(){
  53. return this.$store.state.vuex_showPrice
  54. },
  55. isAdmin(){
  56. return this.userInfo.superAdmin == 1
  57. }
  58. },
  59. methods: {
  60. onSubmit(){
  61. const _this = this
  62. uni.showModal({
  63. title: '提示',
  64. content: '拿货后扣减库存,确认拿货吗?',
  65. confirmText: '确定',
  66. success(res) {
  67. if(res.confirm){
  68. _this.outShelfOrder()
  69. }
  70. }
  71. })
  72. },
  73. toDetail(data){
  74. uni.$emit("updateQueryByCodeList")
  75. uni.redirectTo({
  76. url: "/pagesA/digitalShelf/orderDetail?shelfOrderSn="+data.shelfOrderSn
  77. })
  78. },
  79. // 确认拿货
  80. outShelfOrder(){
  81. const _this = this
  82. this.loading = true
  83. shelfOrderOnceCreate({
  84. billSource: this.nowData.billSource,
  85. shelfOrderDetailList: [{
  86. "productSn": this.nowData.productSn,
  87. "totalQty": this.qty
  88. }]
  89. }).then(res => {
  90. if(res.status == 200){
  91. if(res.data&&res.data.remindMessage){
  92. uni.showModal({
  93. title: '提示',
  94. content: res.data.remindMessage,
  95. confirmText: '知道了',
  96. showCancel: false,
  97. success(ret) {
  98. if(ret.confirm){
  99. _this.toDetail(res.data)
  100. }
  101. }
  102. })
  103. }else{
  104. uni.showToast({
  105. icon:'none',
  106. title: res.message,
  107. duration: 4000
  108. })
  109. _this.toDetail(res.data)
  110. }
  111. }else{
  112. uni.showModal({
  113. title: res.errCode == 'VALIDATE_STOCK_LACK' ? '以下产品库存不足' : '提示',
  114. content: res.message,
  115. confirmText: '知道了',
  116. showCancel: false
  117. })
  118. }
  119. this.loading = false
  120. })
  121. }
  122. }
  123. }
  124. </script>
  125. <style lang="less">
  126. .content{
  127. background-color: #fff;
  128. width: 100%;
  129. padding: 50rpx 30rpx;
  130. height: 100vh;
  131. .productInfo{
  132. > view{
  133. text-align: center;
  134. display: flex;
  135. justify-content: center;
  136. font-size: 32rpx;
  137. .item-no{
  138. font-weight: normal;
  139. margin-right: 6rpx;
  140. padding: 0 10rpx;
  141. background: rgba(3, 54, 146, 0.15);
  142. border-radius: 20rpx;
  143. color: #033692;
  144. font-size: 24rpx;
  145. }
  146. padding: 10rpx;
  147. }
  148. .item-name{
  149. margin-top: 20rpx;
  150. font-size: 28rpx;
  151. }
  152. }
  153. .number-input{
  154. padding: 30rpx 30rpx 10rpx;
  155. > view{
  156. padding: 20rpx 0;
  157. }
  158. .kucun{
  159. color: #999;
  160. text{
  161. color: #333;
  162. }
  163. .pcode{
  164. margin-right: 20upx;
  165. }
  166. }
  167. .u-ninput{
  168. border: 2rpx solid #eee;
  169. border-radius: 50rpx;
  170. padding: 0 12rpx;
  171. }
  172. /deep/ .u-icon-disabled{
  173. background: #fff!important;
  174. }
  175. /deep/ .u-number-input{
  176. margin: 0 2rpx;
  177. border: 2rpx solid #eee;
  178. border-top: 0;
  179. border-bottom: 0;
  180. }
  181. /deep/ .u-icon-plus, /deep/ .u-icon-minus{
  182. border-radius: 50rpx;
  183. }
  184. }
  185. .buttons{
  186. padding: 50rpx 0;
  187. > view{
  188. width: 80%;
  189. margin: 0 2%;
  190. }
  191. }
  192. }
  193. </style>