Selaa lähdekoodia

Merge branch 'master' of http://8.152.4.3:3000/yp_web/yoe-shop-web

weixin_52219567 2 päivää sitten
vanhempi
sitoutus
9cea804e57
1 muutettua tiedostoa jossa 9 lisäystä ja 3 poistoa
  1. 9 3
      src/views/order/orderManage/detail.vue

+ 9 - 3
src/views/order/orderManage/detail.vue

@@ -155,6 +155,7 @@ const formatTime = (timeStr: string): string => {
 const orderId = ref<any>(0);
 const currentStep = ref(1);
 const loading = ref(false);
+const orderStatus = ref<number>(0);
 
 const progressSteps = ref<{ title: string; icon: any; desc: string; time: string; reviewStatus?: number }[]>([
   { title: '提交订单', icon: Document, desc: '订单已提交', time: '', reviewStatus: 2 },
@@ -229,6 +230,12 @@ const loadFlowNodes = async () => {
       if (middleNodes.length > 0 && middleNodes.every((s) => s.reviewStatus === 2)) {
         lastActiveIndex = steps.length - 1;
       }
+
+      // 检查订单状态,如果状态=5,则强制激活完成步骤
+      if (orderStatus.value == 5) {
+        lastActiveIndex = steps.length - 1;
+      }
+
       currentStep.value = lastActiveIndex;
     }
   } catch (error) {
@@ -279,11 +286,10 @@ const loadOrderDetail = async () => {
       // 保存订单时间信息(用于流程节点时间显示)
       orderTimeInfo.createTime = order.createTime || '';
       orderTimeInfo.updateTime = order.updateTime || '';
+      orderStatus.value = order.orderStatus || 0;
       if (order.orderStatus == 5) {
-        // 1. 设置当前步骤为最后一个
+        // 激活完成这一步
         currentStep.value = progressSteps.value.length - 1;
-
-        // 2. 修改最后一个元素的时间
         progressSteps.value[progressSteps.value.length - 1].time = formatTime(order.updateTime);
       }
       // 获取商品信息