Commit 23989b1c6a058eb6c0fdbeaceefc86181626c094

Authored by 曾柯
1 parent 4b165279

表单样式调整

Showing 23 changed files with 389 additions and 160 deletions
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddCommissionParamsModal.tsx
... ... @@ -146,7 +146,13 @@ export default function AddCommissionParamsModal(props: Props) {
146 146 width={1000}
147 147 >
148 148 <Spin spinning={loading}>
149   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  149 + <Form
  150 + form={form}
  151 + // labelCol={{ span: 6 }}
  152 + // wrapperCol={{ span: 18 }}
  153 + onFinish={handSubmit}
  154 + style={{ width: "70%", marginLeft: 150 }}
  155 + >
150 156 <Form.Item name="commissionParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
151 157 <Select
152 158 placeholder="选择指标"
... ... @@ -189,7 +195,7 @@ export default function AddCommissionParamsModal(props: Props) {
189 195 {(targetType === TargetTypeEnum["百分比"] ||
190 196 targetType === TargetTypeEnum["金额"] ||
191 197 targetType === TargetTypeEnum["数量"]) && (
192   - <div style={{ marginLeft: 65 }}>
  198 + <div>
193 199 <Button type="link" onClick={() => setIsTarget(true)}>
194 200 考核目标值设置(可选项)
195 201 </Button>
... ...
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddCondModal.tsx
... ... @@ -137,9 +137,10 @@ export default function AddCondModal(props: Props) {
137 137 <Spin spinning={loading}>
138 138 <Form
139 139 form={form}
140   - labelCol={{ span: 6 }}
141   - wrapperCol={{ span: 18 }}
  140 + // labelCol={{ span: 6 }}
  141 + // wrapperCol={{ span: 18 }}
142 142 onFinish={handSubmit}
  143 + style={{ width: "80%", marginLeft: 100 }}
143 144 initialValues={{
144 145 condLadders: [{ lower: 0, scorePercent: 0, key: 0 }],
145 146 }}
... ... @@ -179,7 +180,7 @@ export default function AddCondModal(props: Props) {
179 180 {(targetType === TargetTypeEnum["百分比"] ||
180 181 targetType === TargetTypeEnum["金额"] ||
181 182 targetType === TargetTypeEnum["数量"]) && (
182   - <div style={{ marginLeft: 65 }}>
  183 + <div>
183 184 <Button type="link" onClick={() => setIsTarget(true)}>
184 185 考核目标值设置(可选项)
185 186 </Button>
... ...
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddIndicatorsModal.tsx
... ... @@ -309,7 +309,13 @@ export default function CreateModal(props: Props) {
309 309 onOk={form.submit}
310 310 width={1200}
311 311 >
312   - <Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} onFinish={handSubmit}>
  312 + <Form
  313 + form={form}
  314 + // labelCol={{ span: 4 }}
  315 + // wrapperCol={{ span: 20 }}
  316 + onFinish={handSubmit}
  317 + style={{ width: "90%", marginLeft: 60 }}
  318 + >
313 319 <Form.Item name="name" label="薪酬项目名称" rules={[{ required: true, message: "请输入指标名称" }]}>
314 320 <Input placeholder="请输入指标名称" />
315 321 </Form.Item>
... ... @@ -347,7 +353,7 @@ export default function CreateModal(props: Props) {
347 353 }}
348 354 </Form.Item>
349 355  
350   - <div style={{ marginLeft: 95, marginBottom: 20 }}>
  356 + <div style={{ marginBottom: 20 }}>
351 357 <span>是否添加前置条件设置:</span>
352 358 <Radio.Group
353 359 onChange={(e) => {
... ...
src/pages/performance/CompensateGroupConfig/EditComfirm/components/AddLadderParamsModal.tsx
... ... @@ -139,7 +139,13 @@ export default function AddLadderParamsModal(props: Props) {
139 139 width={1000}
140 140 >
141 141 <Spin spinning={loading}>
142   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  142 + <Form
  143 + form={form}
  144 + // labelCol={{ span: 6 }}
  145 + // wrapperCol={{ span: 18 }}
  146 + onFinish={handSubmit}
  147 + style={{ width: "70%", marginLeft: 150 }}
  148 + >
143 149 <Form.Item name="ladderParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
144 150 <Select
145 151 placeholder="选择指标"
... ... @@ -185,7 +191,7 @@ export default function AddLadderParamsModal(props: Props) {
185 191 {(targetType === TargetTypeEnum["百分比"] ||
186 192 targetType === TargetTypeEnum["金额"] ||
187 193 targetType === TargetTypeEnum["数量"]) && (
188   - <div style={{ marginLeft: 65 }}>
  194 + <div>
189 195 <Button type="link" onClick={() => setIsTarget(true)}>
190 196 考核目标值设置(可选项)
191 197 </Button>
... ...
src/pages/performance/CompensateGroupConfig/EditComfirm/index.tsx
... ... @@ -23,7 +23,7 @@ const { Option } = Select;
23 23  
24 24 interface Props extends common.ConnectProps {}
25 25 function Index(props: Props) {
26   - const { postList, detailError, setSubmit, configId, setId, data, readOnly, setReadOnly, setSelectedSalaryIds } =
  26 + const { postList, detailError, setSubmit, configId, setId, data, readOnly, setReadOnly, setSelectedSalaryIds, loading } =
27 27 useStore();
28 28 const [form] = Form.useForm();
29 29 const { match } = props;
... ... @@ -145,7 +145,7 @@ function Index(props: Props) {
145 145 };
146 146  
147 147 return (
148   - <PageHeaderWrapper title="薪酬组配置">
  148 + <PageHeaderWrapper title="薪酬组配置" loading={id ? loading : false}>
149 149 <Card>
150 150 {detailError ? (
151 151 <Result status="warning" title={detailError} />
... ...
src/pages/performance/CompensateGroupConfig/EditComfirm/store.ts
... ... @@ -13,6 +13,7 @@ export default function useStore() {
13 13 data,
14 14 errMsg: detailError,
15 15 setParams,
  16 + loading
16 17 } = useInitail(submit == 1 ? api.queryDetailListApi : api.draftQueryDetailListApi, {}, {}, delay);
17 18 const [readOnly, setReadOnly] = useState(false);
18 19  
... ... @@ -59,5 +60,6 @@ export default function useStore() {
59 60 preconditionAlias,
60 61 setPreconditionAlias,
61 62 setSubmit,
  63 + loading
62 64 };
63 65 }
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCommissionParamsModal.tsx
... ... @@ -149,7 +149,13 @@ export default function AddCommissionParamsModal(props: Props) {
149 149 width={1000}
150 150 >
151 151 <Spin spinning={loading}>
152   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  152 + <Form
  153 + form={form}
  154 + // labelCol={{ span: 6 }}
  155 + // wrapperCol={{ span: 18 }}
  156 + onFinish={handSubmit}
  157 + style={{ width: "70%", marginLeft: 150 }}
  158 + >
153 159 <Form.Item name="commissionParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
154 160 <Select
155 161 placeholder="选择指标(*为考评指标,无*为绩效指标)"
... ... @@ -176,7 +182,8 @@ export default function AddCommissionParamsModal(props: Props) {
176 182 codeType={item.codeType}
177 183 name={item.name}
178 184 >
179   - {item.name}{item.codeType == 2 ? '*' : ''}
  185 + {item.name}
  186 + {item.codeType == 2 ? "*" : ""}
180 187 </Option>
181 188 ))}
182 189 </Select>
... ... @@ -203,7 +210,7 @@ export default function AddCommissionParamsModal(props: Props) {
203 210 {(targetType === TargetTypeEnum["百分比"] ||
204 211 targetType === TargetTypeEnum["金额"] ||
205 212 targetType === TargetTypeEnum["数量"]) && (
206   - <div style={{ marginLeft: 65 }}>
  213 + <div>
207 214 <Button type="link" onClick={() => setIsTarget(true)}>
208 215 考核目标值设置(可选项)
209 216 </Button>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCommissionParamsModalSal.tsx
... ... @@ -147,7 +147,13 @@ export default function AddCommissionParamsModal(props: Props) {
147 147 width={1000}
148 148 >
149 149 <Spin spinning={loading}>
150   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  150 + <Form
  151 + form={form}
  152 + // labelCol={{ span: 6 }}
  153 + // wrapperCol={{ span: 18 }}
  154 + onFinish={handSubmit}
  155 + style={{ width: "70%", marginLeft: 150 }}
  156 + >
151 157 <Form.Item name="commissionParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
152 158 <Select
153 159 placeholder="选择指标(*为考评指标,无*为绩效指标)"
... ... @@ -202,7 +208,7 @@ export default function AddCommissionParamsModal(props: Props) {
202 208 {(targetType === TargetTypeEnum["百分比"] ||
203 209 targetType === TargetTypeEnum["金额"] ||
204 210 targetType === TargetTypeEnum["数量"]) && (
205   - <div style={{ marginLeft: 65 }}>
  211 + <div>
206 212 <Button type="link" onClick={() => setIsTarget(true)}>
207 213 考核目标值设置(可选项)
208 214 </Button>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCondModal.tsx
... ... @@ -146,9 +146,10 @@ export default function AddCondModal(props: Props) {
146 146 <Spin spinning={loading}>
147 147 <Form
148 148 form={form}
149   - labelCol={{ span: 6 }}
150   - wrapperCol={{ span: 18 }}
  149 + // labelCol={{ span: 6 }}
  150 + // wrapperCol={{ span: 18 }}
151 151 onFinish={handSubmit}
  152 + style={{ width: "80%", marginLeft: 100 }}
152 153 initialValues={{
153 154 ladders: [{ lower: 0, scorePercent: 0, key: 0 }],
154 155 }}
... ... @@ -190,7 +191,7 @@ export default function AddCondModal(props: Props) {
190 191 {(targetType === TargetTypeEnum["百分比"] ||
191 192 targetType === TargetTypeEnum["金额"] ||
192 193 targetType === TargetTypeEnum["数量"]) && (
193   - <div style={{ marginLeft: 65 }}>
  194 + <div>
194 195 <Button type="link" onClick={() => setIsTarget(true)}>
195 196 考核目标值设置(可选项)
196 197 </Button>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCondModalSal.tsx
... ... @@ -144,9 +144,10 @@ export default function AddCondModal(props: Props) {
144 144 <Spin spinning={loading}>
145 145 <Form
146 146 form={form}
147   - labelCol={{ span: 6 }}
148   - wrapperCol={{ span: 18 }}
  147 + // labelCol={{ span: 6 }}
  148 + // wrapperCol={{ span: 18 }}
149 149 onFinish={handSubmit}
  150 + style={{ width: "80%", marginLeft: 100 }}
150 151 initialValues={{
151 152 ladders: [{ lower: 0, scorePercent: 0, key: 0 }],
152 153 }}
... ... @@ -235,7 +236,7 @@ export default function AddCondModal(props: Props) {
235 236 {(targetType === TargetTypeEnum["百分比"] ||
236 237 targetType === TargetTypeEnum["金额"] ||
237 238 targetType === TargetTypeEnum["数量"]) && (
238   - <div style={{ marginLeft: 65 }}>
  239 + <div>
239 240 <Button type="link" onClick={() => setIsTarget(true)}>
240 241 考核目标值设置(可选项)
241 242 </Button>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddEvaGroupModal.tsx
... ... @@ -137,13 +137,19 @@ export default function AddIndicatorsModal(props: Props) {
137 137 onOk={form.submit}
138 138 width={1400}
139 139 >
140   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 16 }} onFinish={handSubmit}>
  140 + <Form
  141 + form={form}
  142 + // labelCol={{ span: 6 }}
  143 + // wrapperCol={{ span: 16 }}
  144 + onFinish={handSubmit}
  145 + style={{ width: "80%", marginLeft: 140 }}
  146 + >
141 147 <Form.Item name="name" label="考评组名称" rules={[{ required: true, message: "请输入名称" }]}>
142 148 <Input placeholder="请输入考评组名称" disabled={readOnly} />
143 149 </Form.Item>
144 150 <Form.Item label="考评时间" name="time" rules={[{ required: true, message: "请选择考评时间" }]}>
145 151 <RangePicker
146   - style={{ width: 900 }}
  152 + style={{ width: 1000 }}
147 153 disabled={readOnly}
148 154 disabledDate={(current) => current && current < moment().add(-1, "days").endOf("day")}
149 155 />
... ... @@ -225,7 +231,7 @@ export default function AddIndicatorsModal(props: Props) {
225 231 >
226 232 {({ getFieldValue }) =>
227 233 getFieldValue("scopeType") === 1 ? (
228   - <div style={{ marginBottom: 20, marginLeft: 250 }}>
  234 + <div style={{ marginBottom: 20 }}>
229 235 <a onClick={() => personView()}>{`人员查看 >`}</a>
230 236 </div>
231 237 ) : null
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddIndicatorsModal.tsx
... ... @@ -184,9 +184,10 @@ export default function AddIndicatorsModal(props: Props) {
184 184 >
185 185 <Form
186 186 form={form}
187   - labelCol={{ span: 6 }}
188   - wrapperCol={{ span: 18 }}
  187 + // labelCol={{ span: 6 }}
  188 + // wrapperCol={{ span: 18 }}
189 189 onFinish={handSubmit}
  190 + style={{ width: "80%", marginLeft: 120 }}
190 191 initialValues={{
191 192 ladders: [{ lower: 0, standardScore: 0, key: 0 }],
192 193 }}
... ... @@ -208,7 +209,7 @@ export default function AddIndicatorsModal(props: Props) {
208 209 </Option>
209 210 </Select>
210 211 </Form.Item>
211   - <div style={{ marginLeft: 218, marginBottom: 20 }}>
  212 + <div style={{ marginBottom: 20 }}>
212 213 <span>是否添加前置条件设置:</span>
213 214 <Radio.Group
214 215 onChange={(e) => {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddLadderParamsModal.tsx
... ... @@ -145,7 +145,13 @@ export default function AddLadderParamsModal(props: Props) {
145 145 width={1000}
146 146 >
147 147 <Spin spinning={loading}>
148   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  148 + <Form
  149 + form={form}
  150 + // labelCol={{ span: 6 }}
  151 + // wrapperCol={{ span: 18 }}
  152 + onFinish={handSubmit}
  153 + style={{ width: "70%", marginLeft: 150 }}
  154 + >
149 155 <Form.Item name="ladderParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
150 156 <Select
151 157 placeholder="选择指标(*为考评指标,无*为绩效指标)"
... ... @@ -200,7 +206,7 @@ export default function AddLadderParamsModal(props: Props) {
200 206 {(targetType === TargetTypeEnum["百分比"] ||
201 207 targetType === TargetTypeEnum["金额"] ||
202 208 targetType === TargetTypeEnum["数量"]) && (
203   - <div style={{ marginLeft: 65 }}>
  209 + <div>
204 210 <Button type="link" onClick={() => setIsTarget(true)}>
205 211 考核目标值设置(可选项)
206 212 </Button>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddLadderParamsModalSal.tsx
... ... @@ -145,7 +145,13 @@ export default function AddLadderParamsModal(props: Props) {
145 145 width={1000}
146 146 >
147 147 <Spin spinning={loading}>
148   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  148 + <Form
  149 + form={form}
  150 + // labelCol={{ span: 6 }}
  151 + // wrapperCol={{ span: 18 }}
  152 + onFinish={handSubmit}
  153 + style={{ width: "70%", marginLeft: 150 }}
  154 + >
149 155 <Form.Item name="ladderParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
150 156 <Select
151 157 placeholder="选择指标(*为考评指标,无*为绩效指标)"
... ... @@ -200,7 +206,7 @@ export default function AddLadderParamsModal(props: Props) {
200 206 {(targetType === TargetTypeEnum["百分比"] ||
201 207 targetType === TargetTypeEnum["金额"] ||
202 208 targetType === TargetTypeEnum["数量"]) && (
203   - <div style={{ marginLeft: 65 }}>
  209 + <div>
204 210 <Button type="link" onClick={() => setIsTarget(true)}>
205 211 考核目标值设置(可选项)
206 212 </Button>
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddRewardsModal.tsx
... ... @@ -196,8 +196,9 @@ export default function CreateModal(props: Props) {
196 196 >
197 197 <Form
198 198 form={form}
199   - labelCol={{ span: 4 }}
200   - wrapperCol={{ span: 20 }}
  199 + // labelCol={{ span: 4 }}
  200 + // wrapperCol={{ span: 20 }}
  201 + style={{ width: "90%", marginLeft: 60 }}
201 202 onFinish={handSubmit}
202 203 initialValues={{
203 204 ladders: [{ lower: 0, money: 0, key: 0 }],
... ... @@ -349,22 +350,22 @@ export default function CreateModal(props: Props) {
349 350 } else if (!rankType && (!currentItem.ladders || currentItem.ladders.length == 0)) {
350 351 form.setFieldValue("ladders", [{ lower: 0, money: 0, key: 0, rankOrderType: 1 }]);
351 352 }
352   - return (
353   - <Form.Item
354   - name="ladders"
355   - label="排名设置"
356   - rules={[{ required: true, message: "请配置排名" }]}
357   - style={{ width: "100%" }}
358   - >
359   - <RankModal
360   - visible
361   - isPercent={isPercent}
362   - laddersType={currentItem?.laddersType}
363   - calType={calType}
364   - rankType={rankType}
365   - />
366   - </Form.Item>
367   - );
  353 + return (
  354 + <Form.Item
  355 + name="ladders"
  356 + label="排名设置"
  357 + rules={[{ required: true, message: "请配置排名" }]}
  358 + style={{ width: "100%" }}
  359 + >
  360 + <RankModal
  361 + visible
  362 + isPercent={isPercent}
  363 + laddersType={currentItem?.laddersType}
  364 + calType={calType}
  365 + rankType={rankType}
  366 + />
  367 + </Form.Item>
  368 + );
368 369 }}
369 370 </Form.Item>
370 371 </>
... ... @@ -442,23 +443,23 @@ export default function CreateModal(props: Props) {
442 443 } else if (caculateType == 5 && (!currentItem.ladders || currentItem.ladders.length == 0)) {
443 444 form.setFieldValue("ladders", [{ lower: 0, money: 0, capMoney: 0, key: 0 }]);
444 445 }
445   - return (
446   - <>
447   - <Form.Item
448   - name="ladders"
449   - label="阶梯条件"
450   - rules={[{ required: true, message: "请配置阶梯" }]}
451   - style={{ width: "100%" }}
452   - >
453   - <TotalAmountSal
454   - visible
455   - isPercent={isPercent}
456   - laddersType={currentItem.laddersType}
457   - calType={calType}
458   - />
459   - </Form.Item>
460   - </>
461   - );
  446 + return (
  447 + <>
  448 + <Form.Item
  449 + name="ladders"
  450 + label="阶梯条件"
  451 + rules={[{ required: true, message: "请配置阶梯" }]}
  452 + style={{ width: "100%" }}
  453 + >
  454 + <TotalAmountSal
  455 + visible
  456 + isPercent={isPercent}
  457 + laddersType={currentItem.laddersType}
  458 + calType={calType}
  459 + />
  460 + </Form.Item>
  461 + </>
  462 + );
462 463 }
463 464 return null;
464 465 }}
... ...
src/pages/performance/EvaSetting/components/EditModal.tsx
... ... @@ -66,8 +66,9 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) {
66 66 <Form
67 67 form={form}
68 68 onFinish={handleSave}
69   - labelCol={{ span: 6 }}
70   - wrapperCol={{ span: 15 }}
  69 + // labelCol={{ span: 6 }}
  70 + // wrapperCol={{ span: 15 }}
  71 + style={{ width: "80%", marginLeft: 100 }}
71 72 initialValues={{ ruleValues: [] }}
72 73 >
73 74 <FormItem name="name" label="指标名称" rules={[{ required: true, message: "请输入指标名称" }]}>
... ...
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddCommissionParamsModal.tsx
... ... @@ -142,7 +142,13 @@ export default function AddCommissionParamsModal(props: Props) {
142 142 width={1000}
143 143 >
144 144 <Spin spinning={loading}>
145   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  145 + <Form
  146 + form={form}
  147 + // labelCol={{ span: 6 }}
  148 + // wrapperCol={{ span: 18 }}
  149 + onFinish={handSubmit}
  150 + style={{ width: "70%", marginLeft: 150 }}
  151 + >
146 152 <Form.Item name="commissionParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
147 153 <Select
148 154 placeholder="选择指标"
... ... @@ -187,7 +193,7 @@ export default function AddCommissionParamsModal(props: Props) {
187 193 {(targetType === TargetTypeEnum["百分比"] ||
188 194 targetType === TargetTypeEnum["金额"] ||
189 195 targetType === TargetTypeEnum["数量"]) && (
190   - <div style={{ marginLeft: 65 }}>
  196 + <div>
191 197 <Button type="link" onClick={() => setIsTarget(true)}>
192 198 考核目标值设置(可选项)
193 199 </Button>
... ...
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddCondModal.tsx
... ... @@ -137,9 +137,10 @@ export default function AddCondModal(props: Props) {
137 137 <Spin spinning={loading}>
138 138 <Form
139 139 form={form}
140   - labelCol={{ span: 6 }}
141   - wrapperCol={{ span: 18 }}
  140 + // labelCol={{ span: 6 }}
  141 + // wrapperCol={{ span: 18 }}
142 142 onFinish={handSubmit}
  143 + style={{ width: "80%", marginLeft: 100 }}
143 144 initialValues={{
144 145 condLadders: [{ lower: 0, scorePercent: 0, key: 0 }],
145 146 }}
... ... @@ -170,7 +171,7 @@ export default function AddCondModal(props: Props) {
170 171 {(targetType === TargetTypeEnum["百分比"] ||
171 172 targetType === TargetTypeEnum["金额"] ||
172 173 targetType === TargetTypeEnum["数量"]) && (
173   - <div style={{ marginLeft: 65 }}>
  174 + <div>
174 175 <Button type="link" onClick={() => setIsTarget(true)}>
175 176 考核目标值设置(可选项)
176 177 </Button>
... ...
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddIndicatorsModal.tsx
... ... @@ -190,8 +190,9 @@ export default function AddIndicatorsModal(props: Props) {
190 190 <Spin spinning={loading}>
191 191 <Form
192 192 form={form}
193   - labelCol={{ span: 6 }}
194   - wrapperCol={{ span: 18 }}
  193 + // labelCol={{ span: 6 }}
  194 + // wrapperCol={{ span: 15 }}
  195 + style={{ width: "80%", marginLeft: 150 }}
195 196 onFinish={handSubmit}
196 197 initialValues={{
197 198 indicatorLadders: [{ lower: 0, standardScore: 0, key: 0 }],
... ... @@ -214,7 +215,7 @@ export default function AddIndicatorsModal(props: Props) {
214 215 </Option>
215 216 </Select>
216 217 </Form.Item>
217   - <div style={{ marginLeft: 218, marginBottom: 20 }}>
  218 + <div style={{ marginBottom: 20 }}>
218 219 <span>是否添加前置条件设置:</span>
219 220 <Radio.Group
220 221 onChange={(e) => {
... ...
src/pages/performance/KpiGroupSetting/EditComfirm/components/AddLadderParamsModal.tsx
... ... @@ -140,7 +140,13 @@ export default function AddLadderParamsModal(props: Props) {
140 140 width={1000}
141 141 >
142 142 <Spin spinning={loading}>
143   - <Form form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }} onFinish={handSubmit}>
  143 + <Form
  144 + form={form}
  145 + // labelCol={{ span: 6 }}
  146 + // wrapperCol={{ span: 18 }}
  147 + onFinish={handSubmit}
  148 + style={{ width: "70%", marginLeft: 150 }}
  149 + >
144 150 <Form.Item name="ladderParams" label="计分指标" rules={[{ required: true, message: "计分指标" }]}>
145 151 <Select
146 152 placeholder="选择指标"
... ... @@ -191,7 +197,7 @@ export default function AddLadderParamsModal(props: Props) {
191 197 {(targetType === TargetTypeEnum["百分比"] ||
192 198 targetType === TargetTypeEnum["金额"] ||
193 199 targetType === TargetTypeEnum["数量"]) && (
194   - <div style={{ marginLeft: 65 }}>
  200 + <div>
195 201 <Button type="link" onClick={() => setIsTarget(true)}>
196 202 考核目标值设置(可选项)
197 203 </Button>
... ...
src/pages/performance/KpiSetting/components/EditModal.tsx
... ... @@ -62,7 +62,13 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) {
62 62 confirmLoading={saveLoading}
63 63 afterClose={() => form.resetFields()}
64 64 >
65   - <Form form={form} onFinish={handleSave} labelCol={{ span: 6 }} wrapperCol={{ span: 15 }}>
  65 + <Form
  66 + form={form}
  67 + onFinish={handleSave}
  68 + // labelCol={{ span: 6 }}
  69 + // wrapperCol={{ span: 15 }}
  70 + style={{ width: "80%", marginLeft: 50 }}
  71 + >
66 72 <Form.Item name="indicatorName" label="指标名称" rules={[{ required: true, message: "请输入指标名称" }]}>
67 73 <Input placeholder="请输入指标名称" />
68 74 </Form.Item>
... ...
src/pages/performance/QualitySetting/components/AddIndicatorsModal.tsx
... ... @@ -3,7 +3,7 @@
3 3 import React, { useEffect, useState } from "react";
4 4 import { Modal, Form, Select, InputNumber, message, Spin, Radio, Input, Button } from "antd";
5 5 // import { queryPostIndicatorApi } from "../api";
6   -import _ from "lodash";
  6 +import _, { fromPairs } from "lodash";
7 7 import useInitail from "@/hooks/useInitail";
8 8 import { KpiGroupSetteing } from "@/pages/performance/KpiGroupSetting/interface";
9 9 import { getManagerRoleListApi } from "@/common/api";
... ... @@ -104,6 +104,7 @@ export default function AddIndicatorsModal(props: Props) {
104 104 }
105 105 setEvaPerson({ ...evaPerson, visible: true });
106 106 };
  107 + // console.log("form", form.getFieldValue("penaltyScore"));
107 108 return (
108 109 <Modal
109 110 title={`${comItem.role ? "编辑" : "新增"}考核对象`}
... ... @@ -120,12 +121,10 @@ export default function AddIndicatorsModal(props: Props) {
120 121 <Spin spinning={false}>
121 122 <Form
122 123 form={form}
123   - labelCol={{ span: 6 }}
124   - wrapperCol={{ span: 15 }}
  124 + // labelCol={{ span: 6 }}
  125 + // wrapperCol={{ span: 15 }}
  126 + style={{ width: "70%", marginLeft: 200 }}
125 127 onFinish={handSubmit}
126   - initialValues={{
127   - indicatorLadders: [{ lower: 0, standardScore: 0, key: 0 }],
128   - }}
129 128 >
130 129 <Form.Item
131 130 name="role"
... ... @@ -157,11 +156,11 @@ export default function AddIndicatorsModal(props: Props) {
157 156 ))}
158 157 </Select>
159 158 </Form.Item>
160   - <div style={{ marginBottom: 15, marginLeft: 220 }}>
  159 + <div style={{ marginBottom: 15 }}>
161 160 <a onClick={() => personView()}>{`考核人员清单 >`}</a>
162 161 </div>
163   - {type == 2 ? <div style={{ marginBottom: 15, marginLeft: 220 }}>考核方式:绩效排名差</div> : null}
164   - <div style={{ marginBottom: 15, marginLeft: 220 }}>• 处罚:</div>
  162 + {type == 2 ? <div style={{ marginBottom: 15 }}>考核方式:绩效排名差</div> : null}
  163 + <div style={{ marginBottom: 15, fontSize: 18, fontWeight: "bold" }}>• 处罚:</div>
165 164 <Form.Item
166 165 name="penaltyScore"
167 166 label="处罚绩效分"
... ... @@ -170,23 +169,64 @@ export default function AddIndicatorsModal(props: Props) {
170 169 >
171 170 <InputNumber placeholder="请输入处罚绩效分" addonAfter="分/名次" style={{ width: "100%" }} min={0} />
172 171 </Form.Item>
173   - {type == 2 ? (
174   - <Form.Item
175   - name="capPersonPenaltyScore"
176   - label="单人处罚封顶分数"
177   - rules={[{ required: true, message: "请输入单人处罚封顶分数" }]}
178   - style={{ marginBottom: 15 }}
179   - >
180   - <InputNumber placeholder="请输入单人处罚封顶分数" addonAfter="分/人" style={{ width: "100%" }} min={0} />
181   - </Form.Item>
182   - ) : null}
183 172 <Form.Item
184   - name="capPenaltyScore"
185   - label="封顶处罚分数"
186   - rules={[{ required: true, message: "请输入封顶处罚分数" }]}
187   - style={{ marginBottom: 15 }}
  173 + noStyle
  174 + shouldUpdate={(prevValues, currentValues) => prevValues.penaltyScore !== currentValues.penaltyScore}
  175 + >
  176 + {({ getFieldValue }) => {
  177 + const penaltyScore = getFieldValue("penaltyScore");
  178 + return type == 2 ? (
  179 + <Form.Item
  180 + name="capPersonPenaltyScore"
  181 + label="单人处罚封顶分数"
  182 + rules={[
  183 + { required: true, message: "请输入单人处罚封顶分数" },
  184 + { type: "number", min: penaltyScore, message: "单人处罚封顶分数必须大于等于处罚绩效分" },
  185 + ]}
  186 + style={{ marginBottom: 15}}
  187 + >
  188 + <InputNumber
  189 + placeholder="请输入单人处罚封顶分数"
  190 + addonAfter="分/人"
  191 + style={{ width: "100%" }}
  192 + min={0}
  193 + />
  194 + </Form.Item>
  195 + ) : null;
  196 + }}
  197 + </Form.Item>
  198 + <Form.Item
  199 + noStyle
  200 + shouldUpdate={(prevValues, currentValues) => {
  201 + if (type == 2) {
  202 + return prevValues.capPersonPenaltyScore !== currentValues.capPersonPenaltyScore;
  203 + } else {
  204 + return prevValues.penaltyScore !== currentValues.penaltyScore;
  205 + }
  206 + }}
188 207 >
189   - <InputNumber placeholder="请输入封顶处罚分数" addonAfter="分" style={{ width: "100%" }} min={0} />
  208 + {({ getFieldValue }) => {
  209 + const capPersonPenaltyScore = getFieldValue("capPersonPenaltyScore");
  210 + const penaltyScore = getFieldValue("penaltyScore");
  211 + return (
  212 + <Form.Item
  213 + name="capPenaltyScore"
  214 + label="封顶处罚分数"
  215 + rules={[
  216 + { required: true, message: "请输入封顶处罚分数" },
  217 + {
  218 + type: "number",
  219 + min: type == 1 ? penaltyScore : capPersonPenaltyScore,
  220 + message:
  221 + type == 1 ? "封顶处罚分数必须大于等于处罚绩效分" : "封顶处罚分数必须大于等于单人处罚封顶分数",
  222 + },
  223 + ]}
  224 + style={{ marginBottom: 40 }}
  225 + >
  226 + <InputNumber placeholder="请输入封顶处罚分数" addonAfter="分" style={{ width: "100%" }} min={0} />
  227 + </Form.Item>
  228 + );
  229 + }}
190 230 </Form.Item>
191 231 <Form.Item
192 232 name="penaltyMoney"
... ... @@ -196,27 +236,68 @@ export default function AddIndicatorsModal(props: Props) {
196 236 >
197 237 <InputNumber placeholder="请输入处罚金额" addonAfter="元/名次" style={{ width: "100%" }} min={0} />
198 238 </Form.Item>
199   - {type == 2 ? (
200   - <Form.Item
201   - name="capPersonPenaltyMoney"
202   - label="单人处罚封顶金额"
203   - rules={[{ required: true, message: "请输入单人处罚封顶金额" }]}
204   - style={{ marginBottom: 15 }}
205   - >
206   - <InputNumber placeholder="请输入单人处罚封顶金额" addonAfter="元/人" style={{ width: "100%" }} min={0} />
207   - </Form.Item>
208   - ) : null}
209 239 <Form.Item
210   - name="capPenaltyMoney"
211   - label="封顶处罚金额"
212   - rules={[{ required: true, message: "请输入封顶处罚金额" }]}
213   - style={{ marginBottom: 15 }}
  240 + noStyle
  241 + shouldUpdate={(prevValues, currentValues) => prevValues.penaltyMoney !== currentValues.penaltyMoney}
214 242 >
215   - <InputNumber placeholder="请输入封顶处罚金额" addonAfter="元" style={{ width: "100%" }} min={0} />
  243 + {({ getFieldValue }) => {
  244 + const penaltyMoney = getFieldValue("penaltyMoney");
  245 + return type == 2 ? (
  246 + <Form.Item
  247 + name="capPersonPenaltyMoney"
  248 + label="单人处罚封顶金额"
  249 + rules={[
  250 + { required: true, message: "请输入单人处罚封顶金额" },
  251 + { type: "number", min: penaltyMoney, message: "单人处罚封顶金额必须大于等于处罚金额" },
  252 + ]}
  253 + style={{ marginBottom: 15 }}
  254 + >
  255 + <InputNumber
  256 + placeholder="请输入单人处罚封顶金额"
  257 + addonAfter="元/人"
  258 + style={{ width: "100%" }}
  259 + min={0}
  260 + />
  261 + </Form.Item>
  262 + ) : null;
  263 + }}
  264 + </Form.Item>
  265 + <Form.Item
  266 + noStyle
  267 + shouldUpdate={(prevValues, currentValues) => {
  268 + if (type == 2) {
  269 + return prevValues.capPersonPenaltyMoney !== currentValues.capPersonPenaltyMoney;
  270 + } else {
  271 + return prevValues.penaltyMoney !== currentValues.penaltyMoney;
  272 + }
  273 + }}
  274 + >
  275 + {({ getFieldValue }) => {
  276 + const capPersonPenaltyMoney = getFieldValue("capPersonPenaltyMoney");
  277 + const penaltyMoney = getFieldValue("penaltyMoney");
  278 + return (
  279 + <Form.Item
  280 + name="capPenaltyMoney"
  281 + label="封顶处罚金额"
  282 + rules={[
  283 + { required: true, message: "请输入封顶处罚金额" },
  284 + {
  285 + type: "number",
  286 + min: type == 1 ? penaltyMoney : capPersonPenaltyMoney,
  287 + message:
  288 + type == 1 ? "封顶处罚金额必须大于等于处罚金额" : "封顶处罚金额必须大于等于单人处罚封顶金额",
  289 + },
  290 + ]}
  291 + style={{ marginBottom: 15 }}
  292 + >
  293 + <InputNumber placeholder="请输入封顶处罚金额" addonAfter="元" style={{ width: "100%" }} min={0} />
  294 + </Form.Item>
  295 + );
  296 + }}
216 297 </Form.Item>
217 298 {type == 2 ? (
218 299 <>
219   - <div style={{ marginBottom: 15, marginLeft: 220 }}>• 奖励:</div>
  300 + <div style={{ marginBottom: 15, fontSize: 18, fontWeight: "bold" }}>• 奖励:</div>
220 301 <Form.Item
221 302 name="awardScore"
222 303 label="奖励绩效分"
... ... @@ -226,26 +307,59 @@ export default function AddIndicatorsModal(props: Props) {
226 307 <InputNumber placeholder="请输入奖励绩效分" addonAfter="分/名次" style={{ width: "100%" }} min={0} />
227 308 </Form.Item>
228 309 <Form.Item
229   - name="capPersonAwardScore"
230   - label="单人奖励封顶分数"
231   - rules={[{ required: true, message: "请输入单人奖励封顶分数" }]}
232   - style={{ marginBottom: 15 }}
  310 + noStyle
  311 + shouldUpdate={(prevValues, currentValues) => prevValues.awardScore !== currentValues.awardScore}
233 312 >
234   - <InputNumber
235   - placeholder="请输入单人奖励封顶分数"
236   - addonAfter="分/人"
237   - style={{ width: "100%" }}
238   - min={0}
239   - />
  313 + {({ getFieldValue }) => {
  314 + const awardScore = getFieldValue("awardScore");
  315 + return (
  316 + <Form.Item
  317 + name="capPersonAwardScore"
  318 + label="单人奖励封顶分数"
  319 + rules={[
  320 + { required: true, message: "请输入单人奖励封顶分数" },
  321 + { type: "number", min: awardScore, message: "单人奖励封顶分数必须大于等于奖励绩效分" },
  322 + ]}
  323 + style={{ marginBottom: 15 }}
  324 + >
  325 + <InputNumber
  326 + placeholder="请输入单人奖励封顶分数"
  327 + addonAfter="分/人"
  328 + style={{ width: "100%" }}
  329 + min={0}
  330 + />
  331 + </Form.Item>
  332 + );
  333 + }}
240 334 </Form.Item>
241 335 <Form.Item
242   - name="capAwardScore"
243   - label="封顶奖励分数"
244   - rules={[{ required: true, message: "请输入封顶奖励分数" }]}
245   - style={{ marginBottom: 15 }}
  336 + noStyle
  337 + shouldUpdate={(prevValues, currentValues) =>
  338 + prevValues.capPersonAwardScore !== currentValues.capPersonAwardScore
  339 + }
246 340 >
247   - <InputNumber placeholder="请输入封顶奖励分数" addonAfter="分" style={{ width: "100%" }} min={0} />
  341 + {({ getFieldValue }) => {
  342 + const capPersonAwardScore = getFieldValue("capPersonAwardScore");
  343 + return (
  344 + <Form.Item
  345 + name="capAwardScore"
  346 + label="封顶奖励分数"
  347 + rules={[
  348 + { required: true, message: "请输入封顶奖励分数" },
  349 + {
  350 + type: "number",
  351 + min: capPersonAwardScore,
  352 + message: "封顶奖励分数必须大于等于单人奖励封顶分数",
  353 + },
  354 + ]}
  355 + style={{ marginBottom: 40 }}
  356 + >
  357 + <InputNumber placeholder="请输入封顶奖励分数" addonAfter="分" style={{ width: "100%" }} min={0} />
  358 + </Form.Item>
  359 + );
  360 + }}
248 361 </Form.Item>
  362 +
249 363 <Form.Item
250 364 name="awardMoney"
251 365 label="奖励金额"
... ... @@ -255,25 +369,57 @@ export default function AddIndicatorsModal(props: Props) {
255 369 <InputNumber placeholder="请输入奖励金额" addonAfter="元/名次" style={{ width: "100%" }} min={0} />
256 370 </Form.Item>
257 371 <Form.Item
258   - name="capPersonAwardMoney"
259   - label="单人奖励封顶金额"
260   - rules={[{ required: true, message: "请输入单人奖励封顶金额" }]}
261   - style={{ marginBottom: 15 }}
  372 + noStyle
  373 + shouldUpdate={(prevValues, currentValues) => prevValues.awardMoney !== currentValues.awardMoney}
262 374 >
263   - <InputNumber
264   - placeholder="请输入单人奖励封顶金额"
265   - addonAfter="元/人"
266   - style={{ width: "100%" }}
267   - min={0}
268   - />
  375 + {({ getFieldValue }) => {
  376 + const awardMoney = getFieldValue("awardMoney");
  377 + return (
  378 + <Form.Item
  379 + name="capPersonAwardMoney"
  380 + label="单人奖励封顶金额"
  381 + rules={[
  382 + { required: true, message: "请输入单人奖励封顶金额" },
  383 + { type: "number", min: awardMoney, message: "单人奖励封顶金额必须大于等于奖励金额" },
  384 + ]}
  385 + style={{ marginBottom: 15 }}
  386 + >
  387 + <InputNumber
  388 + placeholder="请输入单人奖励封顶金额"
  389 + addonAfter="元/人"
  390 + style={{ width: "100%" }}
  391 + min={0}
  392 + />
  393 + </Form.Item>
  394 + );
  395 + }}
269 396 </Form.Item>
270 397 <Form.Item
271   - name="capAwardMoney"
272   - label="封顶奖励金额"
273   - rules={[{ required: true, message: "请输入封顶奖励金额" }]}
274   - style={{ marginBottom: 15 }}
  398 + noStyle
  399 + shouldUpdate={(prevValues, currentValues) =>
  400 + prevValues.capPersonAwardMoney !== currentValues.capPersonAwardMoney
  401 + }
275 402 >
276   - <InputNumber placeholder="请输入封顶奖励金额" addonAfter="元" style={{ width: "100%" }} min={0} />
  403 + {({ getFieldValue }) => {
  404 + const capPersonAwardMoney = getFieldValue("capPersonAwardMoney");
  405 + return (
  406 + <Form.Item
  407 + name="capAwardMoney"
  408 + label="封顶奖励金额"
  409 + rules={[
  410 + { required: true, message: "请输入封顶奖励金额" },
  411 + {
  412 + type: "number",
  413 + min: capPersonAwardMoney,
  414 + message: "封顶奖励金额必须大于等于单人奖励封顶金额",
  415 + },
  416 + ]}
  417 + style={{ marginBottom: 15 }}
  418 + >
  419 + <InputNumber placeholder="请输入封顶奖励金额" addonAfter="元" style={{ width: "100%" }} min={0} />
  420 + </Form.Item>
  421 + );
  422 + }}
277 423 </Form.Item>
278 424 </>
279 425 ) : null}
... ...
src/pages/performance/QualitySetting/components/EditModal.tsx
... ... @@ -107,14 +107,14 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) {
107 107 if (pa.type == 2) {
108 108 pa.details.forEach((item: any) => {
109 109 if (
110   - !item.capPersonPenaltyScore ||
111   - !item.capPersonPenaltyMoney ||
112   - !item.awardScore ||
113   - !item.capPersonAwardScore ||
114   - !item.capAwardScore ||
115   - !item.awardMoney ||
116   - !item.capPersonAwardMoney ||
117   - !item.capAwardMoney
  110 + 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
118 118 ) {
119 119 message.error("考核详情中存在没有填的内容");
120 120 } else {
... ... @@ -175,7 +175,13 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) {
175 175 width={1200}
176 176 >
177 177 <Spin spinning={currentItem.id ? loading : false}>
178   - <Form form={form} onFinish={handleSave} labelCol={{ span: 6 }} wrapperCol={{ span: 15 }}>
  178 + <Form
  179 + form={form}
  180 + onFinish={handleSave}
  181 + // labelCol={{ span: 6 }}
  182 + // wrapperCol={{ span: 15 }}
  183 + style={{ width: "70%", marginLeft: 200 }}
  184 + >
179 185 <Form.Item name="post" label="岗位" rules={[{ required: true, message: "请选择岗位" }]}>
180 186 <Select
181 187 labelInValue
... ... @@ -238,7 +244,7 @@ export default function EditModal({ onClose, setItem, item, roleList }: Props) {
238 244 ) : null;
239 245 }}
240 246 </Form.Item>
241   - <div style={{ marginBottom: 20, marginLeft: 220 }}>
  247 + <div style={{ marginBottom: 20 }}>
242 248 <a onClick={() => personView()}>{`人员清单 >`}</a>
243 249 </div>
244 250 <Form.Item name="details" label="考核详情" rules={[{ required: true }]}>
... ...