location-order.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="container">
  3. <!-- 底部扫码输入框 -->
  4. <view class="fixed-bottom pad-20" style="background: #ffffff;">
  5. <u-search placeholder="请输入库位编号" :searchIconSize="24" bgColor="#f6f7f6" @search="onSearch"
  6. v-model="positionCode" :clearabled="true" :focus="false" :showAction="false" :height="42"></u-search>
  7. <u-icon name="scan" size="32" color="#19be6b" @click="openScan"></u-icon>
  8. </view>
  9. </view>
  10. </template>
  11. <script setup>
  12. import {
  13. ref
  14. } from 'vue'
  15. import {
  16. onLoad,
  17. onShow
  18. } from '@dcloudio/uni-app'
  19. const positionCode = ref('')
  20. const onSearch = () => {
  21. if (positionCode.value) {
  22. uni.navigateTo({
  23. url: '/pages/index/wms/location-order-list?positionCode=' + positionCode.value
  24. })
  25. } else {
  26. uni.$u.toast('请输入库位编号')
  27. }
  28. }
  29. function openScan() {
  30. uni.scanCode({
  31. success: (res) => {
  32. positionCode.value = res.result
  33. onSearch()
  34. }
  35. })
  36. }
  37. onLoad(() => {
  38. // #ifdef APP-PLUS
  39. uni.$u.useGlobalEvent((e) => {
  40. if (e.barcode) {
  41. positionCode.value = e.barcode
  42. onSearch()
  43. }
  44. })
  45. // #endif
  46. })
  47. onShow(() => {
  48. uni.$u.updateActivePageOnShow()
  49. })
  50. </script>
  51. <style lang="scss" scoped>
  52. .header {
  53. display: flex;
  54. justify-content: space-between;
  55. padding: 20rpx 30rpx;
  56. background-color: #ffffff;
  57. }
  58. .status {
  59. color: green;
  60. }
  61. .log-item {
  62. display: flex;
  63. justify-content: space-between;
  64. padding: 20rpx 30rpx;
  65. border-bottom: 1px solid #e0e0e0;
  66. }
  67. </style>