1. 新增售后订单条件搜索
2. 新增首页待处理模块
This commit is contained in:
2026-06-13 10:33:55 +08:00
parent fcc250a51f
commit 0094b6aa6e
5 changed files with 65 additions and 16 deletions

View File

@@ -2,7 +2,7 @@ import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/mall/after-sales/list',
url: '/mall/after-sales/page',
method: 'get',
params: {
...params,

View File

@@ -148,6 +148,7 @@ export default {
{
label: "处理状态",
prop: "status",
type: "radio",
dicUrl: '/blade-system/dict/dictionary?code=after_sales_status',
props: {
label: 'dictValue',
@@ -157,6 +158,7 @@ export default {
addDisplay: false,
editDisplay: false,
viewDisplay: false,
search: true,
},
{
label: "是否已删除",

View File

@@ -107,4 +107,27 @@ export const createUserOrderCards = (context) => {
count: '--', // 初始占位
}))
};
};
export const createPendingCards = (context) =>{
const cards = [
{
key: 'pendingTotal',
title: '售后订单',
icon: 'el-icon-files',
color: 'rgb(230, 71, 88)',
path: '/mall/afterSalesRequest'
},
];
return {
span: 8,
data: cards.map(card => ({
...card,
count: '--', // 初始占位
click: () => {
context.$router?.push(card.path).catch(() => {
});
}
}))
};
};

View File

@@ -26,11 +26,11 @@
<!-- v-if="permission.afterSalesRequest_delete"-->
<!-- @click="handleDelete">删 除-->
<!-- </el-button>-->
<el-button type="warning"
plain
icon="el-icon-download"
@click="handleExport">导 出
</el-button>
<!-- <el-button type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ row }">
<el-button type="text"
@@ -226,14 +226,7 @@ import {getList, getDetail, add, update, remove, close} from "@/api/mall/afterSa
},
onLoad(page, params = {}) {
this.loading = true;
const {
} = this.query;
let values = {
};
getList(page.currentPage, page.pageSize, values).then(res => {
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data;
this.page.total = data.total;
this.data = data.records;

View File

@@ -51,6 +51,11 @@
<div class="section-title">余额概览</div>
<avue-data-rotate :option="option"></avue-data-rotate>
</basic-container>
<!-- 新增模块 -->
<basic-container>
<div class="section-title">待处理事宜</div>
<avue-data-panel :option="optionPending"></avue-data-panel>
</basic-container>
</el-col>
<el-col :span="9">
<el-col :span="24">
@@ -72,7 +77,7 @@
<script>
import {mapGetters} from 'vuex';
import {createDashboardCards, createUserPointCards, createUserOrderCards} from '@/option/staticData';
import {createDashboardCards, createUserPointCards, createUserOrderCards, createPendingCards} from '@/option/staticData';
const QWEATHER_KEY = '977c0d0cdeaf497196d834579a8eddee';
@@ -91,6 +96,7 @@ export default {
option: createDashboardCards(this),
optionUserPoint: createUserPointCards(this),
optionUserOrder: createUserOrderCards(this),
optionPending: createPendingCards(this),
statsRefreshTimer: null, // 定时器引用
isFetchingStats: false,
};
@@ -116,6 +122,7 @@ export default {
await this.fetchStats();
await this.fetchUserPointStats();
await this.fetchUserOrderStats();
await this.fetchPendingAfterSales();
this.statsRefreshTimer = setInterval(() => {
this.refreshAllStats();
}, 2 * 60 * 60 * 1000);
@@ -141,7 +148,8 @@ export default {
await Promise.all([
this.fetchStats(),
this.fetchUserPointStats(),
this.fetchUserOrderStats()
this.fetchUserOrderStats(),
this.fetchPendingAfterSales(),
]);
} catch (error) {
console.error('刷新统计数据失败:', error);
@@ -221,6 +229,29 @@ export default {
// 可选:显示错误提示
}
},
async fetchPendingAfterSales() {
try {
const stats = await this.$axios.get('/mall/after-sales/on-pending')
.then(r => r.data.data);
const newData = this.optionPending.data.map(item => {
// 安全取值:支持 null/undefined,转为 0
const rawValue = stats[item.key];
const value = rawValue != null ? Number(rawValue) : 0;
// 格式化数字(可选)
const formatted = value.toLocaleString('zh-CN', {
minimumFractionDigits: 0,
maximumFractionDigits: 2
});
return {...item, count: formatted};
});
this.optionPending = {...this.optionPending, data: newData};
} catch (error) {
console.error('Failed to fetch stats:', error);
// 可选:显示错误提示
}
},
refreshWeather() {
this.autoGetWeatherByCurrentLocation();
},