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) => { export const getList = (current, size, params) => {
return request({ return request({
url: '/mall/after-sales/list', url: '/mall/after-sales/page',
method: 'get', method: 'get',
params: { params: {
...params, ...params,

View File

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

View File

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

View File

@@ -51,6 +51,11 @@
<div class="section-title">余额概览</div> <div class="section-title">余额概览</div>
<avue-data-rotate :option="option"></avue-data-rotate> <avue-data-rotate :option="option"></avue-data-rotate>
</basic-container> </basic-container>
<!-- 新增模块 -->
<basic-container>
<div class="section-title">待处理事宜</div>
<avue-data-panel :option="optionPending"></avue-data-panel>
</basic-container>
</el-col> </el-col>
<el-col :span="9"> <el-col :span="9">
<el-col :span="24"> <el-col :span="24">
@@ -72,7 +77,7 @@
<script> <script>
import {mapGetters} from 'vuex'; import {mapGetters} from 'vuex';
import {createDashboardCards, createUserPointCards, createUserOrderCards} from '@/option/staticData'; import {createDashboardCards, createUserPointCards, createUserOrderCards, createPendingCards} from '@/option/staticData';
const QWEATHER_KEY = '977c0d0cdeaf497196d834579a8eddee'; const QWEATHER_KEY = '977c0d0cdeaf497196d834579a8eddee';
@@ -91,6 +96,7 @@ export default {
option: createDashboardCards(this), option: createDashboardCards(this),
optionUserPoint: createUserPointCards(this), optionUserPoint: createUserPointCards(this),
optionUserOrder: createUserOrderCards(this), optionUserOrder: createUserOrderCards(this),
optionPending: createPendingCards(this),
statsRefreshTimer: null, // 定时器引用 statsRefreshTimer: null, // 定时器引用
isFetchingStats: false, isFetchingStats: false,
}; };
@@ -116,6 +122,7 @@ export default {
await this.fetchStats(); await this.fetchStats();
await this.fetchUserPointStats(); await this.fetchUserPointStats();
await this.fetchUserOrderStats(); await this.fetchUserOrderStats();
await this.fetchPendingAfterSales();
this.statsRefreshTimer = setInterval(() => { this.statsRefreshTimer = setInterval(() => {
this.refreshAllStats(); this.refreshAllStats();
}, 2 * 60 * 60 * 1000); }, 2 * 60 * 60 * 1000);
@@ -141,7 +148,8 @@ export default {
await Promise.all([ await Promise.all([
this.fetchStats(), this.fetchStats(),
this.fetchUserPointStats(), this.fetchUserPointStats(),
this.fetchUserOrderStats() this.fetchUserOrderStats(),
this.fetchPendingAfterSales(),
]); ]);
} catch (error) { } catch (error) {
console.error('刷新统计数据失败:', 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() { refreshWeather() {
this.autoGetWeatherByCurrentLocation(); this.autoGetWeatherByCurrentLocation();
}, },