|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import React, { useContext, useEffect } from "react";
|
|
|
|
|
import React, { useContext, useEffect, useState } from "react";
|
|
|
|
|
import { Row, Col, Tabs, Table, Divider } from "antd";
|
|
|
|
|
import { ContainerOutlined } from "@ant-design/icons";
|
|
|
|
|
import { stores_Context } from "../config";
|
|
|
|
@ -10,6 +10,7 @@ import * as config from "../config";
|
|
|
|
|
import { utils, writeFileXLSX } from "xlsx";
|
|
|
|
|
import DateGroupRadio from '../components/DateGroupRadio';
|
|
|
|
|
import SearchForm from './../components/search/SearchForm';
|
|
|
|
|
import { TableExportBtn } from './../components/Data';
|
|
|
|
|
|
|
|
|
|
const Orders_sub = () => {
|
|
|
|
|
const { ordertype, ordertype_sub, ordertype_title } = useParams();
|
|
|
|
@ -175,154 +176,154 @@ const Orders_sub = () => {
|
|
|
|
|
const table_data_p = format_data(orders_store.orderCountData_Form_sub.ordercount1);
|
|
|
|
|
const table_data2_p = format_data(orders_store.orderCountData_Form_sub.ordercount2);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Row gutter={{ sm: 16, lg: 32 }}>
|
|
|
|
|
<Col md={24} lg={12} xxl={14}>
|
|
|
|
|
<NavLink to={`/orders`}>返回</NavLink>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<SearchForm
|
|
|
|
|
defaultValue={{
|
|
|
|
|
initialValue: {
|
|
|
|
|
...date_picker_store.formValues,
|
|
|
|
|
...orders_store.searchValues,
|
|
|
|
|
},
|
|
|
|
|
shows: ['DateType', 'DepartmentList', 'WebCode', 'IncludeTickets', 'dates'],
|
|
|
|
|
fieldProps: {
|
|
|
|
|
DepartmentList: { show_all: false },
|
|
|
|
|
WebCode: { show_all: true },
|
|
|
|
|
// dates: { hide_vs: true },
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
onSubmit={(_err, obj, form, str) => {
|
|
|
|
|
orders_store.setSearchValues(obj, form);
|
|
|
|
|
orders_store.getOrderCount_type(ordertype, ordertype_sub);
|
|
|
|
|
orders_store.getOrderCountByType_sub(ordertype, ordertype_sub, orders_store.active_tab_key_sub);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
const tab_items = [
|
|
|
|
|
{
|
|
|
|
|
key: 'detail', label: <span><ContainerOutlined />订单内容</span>, title: '订单内容',
|
|
|
|
|
children: (<Row>
|
|
|
|
|
<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 => (
|
|
|
|
|
<pre>
|
|
|
|
|
<Divider orientation="left" plain>
|
|
|
|
|
客户需求
|
|
|
|
|
</Divider>
|
|
|
|
|
{record.COLI_CustomerRequest}
|
|
|
|
|
<Divider orientation="left" plain>
|
|
|
|
|
订单内容
|
|
|
|
|
</Divider>
|
|
|
|
|
{record.COLI_OrderDetailText}
|
|
|
|
|
</pre>
|
|
|
|
|
),
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<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}>
|
|
|
|
|
{date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + "~" + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ""}
|
|
|
|
|
<Table
|
|
|
|
|
dataSource={table_data2.dataSource}
|
|
|
|
|
columns={table_data2.columns}
|
|
|
|
|
size="small"
|
|
|
|
|
rowKey={record => record.key}
|
|
|
|
|
expandable={{
|
|
|
|
|
expandedRowRender: record => <pre>{record.COLI_OrderDetailText}</pre>,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>),
|
|
|
|
|
},
|
|
|
|
|
{ key: 'page', label: <span><ContainerOutlined />访问路径</span>, title: '访问路径',children: (<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
|
|
|
|
|
<Table dataSource={table_data_p.dataSource} rowKey={record => record.key} columns={table_data_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + "~" + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ""}
|
|
|
|
|
<Table dataSource={table_data2_p.dataSource} rowKey={record => record.key} columns={table_data2_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>)},
|
|
|
|
|
{ key: 'page_cxstate1', label: <span><ContainerOutlined />访问路径(成行)</span>, title: '访问路径(成行)',children: (<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
|
|
|
|
|
<Table dataSource={table_data_p.dataSource} rowKey={record => record.key} columns={table_data_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={24} style={{textAlign: 'right'}}>
|
|
|
|
|
<DateGroupRadio
|
|
|
|
|
visible={data_source.length!==0}
|
|
|
|
|
dataRaw={orders_store.orderCountDataRaw_type}
|
|
|
|
|
onChange={orders_store.onChangeDateGroupSub}
|
|
|
|
|
value={orders_store.orderCount_type_dateRadio.lineChartXGroup}
|
|
|
|
|
dataMapper={orders_store.orderCount_type_dateRadio.orderCountDataMapper}
|
|
|
|
|
fieldMapper={orders_store.orderCount_type_dateRadio.orderCountDataFieldMapper}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Row gutter={[16, { xs: 8, sm: 16, md: 24, lg: 32 }]}>
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<Line {...line} />
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + "~" + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ""}
|
|
|
|
|
<Table dataSource={table_data2_p.dataSource} rowKey={record => record.key} columns={table_data2_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>)},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<Tabs activeKey={orders_store.active_tab_key_sub} onChange={active_key => orders_store.onChange_Tabs_sub(ordertype, ordertype_sub, active_key)}>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
订单内容
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="detail">
|
|
|
|
|
<Row>
|
|
|
|
|
<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 => (
|
|
|
|
|
<pre>
|
|
|
|
|
<Divider orientation="left" plain>
|
|
|
|
|
客户需求
|
|
|
|
|
</Divider>
|
|
|
|
|
{record.COLI_CustomerRequest}
|
|
|
|
|
<Divider orientation="left" plain>
|
|
|
|
|
订单内容
|
|
|
|
|
</Divider>
|
|
|
|
|
{record.COLI_OrderDetailText}
|
|
|
|
|
</pre>
|
|
|
|
|
),
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<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>
|
|
|
|
|
const [propsForExport, setPropsForExport] = useState(tab_items[0]);
|
|
|
|
|
const tabItemsMapped = tab_items.reduce((r, v) => ({...r, [v.key]: v}), {});
|
|
|
|
|
const onTabsChange = (active_key) => {
|
|
|
|
|
setPropsForExport(tabItemsMapped[active_key]);
|
|
|
|
|
orders_store.onChange_Tabs_sub(ordertype, ordertype_sub, active_key);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + "~" + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ""}
|
|
|
|
|
<Table
|
|
|
|
|
dataSource={table_data2.dataSource}
|
|
|
|
|
columns={table_data2.columns}
|
|
|
|
|
size="small"
|
|
|
|
|
rowKey={record => record.key}
|
|
|
|
|
expandable={{
|
|
|
|
|
expandedRowRender: record => <pre>{record.COLI_OrderDetailText}</pre>,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
访问路径
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="page">
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
|
|
|
|
|
<Table dataSource={table_data_p.dataSource} rowKey={record => record.key} columns={table_data_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Row gutter={{ sm: 16, lg: 32 }}>
|
|
|
|
|
<Col md={24} lg={12} xxl={14}>
|
|
|
|
|
<NavLink to={`/orders`}>返回</NavLink>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<SearchForm
|
|
|
|
|
defaultValue={{
|
|
|
|
|
initialValue: {
|
|
|
|
|
...date_picker_store.formValues,
|
|
|
|
|
...orders_store.searchValues,
|
|
|
|
|
},
|
|
|
|
|
shows: ['DateType', 'DepartmentList', 'WebCode', 'IncludeTickets', 'dates'],
|
|
|
|
|
fieldProps: {
|
|
|
|
|
DepartmentList: { show_all: false },
|
|
|
|
|
WebCode: { show_all: true },
|
|
|
|
|
// dates: { hide_vs: true },
|
|
|
|
|
},
|
|
|
|
|
}}
|
|
|
|
|
onSubmit={(_err, obj, form, str) => {
|
|
|
|
|
orders_store.setSearchValues(obj, form);
|
|
|
|
|
orders_store.getOrderCount_type(ordertype, ordertype_sub);
|
|
|
|
|
orders_store.getOrderCountByType_sub(ordertype, ordertype_sub, orders_store.active_tab_key_sub);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
<Col span={24} style={{ textAlign: 'right' }}>
|
|
|
|
|
<DateGroupRadio
|
|
|
|
|
visible={data_source.length !== 0}
|
|
|
|
|
dataRaw={orders_store.orderCountDataRaw_type}
|
|
|
|
|
onChange={orders_store.onChangeDateGroupSub}
|
|
|
|
|
value={orders_store.orderCount_type_dateRadio.lineChartXGroup}
|
|
|
|
|
dataMapper={orders_store.orderCount_type_dateRadio.orderCountDataMapper}
|
|
|
|
|
fieldMapper={orders_store.orderCount_type_dateRadio.orderCountDataFieldMapper}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + "~" + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ""}
|
|
|
|
|
<Table dataSource={table_data2_p.dataSource} rowKey={record => record.key} columns={table_data2_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
<Tabs.TabPane
|
|
|
|
|
tab={
|
|
|
|
|
<span>
|
|
|
|
|
<ContainerOutlined />
|
|
|
|
|
访问路径(成行)
|
|
|
|
|
</span>
|
|
|
|
|
}
|
|
|
|
|
key="page_cxstate1">
|
|
|
|
|
<Row>
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date.format(config.DATE_FORMAT)}~{date_picker_store.end_date.format(config.DATE_FORMAT)}
|
|
|
|
|
<Table dataSource={table_data_p.dataSource} rowKey={record => record.key} columns={table_data_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
<Row gutter={[16, { xs: 8, sm: 16, md: 24, lg: 32 }]}>
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<Line {...line} />
|
|
|
|
|
</Col>
|
|
|
|
|
|
|
|
|
|
<Col span={24}>
|
|
|
|
|
{date_picker_store.start_date_cp ? date_picker_store.start_date_cp.format(config.DATE_FORMAT) + "~" + date_picker_store.end_date_cp.format(config.DATE_FORMAT) : ""}
|
|
|
|
|
<Table dataSource={table_data2_p.dataSource} rowKey={record => record.key} columns={table_data2_p.columns} size="small" />
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</Tabs.TabPane>
|
|
|
|
|
</Tabs>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
<Col className="gutter-row" span={24}>
|
|
|
|
|
<Tabs
|
|
|
|
|
activeKey={orders_store.active_tab_key_sub}
|
|
|
|
|
onChange={onTabsChange}
|
|
|
|
|
tabBarExtraContent={{
|
|
|
|
|
right: (
|
|
|
|
|
<TableExportBtn
|
|
|
|
|
label={propsForExport.title}
|
|
|
|
|
{...(orders_store.active_tab_key_sub === 'detail'
|
|
|
|
|
? { columns: table_data.columns, dataSource: table_data.dataSource }
|
|
|
|
|
: { columns: table_data_p.columns, dataSource: table_data_p.dataSource })}
|
|
|
|
|
/>
|
|
|
|
|
),
|
|
|
|
|
}}
|
|
|
|
|
items={tab_items}
|
|
|
|
|
/>
|
|
|
|
|
</Col>
|
|
|
|
|
</Row>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
export default observer(Orders_sub);
|
|
|
|
|