312
This commit is contained in:
parent
301b1bde22
commit
5a1f26902a
|
|
@ -88,7 +88,7 @@ public class StatisticsController : BusinessControllerBase
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = await _statisticsService.GetBoxStatisticsAsync(request);
|
var result = await _statisticsService.GetBoxStatisticsAsync(request);
|
||||||
return Ok(new { code = 0, msg = "获取成功", data = result });
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -101,21 +101,7 @@ public class StatisticsController : BusinessControllerBase
|
||||||
public async Task<IActionResult> GetBoxProfitList([FromQuery] BoxProfitListRequest request)
|
public async Task<IActionResult> GetBoxProfitList([FromQuery] BoxProfitListRequest request)
|
||||||
{
|
{
|
||||||
var result = await _statisticsService.GetBoxProfitListAsync(request);
|
var result = await _statisticsService.GetBoxProfitListAsync(request);
|
||||||
return Ok(new
|
return Ok(result);
|
||||||
{
|
|
||||||
code = 0,
|
|
||||||
msg = "获取数据成功",
|
|
||||||
count = result.Total,
|
|
||||||
data = result.List,
|
|
||||||
summary = new BoxProfitSummary
|
|
||||||
{
|
|
||||||
TotalIncome = 0,
|
|
||||||
TotalCost = 0,
|
|
||||||
TotalProfit = 0,
|
|
||||||
TotalReMoney = 0,
|
|
||||||
TotalFhMoney = 0
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -149,6 +135,6 @@ public class StatisticsController : BusinessControllerBase
|
||||||
};
|
};
|
||||||
|
|
||||||
var result = await _statisticsService.GetSummaryStatisticsAsync(request);
|
var result = await _statisticsService.GetSummaryStatisticsAsync(request);
|
||||||
return Ok(new { code = 0, msg = "获取成功", data = result });
|
return Ok(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="typeName" label="类型" width="100" align="center" />
|
<el-table-column prop="typeName" label="类型" width="100" align="center" />
|
||||||
<el-table-column prop="price" label="单价" width="80" align="right">
|
<el-table-column prop="price" label="单价" width="80" align="right">
|
||||||
<template #default="{ row }">¥{{ row.price.toFixed(2) }}</template>
|
<template #default="{ row }">¥{{ (row.price ?? 0).toFixed(2) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="statusName" label="状态" width="80" align="center">
|
<el-table-column prop="statusName" label="状态" width="80" align="center">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
|
|
@ -276,12 +276,9 @@ async function loadData() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const res = await getBoxProfitList(params) as any
|
const res = await getBoxProfitList(params) as any
|
||||||
console.log('box-profit-list 响应:', res)
|
|
||||||
if (res.code === 0 && res.data) {
|
if (res.code === 0 && res.data) {
|
||||||
// 响应被包了两层:res.data 是 { code, msg, count, data, summary }
|
tableData.value = res.data.list || []
|
||||||
const innerData = res.data
|
pagination.total = res.data.total || 0
|
||||||
tableData.value = innerData.data || []
|
|
||||||
pagination.total = innerData.count || 0
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载数据失败:', error)
|
console.error('加载数据失败:', error)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user