Merged
Merge Request #191 · created by 曾柯


考评Bug fix


From bug_fix into master

Merged by 张志伟

2 participants
src/pages/finance/FinanceInvestor/components/Filter.tsx
... ... @@ -8,26 +8,11 @@ const { Option } = Select;
8 8 const Search = Input.Search;
9 9  
10 10 export default function AccountList() {
11   - // const { setVisible, setParams, innerParams, dealerLoading, dealerList } = useStore();
12 11 const { triggerModal, brands, financeList, setInvestList, companys, dealers } = useStore();
13   - // investList,
14   - // setInvestList,
15 12 // 存储删选条件
16 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 15 useEffect(() => {
30   - console.log("筛选参数filterParams", filterParams);
31 16 let originList = financeList;
32 17 let res = [];
33 18 if (filterParams.brandId) {
... ... @@ -41,7 +26,6 @@ export default function AccountList() {
41 26 if (filterParams.includeId) {
42 27 //删选包含商家 includeId
43 28 originList = originList.filter((item) => item.includeDealers?.find((y) => y.id === filterParams.includeId));
44   - console.log("筛选输入:", originList);
45 29 }
46 30 if (filterParams.creditDealerId) {
47 31 //删选授信商家 creditDealerId
... ...
src/pages/finance/SpecialAccount/FactoryBill/components/Filter.tsx
1 1 import React, { useCallback } from "react";
2   -import { Button, Col, Row, Select } from "antd";
  2 +import { Button, Row, Select } from "antd";
3 3 import { useStore } from "../index";
4 4  
5 5 const { Option } = Select;
... ... @@ -10,61 +10,47 @@ export default function Filter() {
10 10 const searchDealer = useCallback((dealerId) => {
11 11 setDealerId(dealerId);
12 12 }, []);
13   -
  13 +
14 14 const searchBrand = useCallback((brandId) => {
15 15 setBrandId(brandId);
16 16 }, []);
17 17  
18 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 49 </Row>
  50 +
65 51 <Button type="primary" hidden={!dealerId} onClick={() => setVisible(true)}>
66 52 新增
67 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 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 };
... ...