2 Commits d27cba4df4 ... fd8cf2cd10

Author SHA1 Message Date
  Hello小健 fd8cf2cd10 Merge branch 'zc-fix-bug' into lzw 2 weeks ago
  Hello小健 cab7f4ad4d 添加取件单列表api 2 weeks ago
2 changed files with 132 additions and 133 deletions
  1. 121 133
      src/pages/pickup/waybillPickUpOrder.vue
  2. 11 0
      src/services/waybillPickUpOrder.ts

+ 121 - 133
src/pages/pickup/waybillPickUpOrder.vue

@@ -9,7 +9,7 @@
     />
     <view class="item" v-for="(item, i) in waybillDelivery" :key="i" @click="itemClick(item)">
       <view class="order-no">
-        <text> 派送单号: {{ item.order_no }} </text>
+        <text> 取件单号: {{ item.order_no }} </text>
         <image
           @click="copyOrderNo(item.order_no)"
           class="icon"
@@ -60,7 +60,7 @@
       </view>
     </view>
 
-    <view v-if="waybillDelivery.length === 0" class="is-empty">暂无派送单</view>
+    <view v-if="waybillDelivery.length === 0" class="is-empty">暂无取件单</view>
 
     <uni-popup ref="messageRef" type="message">
       <uni-popup-message
@@ -81,11 +81,10 @@
 </template>
 
 <script setup lang="ts">
-import { reactive, ref } from 'vue'
+import { ref } from 'vue'
 import { onLoad, onNavigationBarButtonTap } from '@dcloudio/uni-app'
 import { checkPermission } from '@/utils'
-
-let pickupWaybillDeliveryOrderURL = ''
+import { waybillPickUpOrders } from '@/services/waybillPickUpOrder'
 let sendOutURL = ''
 let deliveredURL = ''
 let refuseURL = ''
@@ -94,7 +93,6 @@ let cancelFedExPickUpURL = ''
 
 const loading = ref(false)
 const loadingBtn = ref(false)
-const token = ref()
 const searchValue = ref()
 const waybillDelivery = ref([] as any)
 const messageType = ref()
