Browse Source

取件单添加从运单号获取详情api

Hello小健 1 week ago
parent
commit
d8b967e538
2 changed files with 20 additions and 3 deletions
  1. 9 3
      src/pages/pickup/waybillPickUpOrder.vue
  2. 11 0
      src/services/waybillPickUpOrder.ts

+ 9 - 3
src/pages/pickup/waybillPickUpOrder.vue

@@ -94,7 +94,7 @@
 import { reactive, ref, onMounted } from 'vue'
 import { onLoad, onNavigationBarButtonTap } from '@dcloudio/uni-app'
 import { checkPermission } from '@/utils'
-import { waybillPickUpOrders } from '@/services/waybillPickUpOrder'
+import { waybillPickUpOrders, getPickUpByWaybillNo } from '@/services/waybillPickUpOrder'
 import type { StatusItem } from '@/types/waybillPickUp'
 import { getCurrentInstance } from 'vue'
 
@@ -223,6 +223,8 @@ const scanInput = async () => {
   // #endif
   uni.scanCode({
     success: (res: any) => {
+      console.log('res---', res.result)
+
       // valiFormData.value.order_code = res.result;
       // onsubmit();
     },
@@ -409,9 +411,13 @@ onLoad(() => {
 onMounted(() => {
   getScrollW()
 })
-onNavigationBarButtonTap((event) => {
+onNavigationBarButtonTap(async (event) => {
   if (event.index === 0) {
-    scanInput()
+    const res = await getPickUpByWaybillNo('123456')
+
+    console.log('res---', res)
+
+    // scanInput()
     // showRightRef.value.open()
   }
 })

+ 11 - 0
src/services/waybillPickUpOrder.ts

@@ -22,3 +22,14 @@ export const getPickUpById = (pick_up_order_id: string) => {
     data: { pick_up_order_id },
   })
 }
+/**
+ * 通过运单号获取取件单明细
+ * @param waybill_no 运单号
+ */
+export const getPickUpByWaybillNo = (waybill_no: string) => {
+  return http<{ details: PickUpDetailItem[] }>({
+    method: 'GET',
+    url: '/admin/pickup.waybillPickUpOrder/getByWaybillNo',
+    data: { waybill_no },
+  })
+}