Bläddra i källkod

报表导出

dev
yangwenhua 1 år sedan
förälder
incheckning
2d0073be98
2 ändrade filer med 59 tillägg och 4 borttagningar
  1. +34
    -2
      src/pages/card/reservation/index.jsx
  2. +25
    -2
      src/pages/card/reservation/service.js

+ 34
- 2
src/pages/card/reservation/index.jsx Visa fil

@@ -164,6 +164,38 @@ export default () => {
)
}

const onExportGoodsExcel = async () => {
const findDepart = department.find(item => item.value === currentDepartment);
let jsonData = {
beginTime: timeRange[0]._i,
endTime: timeRange[1]._i,
orgName: findDepart?.label || '',
mealType: dinnerTime || '',
current: currentPage,
pageSize
}
const response = await API.GetReservationGoodsExcel(jsonData);
if (response.statusCode === 200) {

}
}

const onExportUserExcel = async () => {
const findDepart = department.find(item => item.value === currentDepartment);
let jsonData = {
beginTime: timeRange[0]._i,
endTime: timeRange[1]._i,
orgName: findDepart?.label || '',
mealType: dinnerTime || '',
current: currentPage,
pageSize
}
const response = await API.GetReservationUserExcel(jsonData);
if (response.statusCode === 200) {
}
}

useEffect(() => {
onFetchDetartment();
}, []);
@@ -244,7 +276,7 @@ export default () => {
<div className={styles['tabs-title']}>
预定菜品统计
</div>
<Button type="primary" icon={<DownloadOutlined />} size="middle">
<Button type="primary" icon={<DownloadOutlined />} size="middle" onClick={onExportGoodsExcel}>
报表下载
</Button>
</Space>
@@ -262,7 +294,7 @@ export default () => {
<div className={styles['tabs-title']}>
预定人员列表
</div>
<Button type="primary" icon={<DownloadOutlined />} size="middle">
<Button type="primary" icon={<DownloadOutlined />} size="middle" onClick={onExportUserExcel}>
报表下载
</Button>
</Space>


+ 25
- 2
src/pages/card/reservation/service.js Visa fil

@@ -1,7 +1,7 @@
import { request } from 'umi';

export default {
//获取所有门店
//获取预定人员
GetReservationUser(data) {
return request('/kitchen/api/Reservation/GetReservationUser', {
method: 'POST',
@@ -9,7 +9,7 @@ export default {
});
},

//获取会员分页
//获取预定商品
GetReservationGoods(data) {
return request('/kitchen/api/Reservation/GetReservationGoods', {
method: 'POST',
@@ -25,5 +25,28 @@ export default {
method: 'POST',
data
});
},

/**
* 获取预定商品Excel
* @param {*} data
* @returns
*/
GetReservationGoodsExcel(data) {
return request('/kitchen/api/Reservation/GetReservationGoodsExcel', {
method: 'POST',
data
});
},

/**
* 获取预定人员Excel
* @param {*} data
*/
GetReservationUserExcel(data) {
return request('/kitchen/api/Reservation/GetReservationUserExcel', {
method: 'POST',
data
});
}
}

Laddar…
Avbryt
Spara