@@ -205,150 +203,140 @@ const onButtonClick = async (row: { id: any }, value: string) => {
 
 const sendOut = (data: { id: any }) => {
   loadingBtn.value = true
-  uni.request({
-    url: sendOutURL,
-    method: 'POST',
-    header: {
-      batoken: token.value,
-    },
-    data: data,
-    success: ({ data }: any) => {
-      loadingBtn.value = false
-      messageType.value = 'success'
-      messageText.value = '发出成功'
-      messageRef.value.open()
-    },
-    fail: (err) => {
-      loadingBtn.value = false
-      messageType.value = 'error'
-      messageText.value = '发出失败,请稍后重试'
-      messageRef.value.open()
-    },
-  })
+  // uni.request({
+  //   url: sendOutURL,
+  //   method: 'POST',
+  //   header: {
+  //     batoken: token.value,
+  //   },
+  //   data: data,
+  //   success: ({ data }: any) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'success'
+  //     messageText.value = '发出成功'
+  //     messageRef.value.open()
+  //   },
+  //   fail: (err) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'error'
+  //     messageText.value = '发出失败,请稍后重试'
+  //     messageRef.value.open()
+  //   },
+  // })
 }
 
 const updateDelivered = (data: { id: any }) => {
   loadingBtn.value = true
-  uni.request({
-    url: deliveredURL,
-    method: 'POST',
-    header: {
-      batoken: token.value,
-    },
-    data: data,
-    success: ({ data }: any) => {
-      loadingBtn.value = false
-      messageType.value = 'success'
-      messageText.value = '确认送达成功'
-      messageRef.value.open()
-    },
-    fail: (err) => {
-      loadingBtn.value = false
-      messageType.value = 'error'
-      messageText.value = '确认送达失败,请稍后重试'
-      messageRef.value.open()
-    },
-  })
+  // uni.request({
+  //   url: deliveredURL,
+  //   method: 'POST',
+  //   header: {
+  //     batoken: token.value,
+  //   },
+  //   data: data,
+  //   success: ({ data }: any) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'success'
+  //     messageText.value = '确认送达成功'
+  //     messageRef.value.open()
+  //   },
+  //   fail: (err) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'error'
+  //     messageText.value = '确认送达失败,请稍后重试'
+  //     messageRef.value.open()
+  //   },
+  // })
 }
 
 const updateRefuse = (data: { id: any }) => {
   loadingBtn.value = true
-  uni.request({
-    url: refuseURL,
-    method: 'POST',
-    header: {
-      batoken: token.value,
-    },
-    data: data,
-    success: ({ data }: any) => {
-      loadingBtn.value = false
-      messageType.value = 'success'
-      messageText.value = '已拒绝签收'
-      messageRef.value.open()
-    },
-    fail: (err) => {
-      loadingBtn.value = false
-      messageType.value = 'error'
-      messageText.value = '修改失败,请稍后重试'
-      messageRef.value.open()
-    },
-  })
+  // uni.request({
+  //   url: refuseURL,
+  //   method: 'POST',
+  //   header: {
+  //     batoken: token.value,
+  //   },
+  //   data: data,
+  //   success: ({ data }: any) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'success'
+  //     messageText.value = '已拒绝签收'
+  //     messageRef.value.open()
+  //   },
+  //   fail: (err) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'error'
+  //     messageText.value = '修改失败,请稍后重试'
+  //     messageRef.value.open()
+  //   },
+  // })
 }
 
 const createTrackPod = (data: { id: any }) => {
   loadingBtn.value = true
-  uni.request({
-    url: createTrackPodURL,
-    method: 'POST',
-    header: {
-      batoken: token.value,
-    },
-    data: data,
-    success: ({ data }: any) => {
-      loadingBtn.value = false
-      messageType.value = 'success'
-      messageText.value = '同步成功'
-      messageRef.value.open()
-    },
-    fail: (err) => {
-      loadingBtn.value = false
-      messageType.value = 'error'
-      messageText.value = '同步失败,请稍后重试'
-      messageRef.value.open()
-    },
-  })
+  // uni.request({
+  //   url: createTrackPodURL,
+  //   method: 'POST',
+  //   header: {
+  //     batoken: token.value,
+  //   },
+  //   data: data,
+  //   success: ({ data }: any) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'success'
+  //     messageText.value = '同步成功'
+  //     messageRef.value.open()
+  //   },
+  //   fail: (err) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'error'
+  //     messageText.value = '同步失败,请稍后重试'
+  //     messageRef.value.open()
+  //   },
+  // })
 }
 
 const cancelFedExPickUp = (data: { id: any }) => {
   loadingBtn.value = true
-  uni.request({
-    url: cancelFedExPickUpURL,
-    method: 'POST',
-    header: {
-      batoken: token.value,
-    },
-    data: data,
-    success: ({ data }: any) => {
-      loadingBtn.value = false
-      messageType.value = 'success'
-      messageText.value = '操作成功'
-      messageRef.value.open()
-    },
-    fail: (err) => {
-      loadingBtn.value = false
-      messageType.value = 'error'
-      messageText.value = '操作失败,请稍后重试'
-      messageRef.value.open()
-    },
-  })
+  // uni.request({
+  //   url: cancelFedExPickUpURL,
+  //   method: 'POST',
+  //   header: {
+  //     batoken: token.value,
+  //   },
+  //   data: data,
+  //   success: ({ data }: any) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'success'
+  //     messageText.value = '操作成功'
+  //     messageRef.value.open()
+  //   },
+  //   fail: (err) => {
+  //     loadingBtn.value = false
+  //     messageType.value = 'error'
+  //     messageText.value = '操作失败,请稍后重试'
+  //     messageRef.value.open()
+  //   },
+  // })
 }
 
-const getList = () => {
+const getList = async () => {
   loading.value = true
-  uni.request({
-    url: pickupWaybillDeliveryOrderURL + '/index',
-    method: 'GET',
-    header: {
-      batoken: token.value,
-    },
-    success: ({ data }: any) => {
-      loading.value = false
-      console.log(data)
-      if (data.code == 1) {
-        waybillDelivery.value = data.data.list
-      } else {
-        messageType.value = 'error'
-        messageText.value = data.msg
-        messageRef.value.open()
-      }
-    },
-    fail: (err) => {
-      loading.value = false
-    },
-  })
+
+  const res = await waybillPickUpOrders()
+
+  loading.value = false
+  console.log(res)
+  if (res.code == 1) {
+    waybillDelivery.value = res.data.list
+  } else {
+    messageType.value = 'error'
+    messageText.value = res.msg
+    messageRef.value.open()
+  }
 }
 onLoad(() => {
-  token.value = uni.getStorageSync('token')
   getList()
 })
 onNavigationBarButtonTap((event) => {
@@ -380,7 +368,7 @@ onNavigationBarButtonTap((event) => {
 
     .order-no {
       padding: 14rpx;
-      font-size: 16rpx;
+      //font-size: 16rpx;
     }
 
     .icon {
@@ -391,7 +379,7 @@ onNavigationBarButtonTap((event) => {
 
     .address-info {
       padding: 14rpx;
-      font-size: 16rpx;
+      //font-size: 16rpx;
       margin-bottom: 10rpx;
 
       .info {
@@ -424,7 +412,7 @@ onNavigationBarButtonTap((event) => {
   width: 100%;
 
   button {
-    font-size: 16rpx;
+    //font-size: 16rpx;
     margin: 10rpx;
   }
 }
@@ -442,7 +430,7 @@ onNavigationBarButtonTap((event) => {
     height: 35px;
     width: 50%;
     margin-left: 10px;
-    font-size: 16rpx;
+    //font-size: 16rpx;
   }
 
   .uni-icons {

+ 11 - 0
src/services/waybillPickUpOrder.ts

@@ -0,0 +1,11 @@
+import { http } from '@/utils/http'
+
+/**
+ * 获取取件单列表
+ */
+export const waybillPickUpOrders = () => {
+  return http<any>({
+    method: 'GET',
+    url: '/admin/pickup.waybillPickUpOrder/index',
+  })
+}