Commit d0ec8e1686fef52ea3e724fb31eb0e2b48c49157
1 parent
90c2447f
二级表头
Showing
5 changed files
with
150 additions
and
73 deletions
src/pages/order3/SaleTask/components/SaleTaskAutoAssign.tsx
... | ... | @@ -61,7 +61,7 @@ const defaultColumns: (ColumnTypes[number] & { |
61 | 61 | editable: false, |
62 | 62 | }, |
63 | 63 | { |
64 | - title: "攻坚车任务数(台)", | |
64 | + title: "攻坚车任务(台)", | |
65 | 65 | dataIndex: "tackCarTaskCount", |
66 | 66 | editable: true, |
67 | 67 | }, |
... | ... | @@ -184,9 +184,19 @@ export default function SaleTaskAutoAssign(props: SaleTaskAutoAssignProps) { |
184 | 184 | |
185 | 185 | const autoAssignSaleTask = (isAssignToAdviser: boolean) => { |
186 | 186 | Modal.confirm({ |
187 | - title: isAssignToAdviser | |
188 | - ? "确认分配到门店和顾问吗?" | |
189 | - : "确认分配到门店吗?", | |
187 | + title: isAssignToAdviser ? ( | |
188 | + <span> | |
189 | + 确认分配到 | |
190 | + <span className="tip">全部门店和顾问</span> | |
191 | + 吗? | |
192 | + </span> | |
193 | + ) : ( | |
194 | + <span> | |
195 | + 确认分配到 | |
196 | + <span className="tip">全部门店</span> | |
197 | + 吗? | |
198 | + </span> | |
199 | + ), | |
190 | 200 | zIndex: 1002, |
191 | 201 | onOk: async () => { |
192 | 202 | const hide = message.loading("分配中,请稍候", 0); | ... | ... |
src/pages/order3/SaleTask/components/SaleTaskBatchSet.tsx
... | ... | @@ -33,6 +33,10 @@ export default function SaleTaskBatchSet(props: SaleTaskBatchSetProps) { |
33 | 33 | const batchSetSaleTask = async (isAssignToAdviser: boolean) => { |
34 | 34 | await form.validateFields(); |
35 | 35 | const values = form.getFieldsValue(); |
36 | + if (Object.values(values).every((item) => !item)) { | |
37 | + message.warn("请设置任务后再进行分配"); | |
38 | + return; | |
39 | + } | |
36 | 40 | const newValues = {}; |
37 | 41 | Array.from(Object.keys(values)).forEach((valueKey: any) => { |
38 | 42 | if (values[valueKey]) { | ... | ... |
src/pages/order3/SaleTask/components/index.less
src/pages/order3/SaleTask/index.tsx
... | ... | @@ -233,11 +233,11 @@ function SaleTaskList() { |
233 | 233 | const columns: ColumnsType<API.ShopTaskItem> = [ |
234 | 234 | { |
235 | 235 | title: "门店", |
236 | + width: 150, | |
236 | 237 | dataIndex: "shopName", |
237 | 238 | }, |
238 | 239 | { |
239 | 240 | title: "零售任务(台)", |
240 | - width: 100, | |
241 | 241 | children: [ |
242 | 242 | { |
243 | 243 | title: "合计", |
... | ... | @@ -254,54 +254,53 @@ function SaleTaskList() { |
254 | 254 | dataIndex: "fuelVehicleTaskCount", |
255 | 255 | key: "fuelVehicleTaskCount", |
256 | 256 | }, |
257 | - { | |
258 | - title: "毛利任务(元)", | |
259 | - children: [ | |
260 | - { | |
261 | - title: "单车", | |
262 | - dataIndex: "vehicleGrossProfitTask", | |
263 | - key: "vehicleGrossProfitTask", | |
264 | - }, | |
265 | - { | |
266 | - title: "合计", | |
267 | - dataIndex: "grossProfitTaskTotal", | |
268 | - key: "grossProfitTaskTotal", | |
269 | - render: (text: string, record: API.ShopTaskItem) => { | |
270 | - return ( | |
271 | - record.taskCount * record.vehicleGrossProfitTask | |
272 | - ).toFixed(2); | |
273 | - }, | |
274 | - }, | |
275 | - ], | |
276 | - }, | |
277 | 257 | ], |
278 | 258 | }, |
279 | 259 | { |
280 | - title: "其中(台)", | |
260 | + title: "毛利任务(元)", | |
281 | 261 | children: [ |
282 | 262 | { |
283 | - title: "线索到店零售", | |
284 | - dataIndex: "clueDealTaskCount", | |
285 | - key: "clueDealTaskCount", | |
286 | - }, | |
287 | - { | |
288 | - title: "首客试驾成交", | |
289 | - dataIndex: "testDriveTaskCount", | |
290 | - key: "testDriveTaskCount", | |
291 | - }, | |
292 | - { | |
293 | - title: "攻坚车", | |
294 | - dataIndex: "tackCarTaskCount", | |
295 | - key: "tackCarTaskCount", | |
263 | + title: "合计", | |
264 | + dataIndex: "grossProfitTaskTotal", | |
265 | + key: "grossProfitTaskTotal", | |
266 | + render: (text: string, record: API.ShopTaskItem) => { | |
267 | + return (record.taskCount * record.vehicleGrossProfitTask).toFixed( | |
268 | + 2 | |
269 | + ); | |
270 | + }, | |
296 | 271 | }, |
297 | 272 | { |
298 | - title: "车系", | |
299 | - dataIndex: "seriesTaskCount", | |
300 | - key: "seriesTaskCount", | |
273 | + title: "单车", | |
274 | + dataIndex: "vehicleGrossProfitTask", | |
275 | + key: "vehicleGrossProfitTask", | |
301 | 276 | }, |
302 | 277 | ], |
303 | 278 | }, |
304 | 279 | { |
280 | + title: "线索到店成交(台)", | |
281 | + width: 100, | |
282 | + dataIndex: "clueDealTaskCount", | |
283 | + key: "clueDealTaskCount", | |
284 | + }, | |
285 | + { | |
286 | + title: "首客试驾成交(台)", | |
287 | + width: 100, | |
288 | + dataIndex: "testDriveTaskCount", | |
289 | + key: "testDriveTaskCount", | |
290 | + }, | |
291 | + { | |
292 | + title: "攻坚车任务(台)", | |
293 | + width: 100, | |
294 | + dataIndex: "tackCarTaskCount", | |
295 | + key: "tackCarTaskCount", | |
296 | + }, | |
297 | + { | |
298 | + title: "车系任务(台)", | |
299 | + width: 100, | |
300 | + dataIndex: "seriesTaskCount", | |
301 | + key: "seriesTaskCount", | |
302 | + }, | |
303 | + { | |
305 | 304 | title: "销顾任务", |
306 | 305 | render: (text: string, record: API.ShopTaskItem) => { |
307 | 306 | return ( | ... | ... |
src/pages/order3/SaleTask/subpages/TaskEdit/components/AdviserTask.tsx
... | ... | @@ -5,8 +5,7 @@ import * as API from "../../../api"; |
5 | 5 | import AdviserTaskEdit from "./AdviserTaskEdit"; |
6 | 6 | import { history, useRequest } from "umi"; |
7 | 7 | import { cloneDeep } from "lodash"; |
8 | - | |
9 | -const { Column } = Table; | |
8 | +import { ColumnsType } from "antd/es/table"; | |
10 | 9 | |
11 | 10 | interface AdviserTaskEditForm { |
12 | 11 | submit: (callback: (data: any) => void) => void; |
... | ... | @@ -72,6 +71,94 @@ export default function AdviserTask({ form }: AdviserTaskProps) { |
72 | 71 | }); |
73 | 72 | }; |
74 | 73 | |
74 | + const columns: ColumnsType<API.StaffTaskItem> = [ | |
75 | + { | |
76 | + title: "销售顾问", | |
77 | + width: 100, | |
78 | + dataIndex: "staffName", | |
79 | + }, | |
80 | + { | |
81 | + title: "零售任务(台)", | |
82 | + children: [ | |
83 | + { | |
84 | + title: "合计", | |
85 | + dataIndex: "taskCount", | |
86 | + key: "taskCount", | |
87 | + }, | |
88 | + { | |
89 | + title: "新能源车", | |
90 | + dataIndex: "newEnergyTaskCount", | |
91 | + key: "newEnergyTaskCount", | |
92 | + }, | |
93 | + { | |
94 | + title: "传统燃油车", | |
95 | + dataIndex: "fuelVehicleTaskCount", | |
96 | + key: "fuelVehicleTaskCount", | |
97 | + }, | |
98 | + ], | |
99 | + }, | |
100 | + { | |
101 | + title: "毛利任务(元)", | |
102 | + children: [ | |
103 | + { | |
104 | + title: "合计", | |
105 | + dataIndex: "grossProfitTaskTotal", | |
106 | + key: "grossProfitTaskTotal", | |
107 | + render: (text: string, record: API.StaffTaskItem) => { | |
108 | + return (record.taskCount * record.vehicleGrossProfitTask).toFixed( | |
109 | + 2 | |
110 | + ); | |
111 | + }, | |
112 | + }, | |
113 | + { | |
114 | + title: "单车", | |
115 | + dataIndex: "vehicleGrossProfitTask", | |
116 | + key: "vehicleGrossProfitTask", | |
117 | + }, | |
118 | + ], | |
119 | + }, | |
120 | + { | |
121 | + title: "线索到店成交(台)", | |
122 | + width: 100, | |
123 | + dataIndex: "clueDealTaskCount", | |
124 | + key: "clueDealTaskCount", | |
125 | + }, | |
126 | + { | |
127 | + title: "首客试驾成交(台)", | |
128 | + width: 100, | |
129 | + dataIndex: "testDriveTaskCount", | |
130 | + key: "testDriveTaskCount", | |
131 | + }, | |
132 | + { | |
133 | + title: "攻坚车任务(台)", | |
134 | + width: 100, | |
135 | + dataIndex: "tackCarTaskCount", | |
136 | + key: "tackCarTaskCount", | |
137 | + }, | |
138 | + { | |
139 | + title: "车系任务(台)", | |
140 | + width: 100, | |
141 | + dataIndex: "seriesTaskCount", | |
142 | + key: "seriesTaskCount", | |
143 | + }, | |
144 | + { | |
145 | + title: "操作", | |
146 | + render: (text: string, record: API.StaffTaskItem) => { | |
147 | + if (isReadOnly) return "-"; | |
148 | + return ( | |
149 | + <a | |
150 | + onClick={() => { | |
151 | + setEditAdviser(cloneDeep(record)); // 注意对象引用 | |
152 | + setVisible(true); | |
153 | + }} | |
154 | + > | |
155 | + 编辑 | |
156 | + </a> | |
157 | + ); | |
158 | + }, | |
159 | + }, | |
160 | + ]; | |
161 | + | |
75 | 162 | return ( |
76 | 163 | <> |
77 | 164 | <Row |
... | ... | @@ -87,39 +174,12 @@ export default function AdviserTask({ form }: AdviserTaskProps) { |
87 | 174 | /> |
88 | 175 | </Row> |
89 | 176 | <Table |
177 | + columns={columns} | |
90 | 178 | dataSource={[...advisersFiltered]} |
91 | 179 | pagination={false} |
92 | 180 | rowKey="id" |
93 | 181 | loading={false} |
94 | - > | |
95 | - <Column title="销售顾问" dataIndex="staffName" width={100} /> | |
96 | - <Column title="零售任务(台)" dataIndex="taskCount" /> | |
97 | - <Column title="新能源车任务(台)" dataIndex="newEnergyTaskCount" /> | |
98 | - <Column title="传统燃油车任务(台)" dataIndex="fuelVehicleTaskCount" /> | |
99 | - <Column title="单车毛利任务(元)" dataIndex="vehicleGrossProfitTask" /> | |
100 | - <Column title="线索到店零售台数(台)" dataIndex="clueDealTaskCount" /> | |
101 | - <Column title="攻坚车任务数(台)" dataIndex="tackCarTaskCount" /> | |
102 | - <Column title="首客试驾成交任务数(台)" dataIndex="testDriveTaskCount" /> | |
103 | - <Column title="车系任务数(台)" dataIndex="seriesTaskCount" /> | |
104 | - {!isReadOnly && ( | |
105 | - <Column | |
106 | - title="操作" | |
107 | - width={100} | |
108 | - render={(text: string, record: API.StaffTaskItem) => { | |
109 | - return ( | |
110 | - <a | |
111 | - onClick={() => { | |
112 | - setEditAdviser(cloneDeep(record)); // 注意对象引用 | |
113 | - setVisible(true); | |
114 | - }} | |
115 | - > | |
116 | - 编辑 | |
117 | - </a> | |
118 | - ); | |
119 | - }} | |
120 | - /> | |
121 | - )} | |
122 | - </Table> | |
182 | + /> | |
123 | 183 | <Row align="middle" justify="center" style={{ marginTop: 50 }}> |
124 | 184 | <Button onClick={handleGoBack}>返回列表</Button> |
125 | 185 | {!isReadOnly && ( | ... | ... |