Commit 1a951613cf9f0facafa6e600afc78ba217d4cc20
1 parent
cdb1e168
🐹 feat(*): 绩效bug修复
Showing
8 changed files
with
23 additions
and
41 deletions
src/pages/performance/EvaGroupSetting/EditComfirm/components/LadderParams.tsx
... | ... | @@ -34,8 +34,9 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundred, |
34 | 34 | }, []); |
35 | 35 | useEffect(() => { |
36 | 36 | if (indicatorsList && indicatorsList.length > 0) { |
37 | - const res = indicatorsList.filter((item) => !selectedIndicatorsLadder.find((y) => y === item.code)); | |
38 | - setNewIndicators([...res]); | |
37 | + // fixme 这里有问题,限制在整个排名组了。实际上只能在单个组里。暂时不做限制,需要调整 | |
38 | + // const res = indicatorsList.filter((item) => !selectedIndicatorsLadder.find((y) => y === item.code)); | |
39 | + setNewIndicators([...indicatorsList]); | |
39 | 40 | } |
40 | 41 | }, [indicatorsList]); |
41 | 42 | // 编辑 | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddIndicatorsModal.tsx
1 | -/* eslint-disable no-return-assign */ | |
2 | -/* eslint-disable no-return-assign */ | |
3 | 1 | import React, { useEffect, useState } from 'react'; |
4 | 2 | import { Modal, Form, Select, InputNumber, message, Spin, Radio, Input, Button } from 'antd'; |
5 | -import { saveRewardsListApi } from '../RewardsList/api'; | |
6 | 3 | import { useStore } from '../index'; |
7 | -import { queryPostIndicatorApi } from '../api'; | |
8 | 4 | import _ from 'lodash'; |
9 | -import useInitail from '@/hooks/useInitail'; | |
10 | 5 | import LadderTable from './LadderTable'; |
11 | 6 | import CommissionParams from '@/pages/performance/KpiGroupSetting/EditComfirm/components/CommissionParams'; |
12 | 7 | import LadderParams from '@/pages/performance/KpiGroupSetting/EditComfirm/components/LadderParams'; |
13 | 8 | import Conds from '@/pages/performance/KpiGroupSetting/EditComfirm/components/Conds'; |
14 | -import { KpiGroupSetteing } from '@/pages/performance/KpiGroupSetting/interface'; | |
9 | +import type { KpiGroupSetteing } from '@/pages/performance/KpiGroupSetting/interface'; | |
15 | 10 | |
16 | 11 | const Option = Select.Option; |
17 | 12 | interface Props { |
18 | 13 | visible: boolean; |
19 | - onCancel: Function; | |
14 | + onCancel: () => void; | |
20 | 15 | postId?: number; |
21 | 16 | shopIds?: string; |
22 | 17 | onOk: (vales: any) => void; |
... | ... | @@ -66,7 +61,6 @@ export default function AddIndicatorsModal(props: Props) { |
66 | 61 | // }, [indicatorsList]); |
67 | 62 | // 校验表单数据 |
68 | 63 | function transformDTO(formData: any) { |
69 | - console.log('InformData', formData); | |
70 | 64 | const detail = {}; |
71 | 65 | _.each(formData, (value: any, key: string) => { |
72 | 66 | switch (key) { |
... | ... | @@ -122,7 +116,6 @@ export default function AddIndicatorsModal(props: Props) { |
122 | 116 | Object.assign(item, { sort: index + 1 }); |
123 | 117 | }); |
124 | 118 | } |
125 | - console.log('cond', pa?.conds); | |
126 | 119 | |
127 | 120 | // 校验标准分不能大于绩效分值 |
128 | 121 | const indicatorValue = pa.baseScore; |
... | ... | @@ -142,18 +135,9 @@ export default function AddIndicatorsModal(props: Props) { |
142 | 135 | } |
143 | 136 | } |
144 | 137 | |
145 | - const newItemId = pa.id; | |
146 | - // 编辑时,不需要push id | |
147 | - // if (currentItem.id) { | |
148 | - // const tmpIds = [...selectedIndicators]; | |
149 | - // tmpIds.push(newItemId); | |
150 | - // setSelectedIndicators([...tmpIds]); | |
151 | - // setSelectedIndicatorsConds([...tmpIds]); | |
152 | - // } | |
153 | 138 | if (hundred === 100) { |
154 | 139 | setIsHundred(false); |
155 | 140 | onOk(pa); |
156 | - console.log(pa); | |
157 | 141 | onCancel && onCancel(); |
158 | 142 | } else { |
159 | 143 | setIsHundred(true); |
... | ... | @@ -178,7 +162,7 @@ export default function AddIndicatorsModal(props: Props) { |
178 | 162 | return ( |
179 | 163 | <Modal |
180 | 164 | title={`${currentItem.name ? '编辑' : '新增'}指标`} |
181 | - visible={visible} | |
165 | + open={visible} | |
182 | 166 | maskClosable={false} |
183 | 167 | afterClose={() => { |
184 | 168 | form.resetFields(); | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddKpiGroups.tsx
... | ... | @@ -2,10 +2,11 @@ import React, { useEffect, useState, useRef } from "react"; |
2 | 2 | import { Modal, Form, Select, message, Radio, Input } from "antd"; |
3 | 3 | import { useStore } from "../index"; |
4 | 4 | import _ from "lodash"; |
5 | -import { KpiGroupSetteing } from "@/pages/performance/KpiGroupSetting/interface"; | |
6 | -import ShopSelectNew, { ShopSelectNewRef } from "@/components/ShopSelectNew"; | |
5 | +import type { KpiGroupSetteing } from "@/pages/performance/KpiGroupSetting/interface"; | |
6 | +import type { ShopSelectNewRef } from "@/components/ShopSelectNew"; | |
7 | +import ShopSelectNew from "@/components/ShopSelectNew"; | |
7 | 8 | import { transformDTO, transformFormData } from "../../entity"; |
8 | -import { ShopList } from "../api"; | |
9 | +import type { ShopList } from "../api"; | |
9 | 10 | import * as api from "../api"; |
10 | 11 | import IndivatorsTable from './IndivatorsTable'; |
11 | 12 | import PersonModal from "../../components/PersonModal"; |
... | ... | @@ -15,7 +16,7 @@ import useInitail from '@/hooks/useInitail'; |
15 | 16 | const Option = Select.Option; |
16 | 17 | interface Props { |
17 | 18 | visible: boolean; |
18 | - onCancel: Function; | |
19 | + onCancel: () => void; | |
19 | 20 | onOk: (vales: any) => void; |
20 | 21 | kpiGroupsItem: KpiGroupSetteing.KpiGroupDetail; |
21 | 22 | } | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/CommissionParams.tsx
... | ... | @@ -55,8 +55,9 @@ const CommissionParams = ({ postId, shopIds, value, onChange, setItemId, isHundr |
55 | 55 | }, [value]); |
56 | 56 | useEffect(() => { |
57 | 57 | if (indicatorsList && indicatorsList.length > 0) { |
58 | - const res = indicatorsList.filter((item) => !selectedIndicators.find((y) => y === item.indicatorCode)); | |
59 | - setNewIndicators([...res]); | |
58 | + // fixme 这里有问题,限制在整个排名组了。实际上只能在单个组里。暂时不做限制,需要调整 | |
59 | + // const res = indicatorsList.filter((item) => !selectedIndicators.find((y) => y === item.indicatorCode)); | |
60 | + setNewIndicators([...indicatorsList]); | |
60 | 61 | } |
61 | 62 | }, [indicatorsList]); |
62 | 63 | // console.log('selectedIndicators', selectedIndicators); | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/IndivatorsTable.tsx
1 | 1 | import React, { useState, useEffect } from 'react'; |
2 | 2 | import { Table, Typography, Button, message, Card, Divider, Space } from 'antd'; |
3 | -import Column from 'antd/lib/table/Column'; | |
4 | 3 | import AddIndicatorsModal from './AddIndicatorsModal'; |
5 | -import { KpiGroupSetteing } from '@/pages/performance/KpiGroupSetting/interface'; | |
4 | +import type { KpiGroupSetteing } from '@/pages/performance/KpiGroupSetting/interface'; | |
6 | 5 | import LadderTable from '@/pages/performance/KpiGroupSetting/EditComfirm/components/LadderTable'; |
7 | 6 | import { useStore } from '../index'; |
8 | 7 | import TargetModal from './TargetModal'; |
9 | 8 | |
10 | 9 | interface Props { |
11 | 10 | value?: any[]; |
12 | - onChange?: Function; | |
11 | + onChange?: () => void; | |
13 | 12 | postId?: number; |
14 | 13 | personModal: KpiGroupSetteing.Person; |
15 | 14 | } | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/KpiGroups.tsx
1 | 1 | import React, { useState, useEffect } from 'react'; |
2 | 2 | import { Table, Typography, Button, Card, Divider, Space } from 'antd'; |
3 | -import { KpiGroupSetteing } from '@/pages/performance/KpiGroupSetting/interface'; | |
3 | +import type { KpiGroupSetteing } from '@/pages/performance/KpiGroupSetting/interface'; | |
4 | 4 | import { useStore } from '../index'; |
5 | 5 | import EmployeesModal from '../../components/EmployeesModal'; |
6 | 6 | import ShopModal from '../../components/ShopModal'; |
... | ... | @@ -8,11 +8,10 @@ import AddKpiGroups from './AddKpiGroups'; |
8 | 8 | |
9 | 9 | interface Props { |
10 | 10 | value?: any[]; |
11 | - onChange?: Function; | |
11 | + onChange?: () => void; | |
12 | 12 | } |
13 | 13 | |
14 | 14 | type Item = KpiGroupSetteing.KpiGroupDetail; |
15 | -type CommissionParams = KpiGroupSetteing.CommissionParams; | |
16 | 15 | const IndivatorsTable = ({ value, onChange }: Props) => { |
17 | 16 | const { readOnly, setSelectedIndicators } = useStore(); |
18 | 17 | const [tableData, setTableData] = useState<Item[]>(value || []); |
... | ... | @@ -57,7 +56,6 @@ const IndivatorsTable = ({ value, onChange }: Props) => { |
57 | 56 | }; |
58 | 57 | //复制 |
59 | 58 | const onCopy = (record: Item, index: number) => { |
60 | - console.log('kpirecord', record); | |
61 | 59 | tableData.push({ ...record, index: tableData.length }); |
62 | 60 | onChange && onChange(tableData); |
63 | 61 | }; |
... | ... | @@ -65,7 +63,6 @@ const IndivatorsTable = ({ value, onChange }: Props) => { |
65 | 63 | const onEdit = (record: Item, index: number) => { |
66 | 64 | setVisible(true); |
67 | 65 | setKpiGroupsItem({ ...record, index }); |
68 | - console.log({ ...record, index }); | |
69 | 66 | }; |
70 | 67 | // 删除 |
71 | 68 | const _onDelete = (record: Item, index: number) => { | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/components/LadderParams.tsx
... | ... | @@ -52,8 +52,9 @@ const LadderParams = ({ postId, shopIds, value, onChange, setItemId, isHundred } |
52 | 52 | }, [value]); |
53 | 53 | useEffect(() => { |
54 | 54 | if (indicatorsList && indicatorsList.length > 0) { |
55 | - const res = indicatorsList.filter((item) => !selectedIndicatorsLadder.find((y) => y === item.indicatorCode)); | |
56 | - setNewIndicators([...res]); | |
55 | + // fixme 这里有问题,限制在整个排名组了。实际上只能在单个组里。暂时不做限制,需要调整 | |
56 | + // const res = indicatorsList.filter((item) => !selectedIndicatorsLadder.find((y) => y === item.indicatorCode)); | |
57 | + setNewIndicators([...indicatorsList]); | |
57 | 58 | } |
58 | 59 | }, [indicatorsList]); |
59 | 60 | const onCancel = () => { | ... | ... |
src/pages/performance/KpiGroupSetting/EditComfirm/index.tsx
1 | 1 | import React, { useEffect, useState, useMemo } from 'react'; |
2 | 2 | import { Card, Popconfirm, Row, Button, message, Result, Form, Radio, Input, Select } from 'antd'; |
3 | 3 | import { FeeweeFileAccept, FeeweeFileChange } from '@/utils/getFidFile'; |
4 | -import type { common } from '@/typing/common'; | |
5 | 4 | import { PlusOutlined } from '@ant-design/icons'; |
6 | 5 | import { IMGURL } from '@/utils'; |
7 | 6 | import { PageHeaderWrapper } from '@ant-design/pro-layout'; |
... | ... | @@ -16,15 +15,14 @@ import moment from 'moment'; |
16 | 15 | import KpiGroups from './components/KpiGroups'; |
17 | 16 | import PreviewRrport from './components/PreviewReport'; |
18 | 17 | import _ from 'lodash'; |
19 | -import useInitial from '@/hooks/useInitail'; | |
20 | -import { fetchRealtimeStaffs } from '../api'; | |
18 | +import type { ConnectProps } from '@/typing/common'; | |
21 | 19 | |
22 | 20 | const Option = Select.Option; |
23 | 21 | |
24 | 22 | // 星级数据: |
25 | 23 | export const { Provider, useStore } = createStore(store); |
26 | 24 | |
27 | -type Props = common.ConnectProps; | |
25 | +type Props = ConnectProps; | |
28 | 26 | function Index(props: Props) { |
29 | 27 | const { detailError, configId, setId, data, readOnly, setReadOnly, setSubmit, loading, kpiGroups, setKpiGroups } = useStore(); |
30 | 28 | const [form] = Form.useForm(); | ... | ... |