Quellcode durchsuchen

报表导出

tags/小炒逻辑变更前
gwbvipvip vor 2 Jahren
Ursprung
Commit
e01a5e9445
3 geänderte Dateien mit 33 neuen und 3 gelöschten Zeilen
  1. +1
    -0
      src/pages/foodMenu/storeFoodMenu/index.jsx
  2. +30
    -1
      src/pages/order/order-flow-manage/index.jsx
  3. +2
    -2
      src/pages/order/order-flow-manage/service.js

+ 1
- 0
src/pages/foodMenu/storeFoodMenu/index.jsx Datei anzeigen

@@ -92,6 +92,7 @@ const TableList = () => {
{
title: '店铺名称',
dataIndex: 'name',
search:false
}
];
return (


+ 30
- 1
src/pages/order/order-flow-manage/index.jsx Datei anzeigen

@@ -289,6 +289,35 @@ const Manage = () => {
},
];

//下载Excel
const onDownloadExcel = async () => {
const response = await api.GetFlowExport(Selectparams)
if (response.isSuccess) {
let option = {}; //option代表的就是excel文件
const date = new Date();
const excelName = "订单流水" + date.toLocaleString().replaceAll('\/', '-');
option.fileName = excelName; //excel文件名称
const sheetHeader = ['storeTypeName','storeName','order_Number','order_OriginalMoney','order_RealMoney','refundOriginalMoney','refundRealMoney','order_Count','order_CreateTime'];;
// Object.keys(response.data[0]).forEach(item => {
// sheetHeader.push(item);
// });
option.datas = [
{
sheetData: response.data, //excel文件中的数据源
sheetName: excelName, //excel文件中sheet页名称
sheetFilter: sheetHeader, //excel文件中需显示的列数据
sheetHeader: ['店铺分类', '店铺名称', '交易单号', '应付金额', '实付金额',
'应付金额(退)', '实付金额(退)', '子订单数量', '创建时间',
] //excel文件中每列的表头名称
}
]
let toExcel = new ExportJsonExcel(option); //生成excel文件
toExcel.saveExcel();
} else {
message.error(response.errors || '导出失败');
}
}

return (
<PageContainer>
<ProTable
@@ -299,7 +328,7 @@ const Manage = () => {
labelWidth: 120,
}}
toolBarRender={() => [
<Button type="primary" key="create" onClick={() => handleExport()}>
<Button type="primary" key="create" onClick={onDownloadExcel}>
<DownloadOutlined /> 导出
</Button>,
]}


+ 2
- 2
src/pages/order/order-flow-manage/service.js Datei anzeigen

@@ -78,8 +78,8 @@ export default {
GetFlowExport(data) {
return request(`/kitchen/api/Order/GetFlowExport`, {
method: 'Post',
data: data,
responseType: 'blob',
data: data
// params: { ...params },
// ...(options || {}),
});


Laden…
Abbrechen
Speichern