location-order.vue 1.5 KB

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