Commit 2712351433476eaac2cce27f3a1bbf3608b8b0fe

Authored by 曾柯
1 parent 6861fe92

考评组排名倒数

src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCommissionParamsModal.tsx
... ... @@ -75,6 +75,8 @@ export default function AddCommissionParamsModal(props: Props) {
75 75 console.log("comItem.targetType", comItem.targetType);
76 76 setTargetType(indTar);
77 77 setIndicatorName(comItem.name);
  78 + setDataType(comItem.dataType);
  79 + setCodeType(comItem.codeType);
78 80 form.setFieldsValue({
79 81 ...comItem,
80 82 commissionParams: {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCommissionParamsModalSal.tsx
... ... @@ -74,6 +74,8 @@ export default function AddCommissionParamsModal(props: Props) {
74 74 console.log("comItem.targetType", comItem.targetType);
75 75 setTargetType(indTar);
76 76 setIndicatorName(comItem.name);
  77 + setDataType(comItem.dataType);
  78 + setCodeType(comItem.codeType);
77 79 form.setFieldsValue({
78 80 ...comItem,
79 81 commissionParams: {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCondModal.tsx
... ... @@ -71,6 +71,8 @@ export default function AddCondModal(props: Props) {
71 71 console.log("comItem.targetType", comItem.targetType);
72 72 setTargetType(indTar);
73 73 setIndicatorName(comItem.name);
  74 + setDataType(comItem.dataType);
  75 + setCodeType(comItem.codeType);
74 76 form.setFieldsValue({
75 77 ...comItem,
76 78 conds: {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCondModalSal.tsx
... ... @@ -69,6 +69,8 @@ export default function AddCondModal(props: Props) {
69 69 console.log("comItem.targetType", comItem.targetType);
70 70 setTargetType(indTar);
71 71 setIndicatorName(comItem.name);
  72 + setDataType(comItem.dataType);
  73 + setCodeType(comItem.codeType);
72 74 form.setFieldsValue({
73 75 ...comItem,
74 76 conds: {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddLadderParamsModal.tsx
... ... @@ -68,6 +68,7 @@ export default function AddLadderParamsModal(props: Props) {
68 68 console.log("comItem.targetType", comItem.targetType);
69 69 setTargetType(indTar);
70 70 setIndicatorName(comItem.name);
  71 + setCodeType(comItem.codeType);
71 72 form.setFieldsValue({
72 73 ...comItem,
73 74 ladderParams: {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddLadderParamsModalSal.tsx
... ... @@ -68,6 +68,7 @@ export default function AddLadderParamsModal(props: Props) {
68 68 console.log("comItem.targetType", comItem.targetType);
69 69 setTargetType(indTar);
70 70 setIndicatorName(comItem.name);
  71 + setCodeType(comItem.codeType);
71 72 form.setFieldsValue({
72 73 ...comItem,
73 74 ladderParams: {
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddRewardsModal.tsx
... ... @@ -317,6 +317,12 @@ export default function CreateModal(props: Props) {
317 317 <Radio value={2}>按比例</Radio>
318 318 </Radio.Group>
319 319 </Form.Item>
  320 + {/* <Form.Item name="rankOrderType" label="排名顺序" rules={[{ required: true, message: "请选择排名顺序" }]}>
  321 + <Radio.Group>
  322 + <Radio value={1}>正数</Radio>
  323 + <Radio value={2}>倒数</Radio>
  324 + </Radio.Group>
  325 + </Form.Item> */}
320 326 <Form.Item
321 327 noStyle
322 328 shouldUpdate={(prevValues, currentValues) => prevValues.rankType !== currentValues.rankType}
... ... @@ -338,9 +344,9 @@ export default function CreateModal(props: Props) {
338 344 {({ getFieldValue }) => {
339 345 const rankType = getFieldValue("rankType");
340 346 if (rankType == 1 && !currentItem.ladders) {
341   - form.setFieldValue("ladders", [{ lower: 1, money: 0, key: 0 }]);
  347 + form.setFieldValue("ladders", [{ lower: 1, money: 0, key: 0, rankOrderType: 1 }]);
342 348 } else if (rankType == 2 && !currentItem.ladders) {
343   - form.setFieldValue("ladders", [{ lower: 0, money: 0, key: 0 }]);
  349 + form.setFieldValue("ladders", [{ lower: 0, money: 0, key: 0, rankOrderType: 1 }]);
344 350 }
345 351 return (
346 352 <Form.Item
... ... @@ -352,7 +358,7 @@ export default function CreateModal(props: Props) {
352 358 <RankModal
353 359 visible
354 360 isPercent={isPercent}
355   - laddersType={currentItem.laddersType}
  361 + laddersType={currentItem?.laddersType}
356 362 calType={calType}
357 363 rankType={rankType}
358 364 />
... ...
src/pages/performance/EvaGroupSetting/EditComfirm/components/RankModal.tsx
1 1 import React, { useState, useEffect } from "react";
2   -import { Table, Input, InputNumber, Popconfirm, Form, Typography, Space, Divider, Modal } from "antd";
  2 +import { Table, Input, InputNumber, Popconfirm, Form, Typography, Space, Divider, Modal, Radio } from "antd";
3 3 import { SalaryMapHeader } from "@/pages/performance/CompensateGroupConfig/entity";
4 4  
5 5 interface Item {
... ... @@ -67,12 +67,18 @@ const TotalAmount = ({
67 67 max = 999999999999;
68 68 }
69 69 const inputNode = inputType === "number" ? <InputNumber precision={precision} max={max} /> : <Input />;
  70 + const rankOrderType = (
  71 + <Radio.Group>
  72 + <Radio value={1}>正数</Radio>
  73 + <Radio value={2}>倒数</Radio>
  74 + </Radio.Group>
  75 + );
70 76  
71 77 return (
72 78 <td {...restProps}>
73 79 {editing ? (
74 80 <Form.Item name={dataIndex} style={{ margin: 0 }}>
75   - {inputNode}
  81 + {dataIndex == "rankOrderType" ? rankOrderType : inputNode}
76 82 </Form.Item>
77 83 ) : (
78 84 children
... ... @@ -123,6 +129,8 @@ const TotalAmount = ({
123 129 newObj.lower = lastData.upper;
124 130 } else if (rankType == 1) {
125 131 newObj.lower = lastData.upper + 1;
  132 + } else {
  133 + newObj.lower = lastData.upper + 1;
126 134 }
127 135 newObj.key = Number(lastData.key) + 1;
128 136  
... ... @@ -245,8 +253,9 @@ const TotalAmount = ({
245 253 children: [
246 254 {
247 255 title: `初始排名${rankType == 1 ? "(≥)" : "(>)"}`,
  256 + editable: true,
248 257 dataIndex: "lower",
249   - width: "20%",
  258 + width: "15%",
250 259 render: (value: number) => {
251 260 if (isPercent == 2) {
252 261 return value + "%";
... ... @@ -260,9 +269,9 @@ const TotalAmount = ({
260 269 },
261 270 },
262 271 {
263   - title: `结束排名${rankType == 1 ? "(<)" : "(≤)"}`,
  272 + title: `结束排名${rankType == 1 ? "()" : "(≤)"}`,
264 273 dataIndex: "upper",
265   - width: "20%",
  274 + width: "15%",
266 275 editable: true,
267 276 render: (value: number) => {
268 277 if (value) {
... ... @@ -285,7 +294,7 @@ const TotalAmount = ({
285 294 {
286 295 title: "金额 (元)",
287 296 dataIndex: "money",
288   - width: "20%",
  297 + width: "10%",
289 298 editable: true,
290 299 render: (text: number) => (typeof text === "number" ? `${text}` : "--"),
291 300 },
... ... @@ -297,6 +306,13 @@ const TotalAmount = ({
297 306 render: (text: number) => (typeof text === "number" ? `${text}` : "--"),
298 307 },
299 308 {
  309 + title: "排名顺序类型",
  310 + dataIndex: "rankOrderType",
  311 + width: "20%",
  312 + editable: true,
  313 + render: (rankOrderType: number) => (rankOrderType === 2 ? "倒数排序" : "正数排序"),
  314 + },
  315 + {
300 316 title: "操作",
301 317 width: "40%",
302 318 dataIndex: "operation",
... ... @@ -357,16 +373,28 @@ const TotalAmount = ({
357 373 children: [
358 374 {
359 375 ...col.children[0],
  376 + onCell: (record: Item) => {
  377 + return {
  378 + record,
  379 + inputType: "number",
  380 + dataIndex: col.children[0].dataIndex,
  381 + title: col.children[0].title,
  382 + editing: isEditing(record),
  383 + };
  384 + },
360 385 },
361 386 {
362 387 ...col.children[1],
363   - onCell: (record: Item) => ({
364   - record,
365   - inputType: "number",
366   - dataIndex: col.children[1].dataIndex,
367   - title: col.children[1].title,
368   - editing: isEditing(record),
369   - }),
  388 + onCell: (record: Item) => {
  389 + console.log("recordrecord", record);
  390 + return {
  391 + record,
  392 + inputType: "number",
  393 + dataIndex: col.children[1].dataIndex,
  394 + title: col.children[1].title,
  395 + editing: isEditing(record),
  396 + };
  397 + },
370 398 },
371 399 ],
372 400 };
... ...