scanOrderCode.vue 3.3 KB

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