ylong 5 месяцев назад
Родитель
Сommit
f2d7f66b4c

+ 2 - 1
src/views/recycle/orderAlert/index.vue

@@ -115,7 +115,8 @@ const columns = ref([
 
 //导出数据
 function exportData() {
-    pageRef.value?.exportData('订单预警', { pageSize: 10000, page: 1, alarmType: pageConfig.where.alarmType });
+    pageConfig.exportUrl = '/order/orderInfo/orderWarnListExport?pageSize=10000&page=1&alarmType=' + pageConfig.where.alarmType;
+    pageRef.value?.exportData('订单预警');
 }
 
 // 卡片选中

+ 1 - 0
src/views/recycleOrder/detail/order-recycle-log.vue

@@ -7,6 +7,7 @@
             border
             :fetchPage="fetchPage"
             ref="tableRef"
+            pagination
         >
             <template #discount="{ row }">
                 <div class="flex flex-col align-center">

+ 1 - 0
src/views/recycleOrder/detail/order-status.vue

@@ -9,6 +9,7 @@
             v-for="(item, index) in stepList"
             :title="item.statusName"
             :status="isError && index === stepList.length - 1 ? 'error' : ''"
+            :key="index"
         >
             <template #description>
                 <div>{{ item.createTime }}</div>

+ 44 - 14
src/views/recycleOrder/needReturned/components/order-status.vue

@@ -5,7 +5,12 @@
         align-center
         finish-status="success"
     >
-        <el-step v-for="item in stepList" :title="item.label" :key="item.time">
+        <el-step
+            v-for="(item, index) in stepList"
+            :title="item.label"
+            :status="isError && index === stepList.length - 1 ? 'error' : ''"
+            :key="index"
+        >
             <template #description>
                 <div>{{ item.time }}</div>
                 <div>{{ item.createdBy }}</div>
@@ -15,16 +20,18 @@
 </template>
 
 <script setup>
-    import { ref, reactive, watch } from 'vue';
+    import { ref, reactive, watch, computed } from 'vue';
     // 状态 0-创建(待付款) 1-已付款 2-已推送 3-已发货 4-已签收 5-已完成 6-已取消 7-超时取消
-    const stepList = reactive([
-        { label: '创建', time: '', createdBy: '', stutus: '1' },
-        { label: '付款', time: '', createdBy: '', stutus: '2' },
-        { label: '发货', time: '', createdBy: '', stutus: '3' },
-        { label: '已签收', time: '', createdBy: '', stutus: '4' },
-        { label: '完成', time: '', createdBy: '', stutus: '5' }
+    const defaultStepList = reactive([
+        { label: '创建(待付款)', time: '', createdBy: '', status: '0' },
+        { label: '已付款', time: '', createdBy: '', status: '1' },
+        { label: '已发货', time: '', createdBy: '', status: '3' },
+        { label: '已签收', time: '', createdBy: '', status: '4' },
+        { label: '完成', time: '', createdBy: '', status: '5' }
     ]);
 
+    const stepList = ref([]);
+
     const props = defineProps({
         status: {
             type: [Number, String],
@@ -36,30 +43,53 @@
         }
     });
 
+    const isError = computed(() => {
+        return props.logVoList.find((log) => ['6', '7'].includes(log.status));
+    });
+
     watch(
         () => props.logVoList,
         (newVal) => {
             if (newVal.length > 0) {
-                stepList.forEach((item) => {
+                stepList.value = [];
+
+                if (isError.value) {
+                    return (stepList.value = newVal);
+                }
+                stepList.value = defaultStepList;
+                stepList.value.forEach((item) => {
                     item.time =
-                        newVal.find((log) => log.status == item.stutus)
+                        newVal.find((log) => log.status == item.status)
                             ?.createTime || '';
                     item.createdBy =
-                        newVal.find((log) => log.status == item.stutus)
+                        newVal.find((log) => log.status == item.status)
                             ?.createName || '';
                 });
             } else {
-                stepList.forEach((item) => {
+                stepList.value.forEach((item) => {
                     item.time = '';
                     item.createdBy = '';
                 });
             }
+            console.log(stepList, 'stepList');
         },
         { deep: true, immediate: true }
     );
 
     const active = computed(() => {
-        let status = props.logVoList[0]?.status || 1;
-        return stepList.findIndex((item) => item.stutus == status) + 1;
+        if (isError.value) {
+            return stepList.value.length;
+        }
+        let status = props.logVoList[props.logVoList.length - 1]?.status || 0;
+        return stepList.value.findIndex((item) => item.status == status) + 1;
     });
 </script>
+
+<style lang="scss">
+    .error-step {
+        .el-step__title.is-success,
+        .el-step__description.is-success {
+            color: red;
+        }
+    }
+</style>