scanOrderCode.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view class="page-container">
  3. <view>
  4. <appScan ref="appScan" @scanHitERPCode="scanHitERPCode"></appScan>
  5. </view>
  6. <view class="codeList">
  7. <view class="codeItem" v-for="(item,index) in hitOrders" :title="item.orderCode" :index="index" :threshold="0">
  8. {{item.orderCode}}
  9. </view>
  10. </view>
  11. <view class="footer">
  12. <view>
  13. <view>
  14. <text>总数:18</text><br>
  15. <text>包数:26</text>
  16. </view>
  17. </view>
  18. <view @click="confirmOrderCodes">确认装车</view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import appScan from "../../components/app-continue-scancode/app-continue-scancode.vue"
  24. import request from '@/common/libs/request.js';
  25. export default {
  26. components: {
  27. appScan
  28. },
  29. data() {
  30. return {
  31. totalCount: 0,
  32. hitOrders: []
  33. }
  34. },
  35. methods: {
  36. scanHitERPCode(e) {
  37. let _that = this;
  38. console.log(e.code);
  39. if (e.code.match(new RegExp("^sendOrder.*$"))) {
  40. let ids = e.code.split("-");
  41. console.log(ids);
  42. if (!_that.checkCodeExists(ids[2])) {
  43. _that.hitOrders.push({
  44. id: ids[2],
  45. orderCode: ids[1]
  46. })
  47. console.log(ids)
  48. // this.totalCount++
  49. }
  50. }
  51. },
  52. checkCodeExists(id) {
  53. let _that = this;
  54. let code = _that.hitOrders.find(function(v) {
  55. return (v.id == id);
  56. })
  57. return ((code) && (code != null) && (code != undefined));
  58. },
  59. confirmOrderCodes() {
  60. let _that = this;
  61. if (_that.hitOrders.length > 0) {
  62. uni.$emit('confirmHitERPCode', {
  63. hits: _that.hitOrders
  64. })
  65. setTimeout(() => {
  66. uni.navigateBack({})
  67. }, 500)
  68. }
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .footer-text{
  75. line-height: 18rpx;
  76. }
  77. .page-container {
  78. position: relative;
  79. height: 100%;
  80. overflow: hidden;
  81. background-color: rgba(0, 0, 0, 0.6);
  82. .input {
  83. position: relative;
  84. z-index: 20;
  85. margin-top: 80rpx;
  86. height: 70rpx;
  87. padding: 0 80rpx;
  88. /deep/ .search-input {
  89. height: 70rpx;
  90. color: #fff;
  91. border-radius: 40rpx;
  92. border: 1px solid #FFD202;
  93. }
  94. }
  95. }
  96. .wx-scan-container {
  97. margin-top: 100rpx;
  98. height: 450rpx;
  99. .wx-tip {
  100. font-size: 30rpx;
  101. color: #FFFFFF;
  102. text-align: center;
  103. margin-top: 30rpx;
  104. }
  105. }
  106. .codeList {
  107. position: absolute;
  108. display: flex;
  109. flex-direction: row;
  110. flex-wrap: wrap;
  111. justify-content: space-between;
  112. top: 340px;
  113. bottom: 50px;
  114. z-index: 10;
  115. width: 100%;
  116. background: #FFFFFF;
  117. .codeItem {
  118. width: 48%;
  119. height: 30rpx;
  120. border: 0px;
  121. margin-top: 2rpx;
  122. }
  123. }
  124. .footer {
  125. position: fixed;
  126. bottom: 0;
  127. z-index: 10;
  128. display: flex;
  129. justify-content: space-between;
  130. width: 100%;
  131. height: 108rpx;
  132. background: #FFFFFF;
  133. border-top: 1px solid #E8E8E8;
  134. >view {
  135. width: 50%;
  136. height: 100%;
  137. font-size: 34rpx;
  138. font-weight: 600;
  139. display: flex;
  140. justify-content: center;
  141. align-items: center;
  142. &:active {
  143. opacity: 0.8;
  144. }
  145. .cart {
  146. width: 67rpx;
  147. height: 67rpx;
  148. margin-top: 10rpx;
  149. margin-right: 25rpx;
  150. }
  151. .amout {
  152. font-size: 34rpx;
  153. >text {
  154. font-size: 20rpx;
  155. }
  156. }
  157. .badge {
  158. position: relative;
  159. >text {
  160. position: absolute;
  161. top: 2rpx;
  162. right: 10rpx;
  163. z-index: 10;
  164. font-size: 22rpx;
  165. background: #FF3D00;
  166. border-radius: 50%;
  167. color: #fff;
  168. padding: 0 10rpx 2rpx;
  169. }
  170. }
  171. }
  172. >view:last-child {
  173. background: #FFD202;
  174. }
  175. }
  176. </style>