Commit 78f597bb78205ee04378f96ac21b4bac82c7d5e0
Merge branch 'bug_fix' into 'master'
考评组bugfix See merge request !187
Showing
8 changed files
with
172 additions
and
29 deletions
src/pages/performance/CompensateGroupConfig/components/DraftList.tsx
@@ -89,7 +89,7 @@ export default ({ type }: Props) => { | @@ -89,7 +89,7 @@ export default ({ type }: Props) => { | ||
89 | 新增 | 89 | 新增 |
90 | </Button> | 90 | </Button> |
91 | </Row> | 91 | </Row> |
92 | - <Table loading={loading} rowKey={(row) => `id${row.id}`} dataSource={list} pagination={paginationConfig}> | 92 | + <Table loading={loading} rowKey={(row) => `id${row.draftId}`} dataSource={list} pagination={paginationConfig}> |
93 | <Column title="薪酬组名称" dataIndex="name" align="center" render={(name) => name || ""} /> | 93 | <Column title="薪酬组名称" dataIndex="name" align="center" render={(name) => name || ""} /> |
94 | <Column title="岗位" dataIndex="postName" align="center" /> | 94 | <Column title="岗位" dataIndex="postName" align="center" /> |
95 | <Column | 95 | <Column |
src/pages/performance/EvaDataImport/components/FileDatailsModal.tsx
0 → 100644
1 | +import React, { useState, useEffect } from "react"; | ||
2 | +import { | ||
3 | + Table, | ||
4 | + Input, | ||
5 | + InputNumber, | ||
6 | + Popconfirm, | ||
7 | + Form, | ||
8 | + Typography, | ||
9 | + Button, | ||
10 | + message, | ||
11 | + Space, | ||
12 | + Divider, | ||
13 | + Modal, | ||
14 | + Card, | ||
15 | +} from "antd"; | ||
16 | +import { cloneDeep } from "lodash"; | ||
17 | +import { KpiGroupSetteing } from "@/pages/performance/KpiGroupSetting/interface"; | ||
18 | +import { TargetType, TargetTypeEnum } from "@/pages/performance/entity"; | ||
19 | +import { render } from "react-dom"; | ||
20 | +import moment from "moment"; | ||
21 | +import { ReasonsEnum } from "../entity"; | ||
22 | +import { history } from "umi"; | ||
23 | +import st from "./style.less"; | ||
24 | + | ||
25 | +const Column = Table.Column; | ||
26 | + | ||
27 | +interface Props { | ||
28 | + visible: boolean; | ||
29 | + fileData: any; | ||
30 | + tarOnCancel: Function; | ||
31 | +} | ||
32 | +const columns = [ | ||
33 | + { | ||
34 | + title: "目标名称", | ||
35 | + dataIndex: "indicatorName", | ||
36 | + key: "indicatorName", | ||
37 | + }, | ||
38 | + | ||
39 | + { | ||
40 | + title: "目标值", | ||
41 | + dataIndex: "targetValue", | ||
42 | + key: "targetValue", | ||
43 | + render: (value: Number, record: any) => { | ||
44 | + return record.targetType === 2 ? `${value}%` : record.targetType === 3 ? `${value}元` : `${value}台`; | ||
45 | + }, | ||
46 | + }, | ||
47 | +]; | ||
48 | +const TargetModal = ({ visible, fileData, tarOnCancel }: Props) => { | ||
49 | + return ( | ||
50 | + <> | ||
51 | + <Modal title="导入数据详情" visible={visible} onCancel={() => tarOnCancel()} maskClosable={false} width={1500}> | ||
52 | + <Table bordered dataSource={fileData.details}> | ||
53 | + <Column title="归属人员" dataIndex="userName" align="center" render={(name) => <span>{name || "--"}</span>} /> | ||
54 | + <Column title="归属门店" dataIndex="shopName" align="center" render={(name) => <span>{name || "--"}</span>} /> | ||
55 | + <Column | ||
56 | + title="指标名称" | ||
57 | + dataIndex="indicatorName" | ||
58 | + align="center" | ||
59 | + render={(name) => <span>{name || "--"}</span>} | ||
60 | + /> | ||
61 | + <Column | ||
62 | + title="指标值" | ||
63 | + dataIndex="indicatorValue" | ||
64 | + align="center" | ||
65 | + render={(num, record: any) => ( | ||
66 | + <span> | ||
67 | + {num !== undefined | ||
68 | + ? `${num}${ | ||
69 | + record.dataType == 1 ? "台" : record.dataType == 2 ? "%" : record.dataType == 3 ? "元" : "" | ||
70 | + }` | ||
71 | + : "--"} | ||
72 | + </span> | ||
73 | + )} | ||
74 | + /> | ||
75 | + <Column | ||
76 | + title="考核周期" | ||
77 | + dataIndex="dataDate" | ||
78 | + align="center" | ||
79 | + render={(time: number) => (time ? moment(time).format("YYYY-MM-DD") : "--")} | ||
80 | + /> | ||
81 | + <Column | ||
82 | + title="是否导入" | ||
83 | + dataIndex="errorType" | ||
84 | + align="center" | ||
85 | + render={(_: any, record: any) => | ||
86 | + record.errorType ? <div className={st.no}>未导入</div> : <div className={st.yes}>已导入</div> | ||
87 | + } | ||
88 | + /> | ||
89 | + <Column | ||
90 | + title="未导入原因" | ||
91 | + dataIndex="errorType" | ||
92 | + align="center" | ||
93 | + render={(_: any, record: any) => (record.errorType ? ReasonsEnum[record.errorType] : "--")} | ||
94 | + /> | ||
95 | + </Table> | ||
96 | + </Modal> | ||
97 | + </> | ||
98 | + ); | ||
99 | +}; | ||
100 | + | ||
101 | +export default TargetModal; |
src/pages/performance/EvaDataImport/components/style.less
0 → 100644
1 | +.no { | ||
2 | + width: 47px; | ||
3 | + height: 18px; | ||
4 | + margin: 0 auto; | ||
5 | + color: #f4333c; | ||
6 | + font-weight: 500; | ||
7 | + font-size: 12px; | ||
8 | + line-height: 18px; | ||
9 | + border: 1px solid #f8797f; | ||
10 | + border-radius: 2px; | ||
11 | +} | ||
12 | +.yes { | ||
13 | + width: 47px; | ||
14 | + height: 18px; | ||
15 | + margin: 0 auto; | ||
16 | + color: #20c688; | ||
17 | + font-weight: 500; | ||
18 | + font-size: 12px; | ||
19 | + line-height: 18px; | ||
20 | + border: 1px solid #6ddab2; | ||
21 | + border-radius: 2px; | ||
22 | +} |
src/pages/performance/EvaDataImport/index.tsx
@@ -8,6 +8,7 @@ import type { UploadProps } from "antd"; | @@ -8,6 +8,7 @@ import type { UploadProps } from "antd"; | ||
8 | import { history } from "umi"; | 8 | import { history } from "umi"; |
9 | import moment from "moment"; | 9 | import moment from "moment"; |
10 | import Filter from './components/Filter'; | 10 | import Filter from './components/Filter'; |
11 | +import FileDatailsModal from './components/FileDatailsModal'; | ||
11 | 12 | ||
12 | const Column = Table.Column; | 13 | const Column = Table.Column; |
13 | 14 | ||
@@ -15,6 +16,8 @@ export default () => { | @@ -15,6 +16,8 @@ export default () => { | ||
15 | const { loading, list, paginationConfig, setParams, innerParams } = usePagination(evaDataListApi, { | 16 | const { loading, list, paginationConfig, setParams, innerParams } = usePagination(evaDataListApi, { |
16 | pageSize: 10, | 17 | pageSize: 10, |
17 | }); | 18 | }); |
19 | + const [fileData, setFileData] = useState({}); | ||
20 | + const [visible, setVisible] = useState<boolean>(false); | ||
18 | const uploadPerson: UploadProps = { | 21 | const uploadPerson: UploadProps = { |
19 | name: "file", | 22 | name: "file", |
20 | action: "/api/morax/erp/eval-indicator/staff-indicator", | 23 | action: "/api/morax/erp/eval-indicator/staff-indicator", |
@@ -25,10 +28,12 @@ export default () => { | @@ -25,10 +28,12 @@ export default () => { | ||
25 | console.log(info.file, info.fileList); | 28 | console.log(info.file, info.fileList); |
26 | } | 29 | } |
27 | if (info.file.status === "done") { | 30 | if (info.file.status === "done") { |
28 | - message.success(`${info.file.name} 导入成功`); | 31 | + message.success(`${info.file.name} 上传成功`); |
29 | setParams({ ...innerParams }, true); | 32 | setParams({ ...innerParams }, true); |
33 | + // setFileData(info.file.response.data); | ||
34 | + // setVisible(true); | ||
30 | } else if (info.file.status === "error") { | 35 | } else if (info.file.status === "error") { |
31 | - message.error(`${info.file.name} 导入失败`); | 36 | + message.error(`${info.file.name} 上传失败`); |
32 | } | 37 | } |
33 | }, | 38 | }, |
34 | }; | 39 | }; |
@@ -42,10 +47,10 @@ export default () => { | @@ -42,10 +47,10 @@ export default () => { | ||
42 | console.log(info.file, info.fileList); | 47 | console.log(info.file, info.fileList); |
43 | } | 48 | } |
44 | if (info.file.status === "done") { | 49 | if (info.file.status === "done") { |
45 | - message.success(`${info.file.name} 导入成功`); | 50 | + message.success(`${info.file.name} 上传成功`); |
46 | setParams({ ...innerParams }, true); | 51 | setParams({ ...innerParams }, true); |
47 | } else if (info.file.status === "error") { | 52 | } else if (info.file.status === "error") { |
48 | - message.error(`${info.file.name} 导入失败`); | 53 | + message.error(`${info.file.name} 上传失败`); |
49 | } | 54 | } |
50 | }, | 55 | }, |
51 | }; | 56 | }; |
@@ -57,12 +62,20 @@ export default () => { | @@ -57,12 +62,20 @@ export default () => { | ||
57 | <Filter setParams={setParams} /> | 62 | <Filter setParams={setParams} /> |
58 | <div> | 63 | <div> |
59 | <Button type="default" style={{ marginRight: 10 }}> | 64 | <Button type="default" style={{ marginRight: 10 }}> |
60 | - <a href="https://gate.feewee.cn/file/download?fid=74d1d724f9be48baa5921f3782037c3b" target="_blank" rel="noreferrer"> | 65 | + <a |
66 | + href="https://gate.feewee.cn/file/download?fid=74d1d724f9be48baa5921f3782037c3b" | ||
67 | + target="_blank" | ||
68 | + rel="noreferrer" | ||
69 | + > | ||
61 | 下载人员模板 | 70 | 下载人员模板 |
62 | </a> | 71 | </a> |
63 | </Button> | 72 | </Button> |
64 | <Button type="default" style={{ marginRight: 10 }}> | 73 | <Button type="default" style={{ marginRight: 10 }}> |
65 | - <a href="https://gate.feewee.cn/file/download?fid=e4eb136962164264a78753bd1d6061f3" target="_blank" rel="noreferrer"> | 74 | + <a |
75 | + href="https://gate.feewee.cn/file/download?fid=e4eb136962164264a78753bd1d6061f3" | ||
76 | + target="_blank" | ||
77 | + rel="noreferrer" | ||
78 | + > | ||
66 | 下载门店模板 | 79 | 下载门店模板 |
67 | </a> | 80 | </a> |
68 | </Button> | 81 | </Button> |
@@ -76,7 +89,6 @@ export default () => { | @@ -76,7 +89,6 @@ export default () => { | ||
76 | </Upload> | 89 | </Upload> |
77 | </div> | 90 | </div> |
78 | </Row> | 91 | </Row> |
79 | - | ||
80 | <Table | 92 | <Table |
81 | loading={loading} | 93 | loading={loading} |
82 | rowKey={(row) => `id${row.indicatorCode}`} | 94 | rowKey={(row) => `id${row.indicatorCode}`} |
@@ -137,6 +149,7 @@ export default () => { | @@ -137,6 +149,7 @@ export default () => { | ||
137 | )} | 149 | )} |
138 | /> | 150 | /> |
139 | </Table> | 151 | </Table> |
152 | + {/* <FileDatailsModal visible={visible} tarOnCancel={() => setVisible(false)} fileData={fileData} /> */} | ||
140 | </Card> | 153 | </Card> |
141 | </PageHeaderWrapper> | 154 | </PageHeaderWrapper> |
142 | ); | 155 | ); |
src/pages/performance/EvaGroupSetting/EditComfirm/components/RankModal.tsx
src/pages/performance/EvaGroupSetting/EditComfirm/components/TotalAmountSal.tsx
@@ -58,7 +58,7 @@ const TotalAmount = ({ | @@ -58,7 +58,7 @@ const TotalAmount = ({ | ||
58 | if (dataIndex == "upper" && isPercent == 2) { | 58 | if (dataIndex == "upper" && isPercent == 2) { |
59 | precision = 2; | 59 | precision = 2; |
60 | } | 60 | } |
61 | - const inputNode = inputType === "number" ? <InputNumber precision={precision} min={0} /> : <Input />; | 61 | + const inputNode = inputType === "number" ? <InputNumber precision={precision} /> : <Input />; |
62 | 62 | ||
63 | return ( | 63 | return ( |
64 | <td {...restProps}> | 64 | <td {...restProps}> |
@@ -360,24 +360,28 @@ const TotalAmount = ({ | @@ -360,24 +360,28 @@ const TotalAmount = ({ | ||
360 | }} | 360 | }} |
361 | /> | 361 | /> |
362 | </Form> | 362 | </Form> |
363 | + <div>金额可为负数,负数为负激励</div> | ||
363 | </Modal> | 364 | </Modal> |
364 | ) : ( | 365 | ) : ( |
365 | - <Form form={form} component={false}> | ||
366 | - <Table | ||
367 | - components={{ | ||
368 | - body: { | ||
369 | - cell: EditableCell, | ||
370 | - }, | ||
371 | - }} | ||
372 | - bordered | ||
373 | - dataSource={value} | ||
374 | - columns={mergedColumns} | ||
375 | - rowClassName="editable-row" | ||
376 | - pagination={{ | ||
377 | - onChange: cancel, | ||
378 | - }} | ||
379 | - /> | ||
380 | - </Form> | 366 | + <> |
367 | + <Form form={form} component={false}> | ||
368 | + <Table | ||
369 | + components={{ | ||
370 | + body: { | ||
371 | + cell: EditableCell, | ||
372 | + }, | ||
373 | + }} | ||
374 | + bordered | ||
375 | + dataSource={value} | ||
376 | + columns={mergedColumns} | ||
377 | + rowClassName="editable-row" | ||
378 | + pagination={{ | ||
379 | + onChange: cancel, | ||
380 | + }} | ||
381 | + /> | ||
382 | + </Form> | ||
383 | + <div>金额可为负数,负数为负激励</div> | ||
384 | + </> | ||
381 | )} | 385 | )} |
382 | </> | 386 | </> |
383 | ); | 387 | ); |
src/pages/performance/EvaGroupSetting/components/DraftList.tsx
1 | -import React, { useState } from "react"; | 1 | +import React, { useEffect, useState } from "react"; |
2 | import { PageHeaderWrapper } from "@ant-design/pro-layout"; | 2 | import { PageHeaderWrapper } from "@ant-design/pro-layout"; |
3 | import { Button, Card, Table, Row, Space, Typography, Divider, Popconfirm, message } from "antd"; | 3 | import { Button, Card, Table, Row, Space, Typography, Divider, Popconfirm, message } from "antd"; |
4 | import usePagination from "@/hooks/usePagination"; | 4 | import usePagination from "@/hooks/usePagination"; |
@@ -22,6 +22,9 @@ export default ({ type }: Props) => { | @@ -22,6 +22,9 @@ export default ({ type }: Props) => { | ||
22 | status: 2, | 22 | status: 2, |
23 | type: 1, | 23 | type: 1, |
24 | }); | 24 | }); |
25 | + useEffect(() => { | ||
26 | + console.log("list", list); | ||
27 | + }, [list]); | ||
25 | const [visibleDetail, setVisibleDetail] = useState(false); | 28 | const [visibleDetail, setVisibleDetail] = useState(false); |
26 | const [item, setItem] = useState<any>({}); | 29 | const [item, setItem] = useState<any>({}); |
27 | //删除 | 30 | //删除 |
@@ -69,7 +72,7 @@ export default ({ type }: Props) => { | @@ -69,7 +72,7 @@ export default ({ type }: Props) => { | ||
69 | </Row> | 72 | </Row> |
70 | <Table | 73 | <Table |
71 | loading={loading} | 74 | loading={loading} |
72 | - rowKey={(row) => `id${row.id}`} | 75 | + rowKey={(row) => `id${row.draftId}`} |
73 | dataSource={list} | 76 | dataSource={list} |
74 | pagination={paginationConfig} | 77 | pagination={paginationConfig} |
75 | scroll={{ x: 500 }} | 78 | scroll={{ x: 500 }} |
src/pages/performance/KpiGroupSetting/components/DraftList.tsx
@@ -92,7 +92,7 @@ export default ({ type }: Props) => { | @@ -92,7 +92,7 @@ export default ({ type }: Props) => { | ||
92 | </Row> | 92 | </Row> |
93 | <Table | 93 | <Table |
94 | loading={loading} | 94 | loading={loading} |
95 | - rowKey={(row) => `id${row.id}`} | 95 | + rowKey={(row) => `id${row.draftId}`} |
96 | dataSource={list} | 96 | dataSource={list} |
97 | pagination={paginationConfig} | 97 | pagination={paginationConfig} |
98 | scroll={{ x: 500 }} | 98 | scroll={{ x: 500 }} |