location-order.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. onUnload
  19. } from '@dcloudio/uni-app'
  20. const positionCode = ref('')
  21. const onSearch = () => {
  22. if (positionCode.value) {
  23. uni.redirectTo({
  24. url: '/pages/index/wms/location-order-list?positionCode=' + positionCode.value
  25. })
  26. } else {
  27. uni.$u.toast('请输入库位编号')
  28. }
  29. }
  30. function openScan() {
  31. uni.scanCode({
  32. success: (res) => {
  33. positionCode.value = res.result
  34. onSearch()
  35. }
  36. })
  37. }
  38. onLoad(() => {
  39. // #ifdef APP-PLUS
  40. uni.$u.useGlobalEvent((e) => {
  41. if (e.barcode) {
  42. positionCode.value = e.barcode
  43. onSearch()
  44. }
  45. })
  46. // #endif
  47. })
  48. onShow(() => {
  49. uni.$u.updateActivePageOnShow()
  50. })
  51. onUnload(() => {
  52. uni.$u.cleanupOnPageUnload();
  53. });
  54. </script>
  55. <style lang="scss" scoped>
  56. .header {
  57. display: flex;
  58. justify-content: space-between;
  59. padding: 20rpx 30rpx;
  60. background-color: #ffffff;
  61. }
  62. .status {
  63. color: green;
  64. }
  65. .log-item {
  66. display: flex;
  67. justify-content: space-between;
  68. padding: 20rpx 30rpx;
  69. border-bottom: 1px solid #e0e0e0;
  70. }
  71. </style>