Commit c13ead23e36de420d38d4931fba229ff075704dd
Merge branch 'master' into contract
Showing
11 changed files
with
53 additions
and
22 deletions
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddEvaGroupModal.tsx
... | ... | @@ -268,7 +268,7 @@ export default function AddIndicatorsModal(props: Props) { |
268 | 268 | <Form.Item |
269 | 269 | name="staffRewardDims" |
270 | 270 | label="人员考评奖惩" |
271 | - rules={[{ required: !(shopRewardDims) }]} | |
271 | + rules={[{ required: !shopRewardDims || (shopRewardDims && shopRewardDims?.length == 0) }]} | |
272 | 272 | > |
273 | 273 | <StaffRewardDims postId={postId} personModal={personModal} scopeType={scopeType} shopIds={shopIds} /> |
274 | 274 | </Form.Item> |
... | ... | @@ -285,7 +285,7 @@ export default function AddIndicatorsModal(props: Props) { |
285 | 285 | <Form.Item |
286 | 286 | name="shopRewardDims" |
287 | 287 | label="门店考评奖惩" |
288 | - rules={[{ required: !(staffRewardDims) }]} | |
288 | + rules={[{ required: !staffRewardDims || (staffRewardDims && staffRewardDims?.length == 0) }]} | |
289 | 289 | > |
290 | 290 | <ShopRewardDims personModal={personModal} scopeType={scopeType} shopIds={shopIds} /> |
291 | 291 | </Form.Item> | ... | ... |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddStaffRewardsModal.tsx
... | ... | @@ -43,6 +43,12 @@ export default function CreateModal(props: Props) { |
43 | 43 | useEffect(() => { |
44 | 44 | if (visible && currentItem.index !== undefined) { |
45 | 45 | setPostListId(currentItem.postIds); |
46 | + setPersonModal({ | |
47 | + ...personModal, | |
48 | + postIds: currentItem.postIds.join(","), | |
49 | + shopIds, | |
50 | + visible: false, | |
51 | + }); | |
46 | 52 | const res = transformFormDataReward(currentItem); |
47 | 53 | form.setFieldsValue({ |
48 | 54 | ...res, |
... | ... | @@ -120,6 +126,16 @@ export default function CreateModal(props: Props) { |
120 | 126 | <div style={{ marginBottom: 20 }}> |
121 | 127 | <a onClick={() => personView()}>{`人员查看 >`}</a> |
122 | 128 | </div> |
129 | + {/* <Form.Item | |
130 | + noStyle | |
131 | + shouldUpdate={(prevValues, currentValues) => prevValues.post !== currentValues.post} | |
132 | + > | |
133 | + {({ getFieldValue }) => { | |
134 | + const post = getFieldValue("post"); | |
135 | + console.log('post', post); | |
136 | + return null; | |
137 | + }} | |
138 | + </Form.Item> */} | |
123 | 139 | <Form.Item name="rewards" label="考评奖惩"> |
124 | 140 | <RewardsTableSal scopeType={scopeType} shopIds={shopIds} rewardLength={rewardLength} /> |
125 | 141 | </Form.Item> | ... | ... |
src/pages/performance/EvaGroupSetting/EditComfirm/components/IndivatorsTable.tsx
... | ... | @@ -42,10 +42,6 @@ const IndivatorsTable = ({ value, onChange, personModal, scopeType }: Props) => |
42 | 42 | const [ladderList, setladderList] = useState<EvaGroupSetteing.Ladders[]>([]); |
43 | 43 | // 添加指标 |
44 | 44 | const addIndicators = () => { |
45 | - if (!shopIds) { | |
46 | - message.error("请先选择门店"); | |
47 | - return; | |
48 | - } | |
49 | 45 | setVisible(true); |
50 | 46 | // setSelectedIndicators([]); |
51 | 47 | setSelectedIndicatorsConds([]); | ... | ... |
src/pages/performance/EvaGroupSetting/EditComfirm/components/PersonModal.tsx
src/pages/performance/EvaGroupSetting/EditComfirm/components/PreviewReport.tsx
... | ... | @@ -39,6 +39,7 @@ const TargetModal = ({ reportVisible, stages, setReportVisible }: Props) => { |
39 | 39 | const [comList, setComList] = useState<any[]>([]); |
40 | 40 | const [allIndicator, setAllIndicator] = useState<any[]>([]); |
41 | 41 | const [delay, setDelay] = useState(true); |
42 | + const [maybePostIds, setMaybePostIds] = useState<any[]>([]); | |
42 | 43 | const { data, setParams, loading } = useInitial(fetchRealtimeStaffs, [], { postIds: "", shopIds: "" }, delay); |
43 | 44 | useEffect(() => { |
44 | 45 | if (reportVisible && stages && stages.length > 0) { |
... | ... | @@ -46,12 +47,23 @@ const TargetModal = ({ reportVisible, stages, setReportVisible }: Props) => { |
46 | 47 | return item.evalGroups.map((i: any) => i.shopIds); |
47 | 48 | }); |
48 | 49 | const newShopIdsArr = [...new Set(shopIdsArr.flat(2))]; |
50 | + console.log("shopIdsArr", newShopIdsArr); | |
49 | 51 | const postIdsArr = stages.map((i1: any) => { |
50 | - return i1.evalGroups.map((i2: any) => i2.rewards.map((i3: any) => i3.postIds)); | |
52 | + return i1.evalGroups.map((i2: any) => { | |
53 | + if (i2?.staffRewardDims && i2?.staffRewardDims?.length > 0) { | |
54 | + return i2?.staffRewardDims.map((i3: any) => i3.postIds); | |
55 | + } else { | |
56 | + return []; | |
57 | + } | |
58 | + }); | |
51 | 59 | }); |
52 | 60 | const newPostIdsArr = [...new Set(postIdsArr.flat(3))]; |
53 | - setParams({ postIds: newPostIdsArr.join(","), shopIds: newShopIdsArr.join(",") }, true); | |
54 | - setDelay(false); | |
61 | + console.log(newPostIdsArr); | |
62 | + setMaybePostIds(newPostIdsArr); | |
63 | + if (newPostIdsArr.length > 0) { | |
64 | + setParams({ postIds: newPostIdsArr.join(","), shopIds: newShopIdsArr.join(",") }, true); | |
65 | + setDelay(false); | |
66 | + } | |
55 | 67 | // const arr = kpiGroups.map((item) => { |
56 | 68 | // return item.indicators; |
57 | 69 | // }); |
... | ... | @@ -147,8 +159,8 @@ const TargetModal = ({ reportVisible, stages, setReportVisible }: Props) => { |
147 | 159 | <Table |
148 | 160 | bordered |
149 | 161 | dataSource={data} |
150 | - columns={realList} | |
151 | - loading={loading} | |
162 | + columns={columns} | |
163 | + loading={maybePostIds.length > 0 ? loading : false} | |
152 | 164 | scroll={{ x: true, y: 500 }} |
153 | 165 | pagination={false} |
154 | 166 | /> | ... | ... |
src/pages/performance/EvaGroupSetting/EditComfirm/components/RankModal.tsx
src/pages/performance/EvaGroupSetting/EditComfirm/components/RewardsTableSal.tsx
... | ... | @@ -27,6 +27,9 @@ const IndivatorsTable = ({ value, onChange, scopeType, shopIds, rewardLength }: |
27 | 27 | setCommissionParamAlias, |
28 | 28 | setLadderParamAlias, |
29 | 29 | setPreconditionAliasSal, |
30 | + setCommissionParamAliasShop, | |
31 | + setLadderParamAliasShop, | |
32 | + setPreconditionAliasSalShop, | |
30 | 33 | } = useStore(); |
31 | 34 | const [tableData, setTableData] = useState<Item[]>(value || []); |
32 | 35 | const [visible, setVisible] = useState(false); |
... | ... | @@ -56,6 +59,9 @@ const IndivatorsTable = ({ value, onChange, scopeType, shopIds, rewardLength }: |
56 | 59 | setCommissionParamAlias(""); |
57 | 60 | setLadderParamAlias(""); |
58 | 61 | setPreconditionAliasSal(""); |
62 | + // setCommissionParamAliasShop(""); | |
63 | + // setLadderParamAliasShop(""); | |
64 | + // setPreconditionAliasSalShop(""); | |
59 | 65 | }; |
60 | 66 | const onCancel = () => { |
61 | 67 | setVisible(false); |
... | ... | @@ -188,7 +194,7 @@ const IndivatorsTable = ({ value, onChange, scopeType, shopIds, rewardLength }: |
188 | 194 | extra={ |
189 | 195 | <div style={{ display: "flex", justifyContent: "flex-end" }}> |
190 | 196 | <Button type="link" onClick={() => addIndicators()} disabled={readOnly || rewardLength > 1}> |
191 | - + 添加指标名称 | |
197 | + + 添加考评奖惩 | |
192 | 198 | </Button> |
193 | 199 | </div> |
194 | 200 | } | ... | ... |
src/pages/performance/EvaGroupSetting/EditComfirm/components/RewardsTableSalShop.tsx
1 | 1 | import React, { useState, useEffect } from "react"; |
2 | 2 | import { Table, Typography, Button, message, Card, Divider, Space } from "antd"; |
3 | -import AddRewardsModal from "./AddRewardsModal"; | |
3 | +import AddRewardsModalShop from "./AddRewardsModalShop"; | |
4 | 4 | import { useStore } from "../index"; |
5 | 5 | import { OptionalMethod_Enum } from "../../entity"; |
6 | 6 | import TargetModal from "./TargetModal"; |
... | ... | @@ -186,14 +186,14 @@ const IndivatorsTable = ({ value, onChange, scopeType, shopIds, rewardLength }: |
186 | 186 | extra={ |
187 | 187 | <div style={{ display: "flex", justifyContent: "flex-end" }}> |
188 | 188 | <Button type="link" onClick={() => addIndicators()} disabled={readOnly || rewardLength > 1}> |
189 | - + 添加指标名称 | |
189 | + + 添加考评奖惩 | |
190 | 190 | </Button> |
191 | 191 | </div> |
192 | 192 | } |
193 | 193 | > |
194 | 194 | <Table bordered dataSource={value || []} rowKey={(record: Item) => String(record.id)} columns={getColumns()} /> |
195 | 195 | </Card> |
196 | - <AddRewardsModal | |
196 | + <AddRewardsModalShop | |
197 | 197 | visible={visible} |
198 | 198 | currentItem={currentItem} |
199 | 199 | onCancel={onCancel} | ... | ... |
src/pages/performance/EvaSetting/components/EditModal.tsx
... | ... | @@ -102,7 +102,7 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) { |
102 | 102 | return ( |
103 | 103 | <Modal |
104 | 104 | width={960} |
105 | - title={`${currentItem.code ? "编辑" : "新增"}考评指标`} | |
105 | + title={`${currentItem.code ? "编辑" : "新增"}自定义指标`} | |
106 | 106 | open={visible} |
107 | 107 | onOk={form.submit} |
108 | 108 | onCancel={() => onClose?.(false)} | ... | ... |
src/pages/performance/EvaSetting/components/Filter.tsx
... | ... | @@ -24,12 +24,12 @@ export default function Filter({ setParams, roleList }: Props) { |
24 | 24 | { value: 1, label: "启用" }, |
25 | 25 | ]; |
26 | 26 | const comAble = [ |
27 | - { value: 0, label: "是" }, | |
28 | - { value: 1, label: "否" }, | |
27 | + { value: 1, label: "是" }, | |
28 | + { value: 0, label: "否" }, | |
29 | 29 | ]; |
30 | 30 | const targetType = [ |
31 | - { value: 0, label: "无" }, | |
32 | - { value: 1, label: "是" }, | |
31 | + { value: true, label: "是" }, | |
32 | + { value: false, label: "无" }, | |
33 | 33 | ]; |
34 | 34 | |
35 | 35 | return ( | ... | ... |
src/pages/performance/KpiSetting/components/EditModal.tsx
... | ... | @@ -55,7 +55,7 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) { |
55 | 55 | |
56 | 56 | return ( |
57 | 57 | <Modal |
58 | - title={`${currentItem.id ? "编辑" : "新增"}绩效指标`} | |
58 | + title={`${currentItem.id ? "编辑" : "新增"}系统指标`} | |
59 | 59 | visible={visible} |
60 | 60 | onOk={form.submit} |
61 | 61 | onCancel={() => onClose?.(false)} | ... | ... |