Commit a7563d0c8ac92b01287d6a8c77e15ce107dd1f92
1 parent
23989b1c
bug-fix
Showing
2 changed files
with
11 additions
and
10 deletions
src/pages/performance/QualitySetting/components/AddIndicatorsModal.tsx
... | ... | @@ -159,7 +159,7 @@ export default function AddIndicatorsModal(props: Props) { |
159 | 159 | <div style={{ marginBottom: 15 }}> |
160 | 160 | <a onClick={() => personView()}>{`考核人员清单 >`}</a> |
161 | 161 | </div> |
162 | - {type == 2 ? <div style={{ marginBottom: 15 }}>考核方式:绩效排名差</div> : null} | |
162 | + {type == 2 ? <div style={{ marginBottom: 15 }}>考核方式:按绩效排名差</div> : null} | |
163 | 163 | <div style={{ marginBottom: 15, fontSize: 18, fontWeight: "bold" }}>• 处罚:</div> |
164 | 164 | <Form.Item |
165 | 165 | name="penaltyScore" | ... | ... |
src/pages/performance/QualitySetting/components/EditModal.tsx
... | ... | @@ -49,7 +49,7 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) { |
49 | 49 | onClose?.(false); |
50 | 50 | setPersonModal({ ...personModal, postId: 0, shopIds: "", shopNames: "" }); |
51 | 51 | }; |
52 | - | |
52 | + // 在这里发起获取详情数据的请求,拿到数据再写一个生命周期监听获取的数据 | |
53 | 53 | useEffect(() => { |
54 | 54 | if (visible && currentItem.id) { |
55 | 55 | setDetailsParams({ id: currentItem.id }, true); |
... | ... | @@ -64,8 +64,9 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) { |
64 | 64 | setType(currentItem.type); |
65 | 65 | } |
66 | 66 | }, [visible]); |
67 | + // 监听到数据变化后将数据处理同时赋给表单,loading直接用详情的loading,有id就用详情的loading,实现了数据获取之前loading的加载,没有id直接写死fasle | |
67 | 68 | useEffect(() => { |
68 | - if (detailsData.details) { | |
69 | + if (detailsData) { | |
69 | 70 | const result = transformFormData(detailsData, roleList, list); |
70 | 71 | if (result.type == 1) { |
71 | 72 | result.rank = ""; |
... | ... | @@ -108,13 +109,13 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) { |
108 | 109 | pa.details.forEach((item: any) => { |
109 | 110 | if ( |
110 | 111 | item.capPersonPenaltyScore == undefined || |
111 | - !item.capPersonPenaltyMoney == undefined || | |
112 | - !item.awardScore == undefined || | |
113 | - !item.capPersonAwardScore == undefined || | |
114 | - !item.capAwardScore == undefined || | |
115 | - !item.awardMoney == undefined || | |
116 | - !item.capPersonAwardMoney == undefined || | |
117 | - !item.capAwardMoney == undefined | |
112 | + item.capPersonPenaltyMoney == undefined || | |
113 | + item.awardScore == undefined || | |
114 | + item.capPersonAwardScore == undefined || | |
115 | + item.capAwardScore == undefined || | |
116 | + item.awardMoney == undefined || | |
117 | + item.capPersonAwardMoney == undefined || | |
118 | + item.capAwardMoney == undefined | |
118 | 119 | ) { |
119 | 120 | message.error("考核详情中存在没有填的内容"); |
120 | 121 | } else { | ... | ... |