Commit 604e7e51b5cc8651932dc6518f9c8e85b24b04f5

Authored by Shinner
1 parent 57caf30d

预览任务增加门店和顾问搜索

src/pages/order3/SaleTask/api.ts
... ... @@ -189,9 +189,10 @@ export interface PreviewTaskReq {
189 189 secondManageId?: number;
190 190 thirdManageId?: number;
191 191 taskId?: number;
192   - orderTaskApprovalType: number;
193   - id: number;
  192 + orderTaskApprovalType?: number;
  193 + id?: number;
194 194 token?: string;
  195 + keywords?: string;
195 196 }
196 197  
197 198 export interface TaskListItem {
... ...
src/pages/order3/SaleTask/components/EntryTaskPreview.tsx
1 1 import React, { useState } from "react";
2   -import { Card, Radio, RadioChangeEvent, Row, Table } from "antd";
  2 +import {
  3 + Card,
  4 + DatePicker,
  5 + Input,
  6 + Radio,
  7 + RadioChangeEvent,
  8 + Row,
  9 + Table,
  10 +} from "antd";
3 11 import { observer } from "mobx-react-lite";
4 12 import * as API from "../api";
5 13 import { OrderTaskApprovalType } from "../entity";
6 14 import useInitial from "@/hooks/useInitail";
7 15 import ModifiedTableCell from "./ModifiedTableCell";
8 16 import { ColumnsType } from "antd/es/table";
  17 +import { Moment } from "moment";
9 18  
10 19 const RadioButton = Radio.Button;
11 20 const RadioGroup = Radio.Group;
12 21  
13 22 // 预览任务入口弹框
14 23 interface EntryTaskPreviewProps {
  24 + month: Moment;
15 25 params: any; // API.PreviewTaskReq
16 26 showAdviserModal: (
17 27 record: API.TaskListItem,
... ... @@ -24,6 +34,7 @@ interface EntryTaskPreviewProps {
24 34 }
25 35  
26 36 const EntryTaskPreview = ({
  37 + month,
27 38 params,
28 39 showAdviserModal,
29 40 showSeriesModal,
... ... @@ -40,14 +51,12 @@ const EntryTaskPreview = ({
40 51 if (value === 99) {
41 52 setType(OrderTaskApprovalType.新车一级管理维度);
42 53 setParams(
43   - // @ts-ignore
44 54 { orderTaskApprovalType: OrderTaskApprovalType.新车一级管理维度 },
45 55 true
46 56 );
47 57 return;
48 58 }
49 59 setType(value);
50   - // @ts-ignore
51 60 setParams({ orderTaskApprovalType: value }, true);
52 61 };
53 62  
... ... @@ -164,53 +173,72 @@ const EntryTaskPreview = ({
164 173 ];
165 174  
166 175 return (
167   - <Card
168   - title={
169   - <Row align="middle" justify="start">
170   - <RadioGroup onChange={handleChangeType} value={type}>
171   - <RadioButton value={OrderTaskApprovalType.门店维度}>
172   - 门店
173   - </RadioButton>
174   - <RadioButton value={OrderTaskApprovalType.销售顾问维度}>
175   - 销顾
176   - </RadioButton>
177   - <RadioButton value={99}>销售管理层</RadioButton>
178   - </RadioGroup>
179   - {type !== OrderTaskApprovalType.门店维度 &&
180   - type !== OrderTaskApprovalType.销售顾问维度 && (
181   - <RadioGroup
182   - onChange={handleChangeType}
183   - value={type}
184   - style={{ marginLeft: 20 }}
185   - >
186   - <RadioButton value={OrderTaskApprovalType.新车一级管理维度}>
187   - 销售一级管理
188   - </RadioButton>
189   - <RadioButton value={OrderTaskApprovalType.新车二级管理维度}>
190   - 销售二级管理
191   - </RadioButton>
192   - <RadioButton value={OrderTaskApprovalType.新车三级管理维度}>
193   - 销售三级管理
194   - </RadioButton>
195   - </RadioGroup>
196   - )}
197   - </Row>
198   - }
199   - >
200   - <Table
201   - bordered
202   - rowKey="dataId"
203   - columns={
204   - type === OrderTaskApprovalType.门店维度
205   - ? columns.concat(extraColumns)
206   - : columns
  176 + <>
  177 + <Row align="middle" justify="start" style={{ marginBottom: 20 }}>
  178 + <DatePicker
  179 + style={{ width: 245 }}
  180 + picker="month"
  181 + value={month}
  182 + allowClear={false}
  183 + disabled
  184 + />
  185 + <Input.Search
  186 + allowClear
  187 + placeholder="搜索门店或顾问"
  188 + style={{ width: 263, marginLeft: 20 }}
  189 + onSearch={(v) => {
  190 + setParams({ keywords: v }, true);
  191 + }}
  192 + />
  193 + </Row>
  194 + <Card
  195 + title={
  196 + <Row align="middle" justify="start">
  197 + <RadioGroup onChange={handleChangeType} value={type}>
  198 + <RadioButton value={OrderTaskApprovalType.门店维度}>
  199 + 门店
  200 + </RadioButton>
  201 + <RadioButton value={OrderTaskApprovalType.销售顾问维度}>
  202 + 销顾
  203 + </RadioButton>
  204 + <RadioButton value={99}>销售管理层</RadioButton>
  205 + </RadioGroup>
  206 + {type !== OrderTaskApprovalType.门店维度 &&
  207 + type !== OrderTaskApprovalType.销售顾问维度 && (
  208 + <RadioGroup
  209 + onChange={handleChangeType}
  210 + value={type}
  211 + style={{ marginLeft: 20 }}
  212 + >
  213 + <RadioButton value={OrderTaskApprovalType.新车一级管理维度}>
  214 + 销售一级管理
  215 + </RadioButton>
  216 + <RadioButton value={OrderTaskApprovalType.新车二级管理维度}>
  217 + 销售二级管理
  218 + </RadioButton>
  219 + <RadioButton value={OrderTaskApprovalType.新车三级管理维度}>
  220 + 销售三级管理
  221 + </RadioButton>
  222 + </RadioGroup>
  223 + )}
  224 + </Row>
207 225 }
208   - loading={loading}
209   - dataSource={data.taskList}
210   - pagination={false}
211   - scroll={{ y: 450 }}
212   - />
213   - </Card>
  226 + >
  227 + <Table
  228 + bordered
  229 + rowKey="dataId"
  230 + columns={
  231 + type === OrderTaskApprovalType.门店维度
  232 + ? columns.concat(extraColumns)
  233 + : columns
  234 + }
  235 + loading={loading}
  236 + dataSource={data.taskList}
  237 + pagination={false}
  238 + scroll={{ y: 450 }}
  239 + />
  240 + </Card>
  241 + </>
214 242 );
215 243 };
216 244  
... ...
src/pages/order3/SaleTask/index.tsx
... ... @@ -466,24 +466,8 @@ function SaleTaskList() {
466 466 destroyOnClose
467 467 footer={null}
468 468 >
469   - <Row align="middle" justify="start" style={{ marginBottom: 20 }}>
470   - <DatePicker
471   - style={{ width: 230 }}
472   - picker="month"
473   - value={targetMonth}
474   - allowClear={false}
475   - disabled
476   - />
477   - <Input.Search
478   - allowClear
479   - placeholder="搜索门店或顾问"
480   - style={{ width: 263, marginLeft: 20 }}
481   - onSearch={(v) => {
482   - // todo setParams({ shopName: v }, true);
483   - }}
484   - />
485   - </Row>
486 469 <EntryTaskPreview
  470 + month={targetMonth}
487 471 params={previewTaskParams}
488 472 showAdviserModal={showAdviserModal}
489 473 showSeriesModal={showSeriesModal}
... ...