Sfoglia il codice sorgente

查看运单列表优化

GGDemo 3 settimane fa
parent
commit
09c6e161cf

+ 6 - 0
src/pages.json

@@ -89,6 +89,12 @@
         "navigationBarTitleText": "托盘/批次"
       }
     },
+    {
+      "path": "pages/scanLotno/waybillsList",
+      "style": {
+        "navigationBarTitleText": "运单列表"
+      }
+    },
     {
       "path": "pages/waybillNo/waybillNo",
       "style": {

+ 3 - 3
src/pages/scanLotno/scanLotno.vue

@@ -223,7 +223,7 @@ const palletNum = computed(() => {
 
 const checkOrder = async () => {
   loading.value = true
-  // uni.setStorageSync('waybills', [])
+  uni.setStorageSync('waybills', [])
 
   const res = await getWaybills({
     order_no: valiFormData.value.orderNum,
@@ -238,13 +238,13 @@ const checkOrder = async () => {
     messageType.value = 'success'
     messageText.value = res.msg
     messageRef.value.open()
-    // uni.setStorageSync('waybills', res.data.data.waybills)
+    uni.setStorageSync('waybills', res.data.waybills)
     uni.navigateTo({
       url: '/pages/scanLotno/waybillsList',
     })
   } else {
     messageType.value = 'error'
-    messageText.value = res.data.msg
+    messageText.value = res.msg
     messageRef.value.open()
   }
 }

+ 79 - 0
src/pages/scanLotno/waybillsList.vue

@@ -0,0 +1,79 @@
+<template>
+  <view class="history">
+    <uni-section :title="'数量: ' + waybills.length"></uni-section>
+    <view class="item" v-for="(item, i) in waybills" :key="i">
+      <text class="code" :style="{ color: '#666' }">{{ item.order_box_no }}</text>
+      <text class="type">重量: {{ item.weight }}KG</text>
+      <view class="sub-items">
+        <view class="sub-item">
+          <text class="type">批次/船航/托盘</text>
+          <text class="type">{{ item.batch_shipping_pallet }}</text>
+        </view>
+        <view class="sub-item">
+          <text class="type">末公里运单号</text>
+          <text class="type">{{ item.tracking_number || '无' }}</text>
+        </view>
+      </view>
+    </view>
+    <view v-if="waybills.length === 0" class="is-empty">暂无运单</view>
+  </view>
+</template>
+
+<script setup lang="ts">
+import { reactive, ref } from 'vue'
+import { onLoad } from '@dcloudio/uni-app'
+
+const waybills = ref([] as any)
+const getHistory = () => {
+  waybills.value = uni.getStorageSync('waybills')
+}
+onLoad(() => {
+  getHistory()
+})
+</script>
+
+<style lang="scss" scoped>
+.history {
+  display: flex;
+  width: 100%;
+  flex-direction: column;
+  justify-items: start;
+
+  .type {
+    padding-right: 20rpx;
+    font-size: 24rpx;
+    margin-top: 10rpx;
+  }
+  .code {
+    font-weight: 600;
+  }
+
+  .item {
+    padding: 20rpx;
+    font-size: 24rpx;
+    color: #666;
+    border-radius: 10rpx;
+    border: #666 1rpx solid;
+    margin-bottom: 10rpx;
+    margin-left: 10rpx;
+    margin-right: 10rpx;
+    display: flex;
+    flex-direction: column;
+    .sub-items {
+      display: flex;
+      flex-direction: row;
+      .sub-item {
+        display: flex;
+        flex: 1;
+        flex-direction: column;
+      }
+    }
+  }
+
+  .is-empty {
+    text-align: center;
+    margin: 40px 0;
+    color: #999;
+  }
+}
+</style>