Commit af80dc0ed3a31996b5c402764538c24f9e44d19b
Merge branch 'bug_fix' into 'master'
考评Bug fix See merge request !191
Showing
10 changed files
with
94 additions
and
80 deletions
src/pages/finance/FinanceInvestor/components/Filter.tsx
@@ -8,26 +8,11 @@ const { Option } = Select; | @@ -8,26 +8,11 @@ const { Option } = Select; | ||
8 | const Search = Input.Search; | 8 | const Search = Input.Search; |
9 | 9 | ||
10 | export default function AccountList() { | 10 | export default function AccountList() { |
11 | - // const { setVisible, setParams, innerParams, dealerLoading, dealerList } = useStore(); | ||
12 | const { triggerModal, brands, financeList, setInvestList, companys, dealers } = useStore(); | 11 | const { triggerModal, brands, financeList, setInvestList, companys, dealers } = useStore(); |
13 | - // investList, | ||
14 | - // setInvestList, | ||
15 | // 存储删选条件 | 12 | // 存储删选条件 |
16 | const [filterParams, setFilterParams] = useState({}); | 13 | const [filterParams, setFilterParams] = useState({}); |
17 | 14 | ||
18 | - console.log("投资主体11列表", financeList); | ||
19 | - | ||
20 | - // function searchType(accountType: number) { | ||
21 | - // setParams({ accountType }, true); | ||
22 | - // } | ||
23 | - | ||
24 | - // _onSelectSubject; | ||
25 | - // const fetchListByName = debounce(value => { | ||
26 | - // setParams({ keywords: value }, true); | ||
27 | - // }, 500); | ||
28 | - | ||
29 | useEffect(() => { | 15 | useEffect(() => { |
30 | - console.log("筛选参数filterParams", filterParams); | ||
31 | let originList = financeList; | 16 | let originList = financeList; |
32 | let res = []; | 17 | let res = []; |
33 | if (filterParams.brandId) { | 18 | if (filterParams.brandId) { |
@@ -41,7 +26,6 @@ export default function AccountList() { | @@ -41,7 +26,6 @@ export default function AccountList() { | ||
41 | if (filterParams.includeId) { | 26 | if (filterParams.includeId) { |
42 | //删选包含商家 includeId | 27 | //删选包含商家 includeId |
43 | originList = originList.filter((item) => item.includeDealers?.find((y) => y.id === filterParams.includeId)); | 28 | originList = originList.filter((item) => item.includeDealers?.find((y) => y.id === filterParams.includeId)); |
44 | - console.log("筛选输入:", originList); | ||
45 | } | 29 | } |
46 | if (filterParams.creditDealerId) { | 30 | if (filterParams.creditDealerId) { |
47 | //删选授信商家 creditDealerId | 31 | //删选授信商家 creditDealerId |
src/pages/finance/SpecialAccount/FactoryBill/components/Filter.tsx
1 | import React, { useCallback } from "react"; | 1 | import React, { useCallback } from "react"; |
2 | -import { Button, Col, Row, Select } from "antd"; | 2 | +import { Button, Row, Select } from "antd"; |
3 | import { useStore } from "../index"; | 3 | import { useStore } from "../index"; |
4 | 4 | ||
5 | const { Option } = Select; | 5 | const { Option } = Select; |
@@ -10,61 +10,47 @@ export default function Filter() { | @@ -10,61 +10,47 @@ export default function Filter() { | ||
10 | const searchDealer = useCallback((dealerId) => { | 10 | const searchDealer = useCallback((dealerId) => { |
11 | setDealerId(dealerId); | 11 | setDealerId(dealerId); |
12 | }, []); | 12 | }, []); |
13 | - | 13 | + |
14 | const searchBrand = useCallback((brandId) => { | 14 | const searchBrand = useCallback((brandId) => { |
15 | setBrandId(brandId); | 15 | setBrandId(brandId); |
16 | }, []); | 16 | }, []); |
17 | 17 | ||
18 | return ( | 18 | return ( |
19 | - <div | ||
20 | - style={{ | ||
21 | - display: "flex", | ||
22 | - flexDirection: "row", | ||
23 | - justifyContent: "space-between", | ||
24 | - alignItems: "center", | ||
25 | - marginBottom: 20, | ||
26 | - }} | ||
27 | - > | ||
28 | - <Row style={{ display: "flex", flex: 1, alignItems: "center" }}> | ||
29 | - <div>商家:</div> | ||
30 | - <Col span={6}> | ||
31 | - <Select | ||
32 | - placeholder="请选择商家" | ||
33 | - showSearch | ||
34 | - optionFilterProp="children" | ||
35 | - onChange={searchDealer} | ||
36 | - // value={dealerId && dealerId > 0 ? dealerId : undefined} | ||
37 | - style={{ width: 300 }} | ||
38 | - > | ||
39 | - {dealerList.map((dealer) => ( | ||
40 | - <Option value={dealer.id} key={dealer.id}> | ||
41 | - {dealer.name} | ||
42 | - </Option> | ||
43 | - ))} | ||
44 | - </Select> | ||
45 | - </Col> | ||
46 | - <div style={{ marginLeft: 20 }}>品牌:</div> | ||
47 | - <Col span={6}> | ||
48 | - <Select | ||
49 | - placeholder="请选择品牌" | ||
50 | - loading={brandLoading} | ||
51 | - allowClear | ||
52 | - optionFilterProp="children" | ||
53 | - onChange={searchBrand} | ||
54 | - value={brandId && brandId > 0 ? brandId : undefined} | ||
55 | - style={{ width: 160 }} | ||
56 | - > | ||
57 | - {brandList.map((brand) => ( | ||
58 | - <Option value={brand.id} key={brand.id}> | ||
59 | - {brand.name} | ||
60 | - </Option> | ||
61 | - ))} | ||
62 | - </Select> | ||
63 | - </Col> | 19 | + <Row justify="space-between" style={{ marginBottom: 10 }}> |
20 | + <Row justify="start"> | ||
21 | + <Select | ||
22 | + placeholder="请选择商家" | ||
23 | + showSearch | ||
24 | + optionFilterProp="children" | ||
25 | + onChange={searchDealer} | ||
26 | + style={{ width: 200 }} | ||
27 | + > | ||
28 | + {dealerList.map((dealer) => ( | ||
29 | + <Option value={dealer.id} key={dealer.id}> | ||
30 | + {dealer.name} | ||
31 | + </Option> | ||
32 | + ))} | ||
33 | + </Select> | ||
34 | + <Select | ||
35 | + placeholder="请选择品牌" | ||
36 | + loading={brandLoading} | ||
37 | + allowClear | ||
38 | + optionFilterProp="children" | ||
39 | + onChange={searchBrand} | ||
40 | + value={brandId && brandId > 0 ? brandId : undefined} | ||
41 | + style={{ width: 200,marginLeft:100 }} | ||
42 | + > | ||
43 | + {brandList.map((brand) => ( | ||
44 | + <Option value={brand.id} key={brand.id}> | ||
45 | + {brand.name} | ||
46 | + </Option> | ||
47 | + ))} | ||
48 | + </Select> | ||
64 | </Row> | 49 | </Row> |
50 | + | ||
65 | <Button type="primary" hidden={!dealerId} onClick={() => setVisible(true)}> | 51 | <Button type="primary" hidden={!dealerId} onClick={() => setVisible(true)}> |
66 | 新增 | 52 | 新增 |
67 | </Button> | 53 | </Button> |
68 | - </div> | 54 | + </Row> |
69 | ); | 55 | ); |
70 | } | 56 | } |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCommissionParamsModal.tsx
@@ -75,6 +75,8 @@ export default function AddCommissionParamsModal(props: Props) { | @@ -75,6 +75,8 @@ export default function AddCommissionParamsModal(props: Props) { | ||
75 | console.log("comItem.targetType", comItem.targetType); | 75 | console.log("comItem.targetType", comItem.targetType); |
76 | setTargetType(indTar); | 76 | setTargetType(indTar); |
77 | setIndicatorName(comItem.name); | 77 | setIndicatorName(comItem.name); |
78 | + setDataType(comItem.dataType); | ||
79 | + setCodeType(comItem.codeType); | ||
78 | form.setFieldsValue({ | 80 | form.setFieldsValue({ |
79 | ...comItem, | 81 | ...comItem, |
80 | commissionParams: { | 82 | commissionParams: { |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCommissionParamsModalSal.tsx
@@ -74,6 +74,8 @@ export default function AddCommissionParamsModal(props: Props) { | @@ -74,6 +74,8 @@ export default function AddCommissionParamsModal(props: Props) { | ||
74 | console.log("comItem.targetType", comItem.targetType); | 74 | console.log("comItem.targetType", comItem.targetType); |
75 | setTargetType(indTar); | 75 | setTargetType(indTar); |
76 | setIndicatorName(comItem.name); | 76 | setIndicatorName(comItem.name); |
77 | + setDataType(comItem.dataType); | ||
78 | + setCodeType(comItem.codeType); | ||
77 | form.setFieldsValue({ | 79 | form.setFieldsValue({ |
78 | ...comItem, | 80 | ...comItem, |
79 | commissionParams: { | 81 | commissionParams: { |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCondModal.tsx
@@ -71,6 +71,8 @@ export default function AddCondModal(props: Props) { | @@ -71,6 +71,8 @@ export default function AddCondModal(props: Props) { | ||
71 | console.log("comItem.targetType", comItem.targetType); | 71 | console.log("comItem.targetType", comItem.targetType); |
72 | setTargetType(indTar); | 72 | setTargetType(indTar); |
73 | setIndicatorName(comItem.name); | 73 | setIndicatorName(comItem.name); |
74 | + setDataType(comItem.dataType); | ||
75 | + setCodeType(comItem.codeType); | ||
74 | form.setFieldsValue({ | 76 | form.setFieldsValue({ |
75 | ...comItem, | 77 | ...comItem, |
76 | conds: { | 78 | conds: { |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddCondModalSal.tsx
@@ -69,6 +69,8 @@ export default function AddCondModal(props: Props) { | @@ -69,6 +69,8 @@ export default function AddCondModal(props: Props) { | ||
69 | console.log("comItem.targetType", comItem.targetType); | 69 | console.log("comItem.targetType", comItem.targetType); |
70 | setTargetType(indTar); | 70 | setTargetType(indTar); |
71 | setIndicatorName(comItem.name); | 71 | setIndicatorName(comItem.name); |
72 | + setDataType(comItem.dataType); | ||
73 | + setCodeType(comItem.codeType); | ||
72 | form.setFieldsValue({ | 74 | form.setFieldsValue({ |
73 | ...comItem, | 75 | ...comItem, |
74 | conds: { | 76 | conds: { |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddLadderParamsModal.tsx
@@ -68,6 +68,7 @@ export default function AddLadderParamsModal(props: Props) { | @@ -68,6 +68,7 @@ export default function AddLadderParamsModal(props: Props) { | ||
68 | console.log("comItem.targetType", comItem.targetType); | 68 | console.log("comItem.targetType", comItem.targetType); |
69 | setTargetType(indTar); | 69 | setTargetType(indTar); |
70 | setIndicatorName(comItem.name); | 70 | setIndicatorName(comItem.name); |
71 | + setCodeType(comItem.codeType); | ||
71 | form.setFieldsValue({ | 72 | form.setFieldsValue({ |
72 | ...comItem, | 73 | ...comItem, |
73 | ladderParams: { | 74 | ladderParams: { |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddLadderParamsModalSal.tsx
@@ -68,6 +68,7 @@ export default function AddLadderParamsModal(props: Props) { | @@ -68,6 +68,7 @@ export default function AddLadderParamsModal(props: Props) { | ||
68 | console.log("comItem.targetType", comItem.targetType); | 68 | console.log("comItem.targetType", comItem.targetType); |
69 | setTargetType(indTar); | 69 | setTargetType(indTar); |
70 | setIndicatorName(comItem.name); | 70 | setIndicatorName(comItem.name); |
71 | + setCodeType(comItem.codeType); | ||
71 | form.setFieldsValue({ | 72 | form.setFieldsValue({ |
72 | ...comItem, | 73 | ...comItem, |
73 | ladderParams: { | 74 | ladderParams: { |
src/pages/performance/EvaGroupSetting/EditComfirm/components/AddRewardsModal.tsx
@@ -317,6 +317,12 @@ export default function CreateModal(props: Props) { | @@ -317,6 +317,12 @@ export default function CreateModal(props: Props) { | ||
317 | <Radio value={2}>按比例</Radio> | 317 | <Radio value={2}>按比例</Radio> |
318 | </Radio.Group> | 318 | </Radio.Group> |
319 | </Form.Item> | 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 | <Form.Item | 326 | <Form.Item |
321 | noStyle | 327 | noStyle |
322 | shouldUpdate={(prevValues, currentValues) => prevValues.rankType !== currentValues.rankType} | 328 | shouldUpdate={(prevValues, currentValues) => prevValues.rankType !== currentValues.rankType} |
@@ -338,9 +344,9 @@ export default function CreateModal(props: Props) { | @@ -338,9 +344,9 @@ export default function CreateModal(props: Props) { | ||
338 | {({ getFieldValue }) => { | 344 | {({ getFieldValue }) => { |
339 | const rankType = getFieldValue("rankType"); | 345 | const rankType = getFieldValue("rankType"); |
340 | if (rankType == 1 && !currentItem.ladders) { | 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 | } else if (rankType == 2 && !currentItem.ladders) { | 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 | return ( | 351 | return ( |
346 | <Form.Item | 352 | <Form.Item |
@@ -352,7 +358,7 @@ export default function CreateModal(props: Props) { | @@ -352,7 +358,7 @@ export default function CreateModal(props: Props) { | ||
352 | <RankModal | 358 | <RankModal |
353 | visible | 359 | visible |
354 | isPercent={isPercent} | 360 | isPercent={isPercent} |
355 | - laddersType={currentItem.laddersType} | 361 | + laddersType={currentItem?.laddersType} |
356 | calType={calType} | 362 | calType={calType} |
357 | rankType={rankType} | 363 | rankType={rankType} |
358 | /> | 364 | /> |
src/pages/performance/EvaGroupSetting/EditComfirm/components/RankModal.tsx
1 | import React, { useState, useEffect } from "react"; | 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 | import { SalaryMapHeader } from "@/pages/performance/CompensateGroupConfig/entity"; | 3 | import { SalaryMapHeader } from "@/pages/performance/CompensateGroupConfig/entity"; |
4 | 4 | ||
5 | interface Item { | 5 | interface Item { |
@@ -67,12 +67,18 @@ const TotalAmount = ({ | @@ -67,12 +67,18 @@ const TotalAmount = ({ | ||
67 | max = 999999999999; | 67 | max = 999999999999; |
68 | } | 68 | } |
69 | const inputNode = inputType === "number" ? <InputNumber precision={precision} max={max} /> : <Input />; | 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 | return ( | 77 | return ( |
72 | <td {...restProps}> | 78 | <td {...restProps}> |
73 | {editing ? ( | 79 | {editing ? ( |
74 | <Form.Item name={dataIndex} style={{ margin: 0 }}> | 80 | <Form.Item name={dataIndex} style={{ margin: 0 }}> |
75 | - {inputNode} | 81 | + {dataIndex == "rankOrderType" ? rankOrderType : inputNode} |
76 | </Form.Item> | 82 | </Form.Item> |
77 | ) : ( | 83 | ) : ( |
78 | children | 84 | children |
@@ -123,6 +129,8 @@ const TotalAmount = ({ | @@ -123,6 +129,8 @@ const TotalAmount = ({ | ||
123 | newObj.lower = lastData.upper; | 129 | newObj.lower = lastData.upper; |
124 | } else if (rankType == 1) { | 130 | } else if (rankType == 1) { |
125 | newObj.lower = lastData.upper + 1; | 131 | newObj.lower = lastData.upper + 1; |
132 | + } else { | ||
133 | + newObj.lower = lastData.upper + 1; | ||
126 | } | 134 | } |
127 | newObj.key = Number(lastData.key) + 1; | 135 | newObj.key = Number(lastData.key) + 1; |
128 | 136 | ||
@@ -245,8 +253,9 @@ const TotalAmount = ({ | @@ -245,8 +253,9 @@ const TotalAmount = ({ | ||
245 | children: [ | 253 | children: [ |
246 | { | 254 | { |
247 | title: `初始排名${rankType == 1 ? "(≥)" : "(>)"}`, | 255 | title: `初始排名${rankType == 1 ? "(≥)" : "(>)"}`, |
256 | + editable: true, | ||
248 | dataIndex: "lower", | 257 | dataIndex: "lower", |
249 | - width: "20%", | 258 | + width: "15%", |
250 | render: (value: number) => { | 259 | render: (value: number) => { |
251 | if (isPercent == 2) { | 260 | if (isPercent == 2) { |
252 | return value + "%"; | 261 | return value + "%"; |
@@ -260,9 +269,9 @@ const TotalAmount = ({ | @@ -260,9 +269,9 @@ const TotalAmount = ({ | ||
260 | }, | 269 | }, |
261 | }, | 270 | }, |
262 | { | 271 | { |
263 | - title: `结束排名${rankType == 1 ? "(<)" : "(≤)"}`, | 272 | + title: `结束排名${rankType == 1 ? "(≤)" : "(≤)"}`, |
264 | dataIndex: "upper", | 273 | dataIndex: "upper", |
265 | - width: "20%", | 274 | + width: "15%", |
266 | editable: true, | 275 | editable: true, |
267 | render: (value: number) => { | 276 | render: (value: number) => { |
268 | if (value) { | 277 | if (value) { |
@@ -285,7 +294,7 @@ const TotalAmount = ({ | @@ -285,7 +294,7 @@ const TotalAmount = ({ | ||
285 | { | 294 | { |
286 | title: "金额 (元)", | 295 | title: "金额 (元)", |
287 | dataIndex: "money", | 296 | dataIndex: "money", |
288 | - width: "20%", | 297 | + width: "10%", |
289 | editable: true, | 298 | editable: true, |
290 | render: (text: number) => (typeof text === "number" ? `${text}` : "--"), | 299 | render: (text: number) => (typeof text === "number" ? `${text}` : "--"), |
291 | }, | 300 | }, |
@@ -297,6 +306,13 @@ const TotalAmount = ({ | @@ -297,6 +306,13 @@ const TotalAmount = ({ | ||
297 | render: (text: number) => (typeof text === "number" ? `${text}` : "--"), | 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 | title: "操作", | 316 | title: "操作", |
301 | width: "40%", | 317 | width: "40%", |
302 | dataIndex: "operation", | 318 | dataIndex: "operation", |
@@ -357,16 +373,28 @@ const TotalAmount = ({ | @@ -357,16 +373,28 @@ const TotalAmount = ({ | ||
357 | children: [ | 373 | children: [ |
358 | { | 374 | { |
359 | ...col.children[0], | 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 | ...col.children[1], | 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 | }; |