Commit 57caf30d13b8019a25539242402a9a8ae9374cb6
1 parent
c88d0c6b
二级表头
Showing
2 changed files
with
91 additions
and
66 deletions
src/pages/order3/SaleTask/components/AdviserTaskPreview.tsx
... | ... | @@ -4,8 +4,7 @@ import { observer } from "mobx-react-lite"; |
4 | 4 | import * as API from "../api"; |
5 | 5 | import useInitial from "@/hooks/useInitail"; |
6 | 6 | import ModifiedTableCell from "./ModifiedTableCell"; |
7 | - | |
8 | -const { Column } = Table; | |
7 | +import { ColumnsType } from "antd/es/table"; | |
9 | 8 | |
10 | 9 | // 查看销顾任务弹框 |
11 | 10 | interface AdviserTaskPreviewProps { |
... | ... | @@ -31,73 +30,100 @@ const AdviserTaskPreview = ({ |
31 | 30 | showSeriesModal(record); |
32 | 31 | }; |
33 | 32 | |
33 | + const columns: ColumnsType<API.TaskListItem> = [ | |
34 | + { | |
35 | + title: "姓名", | |
36 | + width: 100, | |
37 | + dataIndex: "dataName", | |
38 | + filterSearch: true, | |
39 | + onFilter: ( | |
40 | + value: string | number | boolean, | |
41 | + record: API.TaskListItem | |
42 | + ) => { | |
43 | + return record.dataName.startsWith(value.toString()); | |
44 | + }, | |
45 | + }, | |
46 | + { | |
47 | + title: "零售任务(台)", | |
48 | + children: [ | |
49 | + { | |
50 | + title: "合计", | |
51 | + dataIndex: "taskCount", | |
52 | + key: "taskCount", | |
53 | + render: (text: string, record: API.TaskListItem) => { | |
54 | + return ModifiedTableCell(record, "taskCount"); | |
55 | + }, | |
56 | + }, | |
57 | + { | |
58 | + title: "新能源车", | |
59 | + dataIndex: "newEnergyTaskCount", | |
60 | + key: "newEnergyTaskCount", | |
61 | + render: (text: string, record: API.TaskListItem) => { | |
62 | + return ModifiedTableCell(record, "newEnergyTaskCount"); | |
63 | + }, | |
64 | + }, | |
65 | + { | |
66 | + title: "传统燃油车", | |
67 | + dataIndex: "fuelVehicleTaskCount", | |
68 | + key: "fuelVehicleTaskCount", | |
69 | + render: (text: string, record: API.TaskListItem) => { | |
70 | + return ModifiedTableCell(record, "fuelVehicleTaskCount"); | |
71 | + }, | |
72 | + }, | |
73 | + ], | |
74 | + }, | |
75 | + { | |
76 | + title: "单车毛利任务(元)", | |
77 | + dataIndex: "vehicleGrossProfitTask", | |
78 | + render: (text: string, record: API.TaskListItem) => { | |
79 | + return ModifiedTableCell(record, "vehicleGrossProfitTask"); | |
80 | + }, | |
81 | + }, | |
82 | + { | |
83 | + title: "线索到店成交(台)", | |
84 | + width: 100, | |
85 | + dataIndex: "clueDealTaskCount", | |
86 | + render: (text: string, record: API.TaskListItem) => { | |
87 | + return ModifiedTableCell(record, "clueDealTaskCount"); | |
88 | + }, | |
89 | + }, | |
90 | + { | |
91 | + title: "首客试驾成交(台)", | |
92 | + width: 100, | |
93 | + dataIndex: "testDriveTaskCount", | |
94 | + render: (text: string, record: API.TaskListItem) => { | |
95 | + return ModifiedTableCell(record, "testDriveTaskCount"); | |
96 | + }, | |
97 | + }, | |
98 | + { | |
99 | + title: "攻坚车任务(台)", | |
100 | + width: 100, | |
101 | + dataIndex: "tackCarTaskCount", | |
102 | + render: (text: string, record: API.TaskListItem) => { | |
103 | + return ModifiedTableCell(record, "tackCarTaskCount"); | |
104 | + }, | |
105 | + }, | |
106 | + { | |
107 | + title: "车系任务(台)", | |
108 | + width: 100, | |
109 | + dataIndex: "seriesTaskCount", | |
110 | + render: (text: string, record: API.TaskListItem) => { | |
111 | + if (record.dataId === -999) return text; | |
112 | + return <a onClick={() => handlePreviewSeriesTask(record)}>{text}</a>; | |
113 | + }, | |
114 | + }, | |
115 | + ]; | |
116 | + | |
34 | 117 | return ( |
35 | 118 | <Table |
119 | + bordered | |
36 | 120 | rowKey="dataId" |
37 | 121 | loading={loading} |
122 | + columns={columns} | |
38 | 123 | dataSource={data.taskList} |
39 | 124 | pagination={false} |
40 | 125 | scroll={{ y: 450 }} |
41 | - > | |
42 | - <Column title="姓名" dataIndex="dataName" /> | |
43 | - <Column | |
44 | - title="零售任务(台)" | |
45 | - dataIndex="taskCount" | |
46 | - render={(text: string, record: API.TaskListItem) => { | |
47 | - return ModifiedTableCell(record, "taskCount"); | |
48 | - }} | |
49 | - /> | |
50 | - <Column | |
51 | - title="新能源车任务(台)" | |
52 | - dataIndex="newEnergyTaskCount" | |
53 | - render={(text: string, record: API.TaskListItem) => { | |
54 | - return ModifiedTableCell(record, "newEnergyTaskCount"); | |
55 | - }} | |
56 | - /> | |
57 | - <Column | |
58 | - title="传统燃油车任务(台)" | |
59 | - dataIndex="fuelVehicleTaskCount" | |
60 | - render={(text: string, record: API.TaskListItem) => { | |
61 | - return ModifiedTableCell(record, "fuelVehicleTaskCount"); | |
62 | - }} | |
63 | - /> | |
64 | - <Column | |
65 | - title="单车毛利任务(元)" | |
66 | - dataIndex="vehicleGrossProfitTask" | |
67 | - render={(text: string, record: API.TaskListItem) => { | |
68 | - return ModifiedTableCell(record, "vehicleGrossProfitTask"); | |
69 | - }} | |
70 | - /> | |
71 | - <Column | |
72 | - title="线索到店零售台数(台)" | |
73 | - dataIndex="clueDealTaskCount" | |
74 | - render={(text: string, record: API.TaskListItem) => { | |
75 | - return ModifiedTableCell(record, "clueDealTaskCount"); | |
76 | - }} | |
77 | - /> | |
78 | - <Column | |
79 | - title="首客试驾成交任务数(台)" | |
80 | - dataIndex="testDriveTaskCount" | |
81 | - render={(text: string, record: API.TaskListItem) => { | |
82 | - return ModifiedTableCell(record, "testDriveTaskCount"); | |
83 | - }} | |
84 | - /> | |
85 | - <Column | |
86 | - title="攻坚车任务数(台)" | |
87 | - dataIndex="tackCarTaskCount" | |
88 | - render={(text: string, record: API.TaskListItem) => { | |
89 | - return ModifiedTableCell(record, "tackCarTaskCount"); | |
90 | - }} | |
91 | - /> | |
92 | - <Column | |
93 | - title="车系任务数(台)" | |
94 | - dataIndex="seriesTaskCount" | |
95 | - render={(text: string, record: API.TaskListItem) => { | |
96 | - if (record.dataId === -999) return text; | |
97 | - return <a onClick={() => handlePreviewSeriesTask(record)}>{text}</a>; | |
98 | - }} | |
99 | - /> | |
100 | - </Table> | |
126 | + /> | |
101 | 127 | ); |
102 | 128 | }; |
103 | 129 | ... | ... |
src/pages/order3/SaleTask/index.tsx
... | ... | @@ -468,21 +468,20 @@ function SaleTaskList() { |
468 | 468 | > |
469 | 469 | <Row align="middle" justify="start" style={{ marginBottom: 20 }}> |
470 | 470 | <DatePicker |
471 | - placeholder="月度" | |
472 | 471 | style={{ width: 230 }} |
473 | 472 | picker="month" |
474 | 473 | value={targetMonth} |
475 | 474 | allowClear={false} |
476 | 475 | disabled |
477 | 476 | /> |
478 | - {/* <Input.Search | |
477 | + <Input.Search | |
479 | 478 | allowClear |
480 | - placeholder="门店名称" | |
479 | + placeholder="搜索门店或顾问" | |
481 | 480 | style={{ width: 263, marginLeft: 20 }} |
482 | 481 | onSearch={(v) => { |
483 | 482 | // todo setParams({ shopName: v }, true); |
484 | 483 | }} |
485 | - /> */} | |
484 | + /> | |
486 | 485 | </Row> |
487 | 486 | <EntryTaskPreview |
488 | 487 | params={previewTaskParams} | ... | ... |