Commit 02999d30e3ed439ec9d889a9636f47cc6a4aed63
1 parent
a60f9f4a
零售任务分配入口列表二级表头
Showing
1 changed file
with
107 additions
and
57 deletions
src/pages/order3/SaleTask/index.tsx
@@ -23,8 +23,7 @@ import SeriesTaskPreview from "./components/SeriesTaskPreview"; | @@ -23,8 +23,7 @@ import SeriesTaskPreview from "./components/SeriesTaskPreview"; | ||
23 | import ApproveModal from "@/pages/order3/Common/ApproveModal"; | 23 | import ApproveModal from "@/pages/order3/Common/ApproveModal"; |
24 | import SaleTaskAutoAssign from "./components/SaleTaskAutoAssign"; | 24 | import SaleTaskAutoAssign from "./components/SaleTaskAutoAssign"; |
25 | import SaleTaskBatchSet from "./components/SaleTaskBatchSet"; | 25 | import SaleTaskBatchSet from "./components/SaleTaskBatchSet"; |
26 | - | ||
27 | -const { Column } = Table; | 26 | +import { ColumnsType } from "antd/es/table"; |
28 | 27 | ||
29 | export default () => ( | 28 | export default () => ( |
30 | <Provider> | 29 | <Provider> |
@@ -231,6 +230,107 @@ function SaleTaskList() { | @@ -231,6 +230,107 @@ function SaleTaskList() { | ||
231 | setParams({}, true); | 230 | setParams({}, true); |
232 | }; | 231 | }; |
233 | 232 | ||
233 | + const columns: ColumnsType<API.ShopTaskItem> = [ | ||
234 | + { | ||
235 | + title: "门店", | ||
236 | + dataIndex: "shopName", | ||
237 | + }, | ||
238 | + { | ||
239 | + title: "零售任务(台)", | ||
240 | + width: 100, | ||
241 | + children: [ | ||
242 | + { | ||
243 | + title: "合计", | ||
244 | + dataIndex: "taskCount", | ||
245 | + key: "taskCount", | ||
246 | + }, | ||
247 | + { | ||
248 | + title: "新能源车", | ||
249 | + dataIndex: "newEnergyTaskCount", | ||
250 | + key: "newEnergyTaskCount", | ||
251 | + }, | ||
252 | + { | ||
253 | + title: "传统燃油车", | ||
254 | + dataIndex: "fuelVehicleTaskCount", | ||
255 | + key: "fuelVehicleTaskCount", | ||
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 | + ], | ||
278 | + }, | ||
279 | + { | ||
280 | + title: "其中(台)", | ||
281 | + children: [ | ||
282 | + { | ||
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", | ||
296 | + }, | ||
297 | + { | ||
298 | + title: "车系", | ||
299 | + dataIndex: "seriesTaskCount", | ||
300 | + key: "seriesTaskCount", | ||
301 | + }, | ||
302 | + ], | ||
303 | + }, | ||
304 | + { | ||
305 | + title: "销顾任务", | ||
306 | + render: (text: string, record: API.ShopTaskItem) => { | ||
307 | + return ( | ||
308 | + <a | ||
309 | + onClick={() => { | ||
310 | + goToAdviserPage(record); | ||
311 | + }} | ||
312 | + > | ||
313 | + 查看 | ||
314 | + </a> | ||
315 | + ); | ||
316 | + }, | ||
317 | + }, | ||
318 | + { | ||
319 | + title: "操作", | ||
320 | + render: (text: string, record: API.ShopTaskItem) => { | ||
321 | + return ( | ||
322 | + <a | ||
323 | + onClick={() => { | ||
324 | + goToEditPage(record); | ||
325 | + }} | ||
326 | + > | ||
327 | + {isReadOnly ? "查看" : "编辑"} | ||
328 | + </a> | ||
329 | + ); | ||
330 | + }, | ||
331 | + }, | ||
332 | + ]; | ||
333 | + | ||
234 | return ( | 334 | return ( |
235 | <PageHeaderWrapper title="零售任务分配"> | 335 | <PageHeaderWrapper title="零售任务分配"> |
236 | <Card> | 336 | <Card> |
@@ -274,7 +374,9 @@ function SaleTaskList() { | @@ -274,7 +374,9 @@ function SaleTaskList() { | ||
274 | </Row> | 374 | </Row> |
275 | <Table | 375 | <Table |
276 | rowKey="id" | 376 | rowKey="id" |
377 | + bordered | ||
277 | loading={loading} | 378 | loading={loading} |
379 | + columns={columns} | ||
278 | dataSource={data.shopTaskList} | 380 | dataSource={data.shopTaskList} |
279 | pagination={false} | 381 | pagination={false} |
280 | scroll={{ y: 450 }} | 382 | scroll={{ y: 450 }} |
@@ -301,10 +403,8 @@ function SaleTaskList() { | @@ -301,10 +403,8 @@ function SaleTaskList() { | ||
301 | <Table.Summary.Cell index={4}> | 403 | <Table.Summary.Cell index={4}> |
302 | {data.fuelVehicleTaskCount} | 404 | {data.fuelVehicleTaskCount} |
303 | </Table.Summary.Cell> | 405 | </Table.Summary.Cell> |
304 | - <Table.Summary.Cell index={5} /> | ||
305 | - <Table.Summary.Cell index={6}> | ||
306 | - {data.vehicleGrossProfitTask} | ||
307 | - </Table.Summary.Cell> | 406 | + <Table.Summary.Cell index={5}>-</Table.Summary.Cell> |
407 | + <Table.Summary.Cell index={6}>-</Table.Summary.Cell> | ||
308 | <Table.Summary.Cell index={7}> | 408 | <Table.Summary.Cell index={7}> |
309 | {data.clueDealTaskCount} | 409 | {data.clueDealTaskCount} |
310 | </Table.Summary.Cell> | 410 | </Table.Summary.Cell> |
@@ -323,57 +423,7 @@ function SaleTaskList() { | @@ -323,57 +423,7 @@ function SaleTaskList() { | ||
323 | </Table.Summary> | 423 | </Table.Summary> |
324 | ); | 424 | ); |
325 | }} | 425 | }} |
326 | - > | ||
327 | - <Column title="门店" dataIndex="shopName" /> | ||
328 | - <Column title="零售任务(台)" dataIndex="taskCount" /> | ||
329 | - <Column title="新能源车任务(台)" dataIndex="newEnergyTaskCount" /> | ||
330 | - <Column title="传统燃油车任务(台)" dataIndex="fuelVehicleTaskCount" /> | ||
331 | - <Column title="单车毛利任务(元)" dataIndex="vehicleGrossProfitTask" /> | ||
332 | - <Column | ||
333 | - title="合计(元)" | ||
334 | - dataIndex="total" | ||
335 | - render={(text: string, record: API.ShopTaskItem) => { | ||
336 | - return (record.taskCount * record.vehicleGrossProfitTask).toFixed( | ||
337 | - 2 | ||
338 | - ); | ||
339 | - }} | ||
340 | - /> | ||
341 | - <Column title="线索到店零售台数(台)" dataIndex="clueDealTaskCount" /> | ||
342 | - <Column | ||
343 | - title="首客试驾成交任务数(台)" | ||
344 | - dataIndex="testDriveTaskCount" | ||
345 | - /> | ||
346 | - <Column title="攻坚车任务数(台)" dataIndex="tackCarTaskCount" /> | ||
347 | - <Column title="车系任务数(台)" dataIndex="seriesTaskCount" /> | ||
348 | - <Column | ||
349 | - title="销顾任务" | ||
350 | - render={(text: string, record: API.ShopTaskItem) => { | ||
351 | - return ( | ||
352 | - <a | ||
353 | - onClick={() => { | ||
354 | - goToAdviserPage(record); | ||
355 | - }} | ||
356 | - > | ||
357 | - 查看 | ||
358 | - </a> | ||
359 | - ); | ||
360 | - }} | ||
361 | - /> | ||
362 | - <Column | ||
363 | - title="操作" | ||
364 | - render={(text: string, record: API.ShopTaskItem) => { | ||
365 | - return ( | ||
366 | - <a | ||
367 | - onClick={() => { | ||
368 | - goToEditPage(record); | ||
369 | - }} | ||
370 | - > | ||
371 | - {isReadOnly ? "查看" : "编辑"} | ||
372 | - </a> | ||
373 | - ); | ||
374 | - }} | ||
375 | - /> | ||
376 | - </Table> | 426 | + /> |
377 | {data.revoke ? ( | 427 | {data.revoke ? ( |
378 | <Row align="middle" justify="center" style={{ marginTop: 50 }}> | 428 | <Row align="middle" justify="center" style={{ marginTop: 50 }}> |
379 | <Button onClick={cancelSaleTask}>撤销</Button> | 429 | <Button onClick={cancelSaleTask}>撤销</Button> |