添加订单导出功能

feature/2.0-sales-trade
尹诚诚 2 years ago
parent b0224fc032
commit 1d697f5eaa

@ -11,4 +11,10 @@ https://charts.ant.design/zh/examples/column/basic#basic
https://antv-g2plot.gitee.io/zh/examples/pie/basic/#legend-interaction
### momentjs
http://momentjs.cn/docs/
http://momentjs.cn/docs/
### mobx6
https://www.mobxjs.com/react-integration
### 添加权限
INSERT INTO [dbo].[ding_auth] ([din_userid] ,[din_auth] ,[din_username]) VALUES ('user_id','marketing','姓名')

@ -8,6 +8,7 @@ import DatePickerCharts from "../charts/DatePickerCharts";
import { NavLink, useParams } from "react-router-dom";
import * as comm from "../utils/commons";
import * as config from "../config";
import { utils, writeFileXLSX } from "xlsx";
const Orders_sub = () => {
const { ordertype, ordertype_sub, ordertype_title } = useParams();
@ -210,9 +211,11 @@ const Orders_sub = () => {
<Col span={24}>
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
<Table
id="table_to_xlsx_form"
dataSource={table_data.dataSource}
columns={table_data.columns}
size="small"
pagination={false}
rowKey={record => record.key}
expandable={{
expandedRowRender: record => (
@ -229,6 +232,15 @@ const Orders_sub = () => {
),
}}
/>
<Divider orientation="right" plain>
<a
onClick={() => {
const wb = utils.table_to_book(document.getElementById("table_to_xlsx_form").getElementsByTagName("table")[0]);
writeFileXLSX(wb, "订单列表.xlsx");
}}>
导出excel
</a>
</Divider>
</Col>
<Col span={24}>

Loading…
Cancel
Save