index.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="container">
  3. <van-nav-bar
  4. :title="taskType"
  5. left-arrow
  6. fixed
  7. placeholder
  8. >
  9. <template #left>
  10. <van-icon name="arrow-left" size="25" @click="goBack" />
  11. <div style="color: #fff" @click="onClickLeft">返回</div>
  12. </template>
  13. <template #right>
  14. <div style="color: #fff" @click="onClickRight">提交任务</div>
  15. </template>
  16. </van-nav-bar>
  17. <van-field v-model="barcode" label="条码" placeholder="请扫描条码" @keydown.enter.native="_checkBarcode" />
  18. </div>
  19. </template>
  20. <script setup>
  21. import { goBack } from '@/utils/android'
  22. import { useRoute } from 'vue-router'
  23. import { checkBlindBarcode, getBlindTask } from '@/api/blind/index.ts'
  24. import { ref } from 'vue'
  25. const route = useRoute()
  26. const barcode=ref('')
  27. //查询任务信息
  28. const taskInfo=ref({})
  29. const taskType=route.query.type
  30. const getTaskInfo=(taskNo)=>{
  31. getBlindTask({taskNo}).then(res => {
  32. taskInfo.value=res.data
  33. })
  34. }
  35. getTaskInfo(route.query.code)
  36. const _checkBarcode=()=>{
  37. const params={
  38. warehouse:taskInfo.value.warehouseCode,
  39. ownerCode:taskInfo.value.ownerCode,
  40. barcode:barcode.value,
  41. }
  42. checkBlindBarcode(params).then(res=>{
  43. console.log(res.data)
  44. })
  45. }
  46. // checkBlindBarcode
  47. const onClickLeft = () => {
  48. history.back();
  49. };
  50. const onClickRight=()=>{
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. </style>