Parcourir la source

Merge remote-tracking branch 'origin/master' into master

# Conflicts:
#	src/views/order/saleOrder/orderAffirm.vue
肖路 il y a 1 semaine
Parent
commit
25e7df07a0

+ 3 - 3
src/views/order/orderAssignment/splitAssignDialog.vue

@@ -1,6 +1,6 @@
 <template>
   <!-- 订单分配详情抽屉 -->
-  <el-drawer v-model="drawer.visible" size="65%" direction="rtl" :close-on-click-modal="true" :before-close="handleDrawerClose">
+  <el-drawer v-model="drawer.visible" size="70%" direction="rtl" :close-on-click-modal="true" :before-close="handleDrawerClose">
     <template #header>
       <div class="drawer-header">
         <!-- <el-icon color="#f56c6c" :size="24"><WarningFilled /></el-icon> -->
@@ -137,7 +137,7 @@
   </el-drawer>
 
   <!-- 分配抽屉 -->
-  <el-drawer v-model="assignDialog.visible" title="分配" size="50%" direction="rtl" :close-on-click-modal="true">
+  <el-drawer v-model="assignDialog.visible" title="分配" size="60%" direction="rtl" :close-on-click-modal="true">
     <div class="assign-drawer-content">
       <!-- 分配目标选择 -->
       <div class="assign-target-section">
@@ -383,7 +383,7 @@ const loadCustomerData = async () => {
 const loadSupplierData = async () => {
   if (cachedSupplierList.value.length > 0) return;
   try {
-    const res: any = await listInfo({ supplyStatus: 1, pageNum: 1, pageSize: 1000 });
+    const res: any = await listInfo({ supplyStatus: 1, pageNum: 1, pageSize: 9999 });
     const list = res.rows || res.data || [];
     cachedSupplierList.value = list.map((item: any) => ({
       ...item,

+ 65 - 4
src/views/order/saleOrder/logisticsDetail.vue

@@ -26,6 +26,26 @@
               <div>{{ item.time }}</div>
               <div>{{ item.location }}</div>
               <div>{{ item.status }}</div>
+              <div v-if="item.imagesUrl" class="timeline-images">
+                <div class="image-label">签收图片:</div>
+                <div class="image-list">
+                  <el-image
+                    v-for="(url, imgIndex) in item.imagesUrl.split(',')"
+                    :key="imgIndex"
+                    :src="url"
+                    :preview-src-list="item.imagesUrl.split(',')"
+                    :initial-index="imgIndex"
+                    fit="cover"
+                    class="sign-image"
+                  >
+                    <template #error>
+                      <div class="image-error">
+                        <el-icon><Picture /></el-icon>
+                      </div>
+                    </template>
+                  </el-image>
+                </div>
+              </div>
             </div>
           </div>
         </el-timeline-item>
@@ -40,6 +60,7 @@
 import { listOrderDeliver, queryTrack } from '@/api/order/orderDeliver';
 import { OrderDeliverVO } from '@/api/order/orderDeliver/types';
 import { listOrderStatusLog } from '@/api/order/orderStatusLog';
+import { Picture } from '@element-plus/icons-vue';
 interface Props {
   modelValue: boolean;
   orderId?: string | number;
@@ -49,6 +70,7 @@ interface LogisticsInfo {
   time: string;
   location: string;
   status: string;
+  imagesUrl: string;
 }
 
 const props = defineProps<Props>();
@@ -116,10 +138,11 @@ const handleLogisticNoChange = async (logisticNo: string) => {
 
           return {
             time: displayTime,
-            // 3. 建议:保留原始状态字段,方便后续筛选(如“已签收”
+            // 3. 建议:保留原始状态字段,方便后续筛选(如"已签收"
             status: item.context || item.content || '',
             // 4. 建议:如果有地址字段,也可以映射进来,没有则保持订单号
-            location: item.location || (selected.orderCode ? `${selected.orderCode}` : '')
+            location: item.location || (selected.orderCode ? `${selected.orderCode}` : ''),
+            imagesUrl: ''
           };
         });
       }
@@ -134,7 +157,8 @@ const handleLogisticNoChange = async (logisticNo: string) => {
           return {
             time: item.createTime,
             location: item.orderCode ? `${item.orderCode}` : '',
-            status: item.statusName
+            status: item.statusName,
+            imagesUrl: item.imagesUrl
           };
         });
       });
@@ -153,7 +177,8 @@ const handleLogisticNoChange = async (logisticNo: string) => {
       {
         time: (selected as any).createTime || '',
         location: selected.orderCode ? `${selected.orderCode}` : '',
-        status: '已下单'
+        status: '已下单',
+        imagesUrl: ''
       }
     ];
   }
@@ -211,6 +236,42 @@ const handleClose = () => {
           margin-bottom: 0;
         }
       }
+
+      .timeline-images {
+        margin-top: 8px;
+        padding-top: 8px;
+        border-top: 1px dashed #dcdfe6;
+
+        .image-label {
+          font-size: 13px;
+          color: #909399;
+          margin-bottom: 6px;
+        }
+
+        .image-list {
+          display: flex;
+          flex-wrap: wrap;
+          gap: 8px;
+
+          .sign-image {
+            width: 60px;
+            height: 60px;
+            border-radius: 4px;
+            border: 1px solid #dcdfe6;
+            cursor: pointer;
+
+            .image-error {
+              width: 100%;
+              height: 100%;
+              display: flex;
+              align-items: center;
+              justify-content: center;
+              background-color: #f5f7fa;
+              color: #c0c4cc;
+            }
+          }
+        }
+      }
     }
   }
 

+ 13 - 3
src/views/order/saleOrder/orderAffirm.vue

@@ -280,16 +280,18 @@ import { getCompany } from '@/api/company/company';
 import { getWarehouse } from '@/api/company/warehouse';
 import { getCustomerInfo } from '@/api/customer/customerFile/customerInfo';
 import { getDept } from '@/api/system/dept';
+import { useRoute, useRouter } from 'vue-router';
 import { getOrderMainCrrcExt } from '@/api/order/orderMainCrrcExt';
 import { OrderMainCrrcExtVO } from '@/api/order/orderMainCrrcExt/types';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { pay_method, fee_type } = toRefs<any>(proxy?.useDict('pay_method', 'fee_type'));
-const router = useRouter();
 
 const buttonLoading = ref(false);
 const loading = ref(true);
-
+// 获取路由和 router 实例
+const route = useRoute();
+const router = useRouter();
 // 订单信息
 const orderInfo = ref<any>({});
 // 收货地址信息
@@ -538,7 +540,6 @@ const goBack = () => {
 
 // 页面加载时获取订单ID并加载订单详情
 onMounted(() => {
-  const route = useRoute();
   const orderId = route.query.id;
   if (orderId) {
     getOrderDetail(orderId as string);
@@ -547,6 +548,15 @@ onMounted(() => {
     router.back();
   }
 });
+// 监听路由 query 中的 id 变化
+watch(
+  () => route.query.id, // 监听 id 的变化
+  (newOrderId) => {
+    if (newOrderId) {
+      getOrderDetail(newOrderId as string);
+    }
+  }
+);
 </script>
 
 <style scoped lang="scss">