@bit-sun/business-component 4.2.0-alpha.3 → 4.2.0-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.fatherrc.ts +1 -1
- package/.umirc.ts +13 -9
- package/dist/components/Business/AddSelectBusiness/index.d.ts +3 -4
- package/dist/components/Business/BsLayouts/Components/AllFunc/drawContent.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/ChooseStore/index.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/leftTree.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/MenuSetting/rightTree.d.ts +2 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/DrawContent.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/globalMenu/customMenuHeader.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/CustomerMenu/index.d.ts +1 -1
- package/dist/components/Business/BsLayouts/Components/GlobalHeader/index.d.ts +1 -2
- package/dist/components/Business/BsLayouts/Components/RightContent/LoginModal.d.ts +1 -2
- package/dist/components/Business/BsLayouts/index.d.ts +1 -1
- package/dist/components/Business/BsSulaQueryTable/SearchItemSetting.d.ts +5 -5
- package/dist/components/Business/BsSulaQueryTable/index.d.ts +1 -2
- package/dist/components/Business/BsSulaQueryTable/setting.d.ts +6 -6
- package/dist/components/Business/BsSulaQueryTable/utils.d.ts +14 -15
- package/dist/components/Business/CommodityEntry/index.d.ts +1 -2
- package/dist/components/Business/CommonAlert/index.d.ts +1 -2
- package/dist/components/Business/CommonGuideWrapper/index.d.ts +3 -3
- package/dist/components/Business/DetailPageWrapper/index.d.ts +12 -12
- package/dist/components/Business/HomePageWrapper/index.d.ts +1 -2
- package/dist/components/Business/ImportExport/ExportButton/ModalTitle.d.ts +11 -0
- package/dist/components/Business/ImportExport/ExportButton/TemplatePicker.d.ts +13 -0
- package/dist/components/Business/ImportExport/ExportButton/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/ImportWizard/Preview.d.ts +11 -0
- package/dist/components/Business/ImportExport/ImportWizard/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/TaskDrawer/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/TaskProgress/index.d.ts +15 -0
- package/dist/components/Business/ImportExport/businessFunction.d.ts +15 -0
- package/dist/components/Business/ImportExport/index.d.ts +14 -0
- package/dist/components/Business/ImportExport/sceneCapability.d.ts +20 -0
- package/dist/components/Business/ImportExport/services/importExport.d.ts +22 -0
- package/dist/components/Business/ImportExport/services/routing.d.ts +8 -0
- package/dist/components/Business/ImportExport/types.d.ts +134 -0
- package/dist/components/Business/ItemPropertySelector/index.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsModifyModal.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/FieldsSettingsTable.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/Formula.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/components/MaintainOptions.d.ts +1 -2
- package/dist/components/Business/JsonQueryTable/drawer/index.d.ts +1 -2
- package/dist/components/Business/PropertyModal/index.d.ts +1 -2
- package/dist/components/Business/PropertyModal/propertyGroup.d.ts +1 -1
- package/dist/components/Business/SearchSelect/index.d.ts +1 -1
- package/dist/components/Business/StateFlow/index.d.ts +1 -2
- package/dist/components/Business/SystemLog/index.d.ts +78 -0
- package/dist/components/Business/TreeSearchSelect/index.d.ts +1 -1
- package/dist/components/Business/TrialCalculation/index.d.ts +15 -0
- package/dist/components/Business/columnSettingTable/columnSetting.d.ts +6 -6
- package/dist/components/Business/columnSettingTable/components/TableSumComponent.d.ts +1 -2
- package/dist/components/Business/columnSettingTable/index.d.ts +3 -3
- package/dist/components/Business/columnSettingTable/sulaSettingTable.d.ts +3 -3
- package/dist/components/Business/columnSettingTable/utils.d.ts +1 -2
- package/dist/components/Business/moreTreeTable/FixedScrollBar.d.ts +1 -1
- package/dist/components/Common/ParagraphCopier/index.d.ts +1 -1
- package/dist/components/Common/Section/index.d.ts +1 -1
- package/dist/components/Functional/AddSelect/index.d.ts +1 -2
- package/dist/components/Functional/AuthButton/index.d.ts +1 -2
- package/dist/components/Functional/DataImport/index.d.ts +3 -3
- package/dist/components/Functional/DataValidation/index.d.ts +5 -5
- package/dist/components/Functional/ExportFunctions/ExportIcon/index.d.ts +1 -2
- package/dist/components/Functional/QueryMutipleInput/index.d.ts +1 -2
- package/dist/components/Functional/QueryMutipleSelect/index.d.ts +1 -2
- package/dist/components/Functional/SearchSelect/index.d.ts +1 -1
- package/dist/components/Functional/SearchSelect/pagination.d.ts +22 -0
- package/dist/components/Functional/SearchSelect/utils.d.ts +2 -3
- package/dist/components/Functional/TreeSearchSelect/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/CustomSelectorModal.d.ts +1 -1
- package/dist/components/Solution/RuleComponent/CustomPlugin/CustomSelector/index.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/Formula.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/InnerSelect.d.ts +1 -2
- package/dist/components/Solution/RuleComponent/RenderCompItem.d.ts +1 -2
- package/dist/components/Solution/RuleSetter/RuleInstance.d.ts +1 -2
- package/dist/components/Solution/RuleSetter/baseRule.d.ts +1 -1
- package/dist/components/Solution/RuleSetter/index.d.ts +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +5397 -1220
- package/dist/index.js +5417 -1213
- package/dist/plugin/TableColumnSetting/index.d.ts +5 -5
- package/dist/utils/TableUtils.d.ts +18 -19
- package/dist/utils/auth.d.ts +4 -0
- package/dist/utils/utils.d.ts +41 -0
- package/docs/error-record.md +52 -0
- package/docs/flow-control-readme.md +283 -0
- package/docs/task-records/2026-07-31-import-export-extraction.md +81 -0
- package/package.json +1 -1
- package/src/components/Business/AddSelectBusiness/index.tsx +3 -2
- package/src/components/Business/BsSulaQueryTable/index.md +57 -4
- package/src/components/Business/BsSulaQueryTable/index.tsx +174 -10
- package/src/components/Business/BsSulaQueryTable/setting.tsx +6 -0
- package/src/components/Business/DetailPageWrapper/index.tsx +81 -1
- package/src/components/Business/DetailPageWrapper/readme.md +89 -0
- package/src/components/Business/ImportExport/ExportButton/ModalTitle.tsx +27 -0
- package/src/components/Business/ImportExport/ExportButton/TemplatePicker.tsx +424 -0
- package/src/components/Business/ImportExport/ExportButton/index.module.less +382 -0
- package/src/components/Business/ImportExport/ExportButton/index.tsx +273 -0
- package/src/components/Business/ImportExport/ImportWizard/Preview.tsx +129 -0
- package/src/components/Business/ImportExport/ImportWizard/index.module.less +360 -0
- package/src/components/Business/ImportExport/ImportWizard/index.tsx +679 -0
- package/src/components/Business/ImportExport/TaskDrawer/index.tsx +285 -0
- package/src/components/Business/ImportExport/TaskProgress/index.tsx +267 -0
- package/src/components/Business/ImportExport/businessFunction.ts +29 -0
- package/src/components/Business/ImportExport/index.md +104 -0
- package/src/components/Business/ImportExport/index.tsx +208 -0
- package/src/components/Business/ImportExport/sceneCapability.ts +28 -0
- package/src/components/Business/ImportExport/services/importExport.ts +208 -0
- package/src/components/Business/ImportExport/services/routing.ts +21 -0
- package/src/components/Business/ImportExport/types.ts +180 -0
- package/src/components/Business/SearchSelect/BusinessUtils.tsx +704 -48
- package/src/components/Business/SearchSelect/index.md +2 -2
- package/src/components/Business/SystemLog/index.md +37 -0
- package/src/components/Business/SystemLog/index.tsx +87 -0
- package/src/components/Business/TrialCalculation/PathDisplay.less +93 -0
- package/src/components/Business/TrialCalculation/PathDisplay_README.md +77 -0
- package/src/components/Business/TrialCalculation/index.tsx +322 -0
- package/src/components/Business/columnSettingTable/index.tsx +7 -6
- package/src/components/Business/columnSettingTable/sulaSettingTable.tsx +23 -22
- package/src/components/Functional/AddSelect/index.tsx +95 -1
- package/src/components/Functional/DataValidation/index.tsx +31 -9
- package/src/components/Functional/QueryMutipleSelect/index.tsx +2 -2
- package/src/components/Functional/SearchSelect/index.md +109 -0
- package/src/components/Functional/SearchSelect/index.tsx +99 -17
- package/src/components/Functional/SearchSelect/pagination.ts +57 -0
- package/src/components/Functional/SearchSelect/utils.tsx +28 -18
- package/src/components/Functional/TreeSearchSelect/index.tsx +2 -1
- package/src/components/Solution/RuleComponent/README.md +187 -0
- package/src/components/Solution/RuleComponent/RenderCompItem.tsx +9 -1
- package/src/components/Solution/RuleComponent/RenderCompItem_README.md +189 -0
- package/src/components/Solution/RuleComponent/RuleField.md +63 -0
- package/src/components/Solution/RuleComponent/index.js +237 -8
- package/src/components/Solution/RuleComponent/ruleFiled.js +46 -6
- package/src/components/Solution/RuleSetter/README.md +97 -0
- package/src/index.ts +9 -0
- package/src/typings/umi.d.ts +9 -0
- package/src/utils/LocalstorageUtils.ts +1 -1
- package/src/utils/auth.ts +39 -2
- package/src/utils/utils.ts +41 -1
|
@@ -150,7 +150,7 @@ export default () => {
|
|
|
150
150
|
// },
|
|
151
151
|
// prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
|
|
152
152
|
selectProps,
|
|
153
|
-
selectBusinessType: '
|
|
153
|
+
selectBusinessType: 'skuCommodity',
|
|
154
154
|
};
|
|
155
155
|
|
|
156
156
|
const onTabChange = (key) => {
|
|
@@ -317,7 +317,7 @@ export default () => {
|
|
|
317
317
|
},
|
|
318
318
|
// prefixUrl: { selectPrefix: '/bop/api', formSelectFix: '/bop/api' },
|
|
319
319
|
selectProps,
|
|
320
|
-
selectBusinessType: '
|
|
320
|
+
selectBusinessType: 'spuCommodity',
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
const onTabChange = (key) => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
nav:
|
|
3
|
+
title: '组件'
|
|
4
|
+
order: 1
|
|
5
|
+
group:
|
|
6
|
+
title: 业务组件
|
|
7
|
+
order: 1
|
|
8
|
+
title: 日志组件
|
|
9
|
+
order: 1
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# SystemLog
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 日志业务组件
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import React, { useState } from 'react';
|
|
19
|
+
import { SystemLog } from '../../../index.ts';
|
|
20
|
+
|
|
21
|
+
export default () => {
|
|
22
|
+
const [modeType, setModeType] = useState('view');
|
|
23
|
+
const renderLogRef = useRef<any>();
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
fields: [
|
|
27
|
+
SystemLog({
|
|
28
|
+
modeType,
|
|
29
|
+
code: '123',
|
|
30
|
+
containerName: 'Test_Log_Info',
|
|
31
|
+
renderLogRef,
|
|
32
|
+
extraParams: {},
|
|
33
|
+
})
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
```
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { handleCommonTimeRender } from '@/utils/TableUtils';
|
|
2
|
+
import { formContainerAndItemLayout, handleConvertResponse } from '@/utils/utils';
|
|
3
|
+
import { Table as BsTable } from 'bssula';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
//操作日志
|
|
7
|
+
const SystemLog = ({
|
|
8
|
+
modeType,
|
|
9
|
+
code,
|
|
10
|
+
containerName,
|
|
11
|
+
renderLogRef = {},
|
|
12
|
+
extraParams = {},
|
|
13
|
+
}: {
|
|
14
|
+
modeType: string,
|
|
15
|
+
code: any
|
|
16
|
+
containerName: string,
|
|
17
|
+
renderLogRef: object,
|
|
18
|
+
extraParams?: object,
|
|
19
|
+
}) => {
|
|
20
|
+
return {
|
|
21
|
+
...formContainerAndItemLayout('table', '操作日志', containerName),
|
|
22
|
+
initialVisible: modeType != 'create',
|
|
23
|
+
fields: [
|
|
24
|
+
{
|
|
25
|
+
name: 'table',
|
|
26
|
+
label: false,
|
|
27
|
+
itemLayout: {
|
|
28
|
+
span: 24,
|
|
29
|
+
labelCol: {
|
|
30
|
+
span: 0,
|
|
31
|
+
},
|
|
32
|
+
wrapperCol: {
|
|
33
|
+
span: 24,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
field: (ctx: any) => {
|
|
37
|
+
return code && <BsTable
|
|
38
|
+
remoteDataSource={{
|
|
39
|
+
url: `/oms-ops/logInfo?qp-businessCode-eq=${code}`,
|
|
40
|
+
convertParams: ({ params }: any) => {
|
|
41
|
+
return {
|
|
42
|
+
pageSize: params.pageSize,
|
|
43
|
+
currentPage: params.current,
|
|
44
|
+
...extraParams,
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
converter: ({ data }: any) => {
|
|
48
|
+
return {
|
|
49
|
+
...handleConvertResponse(data.list, data.total || data.totalCount),
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
}}
|
|
53
|
+
columns={[
|
|
54
|
+
{
|
|
55
|
+
title: '操作人',
|
|
56
|
+
dataIndex: 'handlerName',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: '操作名称',
|
|
60
|
+
dataIndex: 'handlerType',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
title: '操作时间',
|
|
64
|
+
dataIndex: 'handlerTime',
|
|
65
|
+
render: ({ text }: { text: any }) => handleCommonTimeRender(text)
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
title: '操作内容',
|
|
69
|
+
dataIndex: 'logcontent',
|
|
70
|
+
},
|
|
71
|
+
]}
|
|
72
|
+
style={{ width: '100%', marginTop: '-16px', padding: '0px' }}
|
|
73
|
+
rowKey="id"
|
|
74
|
+
scroll={{ x: 'max-content' }}
|
|
75
|
+
pagination={{
|
|
76
|
+
showTotal: (total: any) => `共 ${total} 条`,
|
|
77
|
+
showQuickJumper: true,
|
|
78
|
+
hideOnSinglePage: true,
|
|
79
|
+
}}
|
|
80
|
+
ref={renderLogRef}
|
|
81
|
+
/>
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export default SystemLog
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.wrap_pathContentBox {
|
|
2
|
+
padding: 30px;
|
|
3
|
+
border: 1px solid #eee;
|
|
4
|
+
overflow: auto;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.wrap_pathContentBoxTitle {
|
|
8
|
+
height: 20px;
|
|
9
|
+
margin-bottom: 20px
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.wrap_pathContentBox::-webkit-scrollbar {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.pathItem_content {
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pathItem_block {
|
|
22
|
+
width: 210px;
|
|
23
|
+
height: 104px;
|
|
24
|
+
padding: 10px 20px;
|
|
25
|
+
background: rgba(24, 144, 255);
|
|
26
|
+
color: #fff;
|
|
27
|
+
font-weight: bolder;
|
|
28
|
+
text-align: center;
|
|
29
|
+
border-radius: 12px;
|
|
30
|
+
box-shadow: 1px 1px 10px rgba(200,201,204,.4);
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
justify-content: center;
|
|
35
|
+
align-items: center;
|
|
36
|
+
line-height: 1.4;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.record_info {
|
|
40
|
+
text-align: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.pathItem_line {
|
|
44
|
+
margin: 0px 16px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pathItem_line_withRightArrow, .pathItem_line_withLeftArrow {
|
|
48
|
+
position: relative;
|
|
49
|
+
height: 10px; /* 根据需要调整高度 */
|
|
50
|
+
display: flex;
|
|
51
|
+
width: 130px;
|
|
52
|
+
align-items: center;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pathItem_line_withRightArrow {
|
|
56
|
+
margin-top: 10px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pathItem_line_withLeftArrow {
|
|
60
|
+
margin-bottom: 10px;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.pathItem_line_withRightArrow::before, .pathItem_line_withLeftArrow::before {
|
|
64
|
+
content: '';
|
|
65
|
+
position: absolute;
|
|
66
|
+
left: 0;
|
|
67
|
+
top: 50%;
|
|
68
|
+
transform: translateY(-50%);
|
|
69
|
+
width: 100%;
|
|
70
|
+
height: 4px; /* 直线的粗细 */
|
|
71
|
+
background-color: rgba(24, 144, 255);
|
|
72
|
+
z-index: 1;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.pathItem_line_rightArrow, .pathItem_line_leftArrow {
|
|
76
|
+
position: relative;
|
|
77
|
+
width: 0;
|
|
78
|
+
height: 0;
|
|
79
|
+
border-top: 10px solid transparent;
|
|
80
|
+
border-bottom: 10px solid transparent;
|
|
81
|
+
border-left: 10px solid rgba(24, 144, 255); /* 向右的蓝色箭头 */
|
|
82
|
+
margin-left: 94%; /* 根据需要调整间距 */
|
|
83
|
+
z-index: 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.pathItem_line_withLeftArrow {
|
|
87
|
+
margin-top: 6px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.pathItem_line_leftArrow {
|
|
91
|
+
margin-left: -2px;
|
|
92
|
+
transform: rotate(180deg);
|
|
93
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# PathDisplay 组件说明文档
|
|
2
|
+
|
|
3
|
+
`PathDisplay` 是一个用于展示跨组织结算链路的图形化组件。它主要用于“试算”场景,根据输入的单据信息,调用后端接口获取预测的结算路径,并以“节点(组织)+ 连线(单据/业务流)”的形式直观展示。
|
|
4
|
+
|
|
5
|
+
## 1. 组件引入
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import PathDisplay from '@/components/Business/TrialCalculation/PathDisplay';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 2. Props 参数说明
|
|
12
|
+
|
|
13
|
+
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `recordType` | `string` | 否 | - | 单据类型(如:1007-跨组织调拨) |
|
|
16
|
+
| `businessType` | `string` | 否 | - | 业务类型 |
|
|
17
|
+
| `sendOrgCode` | `string` | 否 | - | 发货组织/调出组织编码 |
|
|
18
|
+
| `receiverOrgCode` | `string` | 否 | - | 收货组织/调入组织编码 |
|
|
19
|
+
| `orderNo` | `string` | 否 | - | 业务单号 |
|
|
20
|
+
| `autoCallApi` | `boolean` | 否 | `true` | 是否在参数变化时自动调用接口 |
|
|
21
|
+
|
|
22
|
+
## 3. Ref 方法暴露
|
|
23
|
+
|
|
24
|
+
组件通过 `forwardRef` 暴露了以下方法,可通过 `ref` 调用:
|
|
25
|
+
|
|
26
|
+
| 方法名 | 类型 | 说明 |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `fetchData` | `() => Promise<void>` | 手动触发接口调用,重新获取链路数据 |
|
|
29
|
+
|
|
30
|
+
## 4. 使用示例
|
|
31
|
+
|
|
32
|
+
### 4.1 基本使用(自动触发)
|
|
33
|
+
|
|
34
|
+
只要传入必要的 props,组件会自动调用接口并展示结果。
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import React from 'react';
|
|
38
|
+
import PathDisplay from '@/components/Business/TrialCalculation';
|
|
39
|
+
|
|
40
|
+
const Demo = () => {
|
|
41
|
+
return (
|
|
42
|
+
<PathDisplay
|
|
43
|
+
recordType="1007"
|
|
44
|
+
businessType="1"
|
|
45
|
+
sendOrgCode="KDX0001"
|
|
46
|
+
receiverOrgCode="KD0002"
|
|
47
|
+
orderNo="DBCK25121700000014"
|
|
48
|
+
/>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default Demo;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 4.2 手动触发(配合表单查询)
|
|
56
|
+
|
|
57
|
+
如果需要点击“查询”按钮后再触发试算,可以将 `autoCallApi` 设置为 `false`,并通过 `ref` 调用 `fetchData`。
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## 5. 业务逻辑说明
|
|
63
|
+
|
|
64
|
+
### 5.1 接口请求
|
|
65
|
+
组件内部调用 `/settle/crossOrgSettlementRoute/trialCalculation` 接口。
|
|
66
|
+
* **Method**: POST
|
|
67
|
+
* **请求参数**: 取自 Props 中的 `recordType`, `businessType`, `sendOrgCode`, `receiverOrgCode`, `orderNo`。
|
|
68
|
+
|
|
69
|
+
### 5.2 页面跳转
|
|
70
|
+
组件中包含物资凭证号和结算取价单号的跳转逻辑,依赖微前端环境:
|
|
71
|
+
* **物资凭证跳转**: `/settle/end-term-management/material_asset_voucher/view/:id/:no`
|
|
72
|
+
* **取价单跳转**: `/pay/pay-management/credit-management/credit-settle/view/:id`
|
|
73
|
+
|
|
74
|
+
> 注意:跳转功能依赖 `window.$wujie.props.jump` 方法。如果在非微前端环境(无 wujie 注入)下使用,跳转点击将无效(但不会报错,有空值判断)。
|
|
75
|
+
|
|
76
|
+
### 5.3 字典依赖
|
|
77
|
+
组件展示业务类型名称时,依赖全局工具函数 `getDictionaryTextByValue` 和内置的 `getRecordBusinessType` 映射逻辑。确保项目中已加载相关数据字典(如 `BUSINESS_ORG_CLASSIFICATION` 等)。
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
|
+
import { Tooltip, message, Spin } from 'antd';
|
|
3
|
+
import request from '@/utils/request';
|
|
4
|
+
import { getDictionaryTextByValue, handleError } from '@/utils';
|
|
5
|
+
import './PathDisplay.less';
|
|
6
|
+
|
|
7
|
+
const formatPaths = (list: any) => {
|
|
8
|
+
const result = list.map((l: any, index: number) => {
|
|
9
|
+
const Item = l;
|
|
10
|
+
if (l?.nodes?.length) {
|
|
11
|
+
Item.nodes = l?.nodes.map((s: any) => ({
|
|
12
|
+
...s,
|
|
13
|
+
kCode: `${index}_${s.code}`,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
return Item;
|
|
17
|
+
});
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const getRecordBusinessType = (recordType: any) => {
|
|
22
|
+
let businessTypeDictCode = "";
|
|
23
|
+
const list = [
|
|
24
|
+
{ recordType: "502", businessTypeDictCode: "SRM00001" }, // 采购单
|
|
25
|
+
{ recordType: "503", businessTypeDictCode: "SRM00002" }, // 采购退单
|
|
26
|
+
{ recordType: "504", businessTypeDictCode: "TCbusinessType" }, // 销售单
|
|
27
|
+
{ recordType: "505", businessTypeDictCode: "TCRbusinessType" }, // 销售退单
|
|
28
|
+
{ recordType: "1001", businessTypeDictCode: "ALLOCATE00002" }, // 调拨出
|
|
29
|
+
{ recordType: "1002", businessTypeDictCode: "ALLOCATE00002" }, // 调拨入
|
|
30
|
+
{ recordType: "50", businessTypeDictCode: "SC00022" }, // 其他出入库单
|
|
31
|
+
{ recordType: "30", businessTypeDictCode: "BUSINESS_Stock_Adjus" }, // 库存调整
|
|
32
|
+
{ recordType: "130", businessTypeDictCode: "" }, // 逻辑移位单
|
|
33
|
+
{
|
|
34
|
+
recordType: "516",
|
|
35
|
+
businessTypeDictCode: "BUSINESS_ticket_sale_type",
|
|
36
|
+
}, // pos订单
|
|
37
|
+
{ recordType: "1003", businessTypeDictCode: "BUSINESS_DBCK001" }, // 跨组织调拨出库单
|
|
38
|
+
{ recordType: "1004", businessTypeDictCode: "BUSINESS_DBCK001" }, // 跨组织调拨入库单
|
|
39
|
+
{ recordType: "1007", businessTypeDictCode: "BUSINESS_DBCK" }, // 跨组织调拨
|
|
40
|
+
{ recordType: "517", businessTypeDictCode: "BUSINESS_AssReceiptType" }, // 拆装箱出
|
|
41
|
+
{ recordType: "518", businessTypeDictCode: "BUSINESS_AssReceiptType" }, // 拆装箱入
|
|
42
|
+
];
|
|
43
|
+
const match = list.find((item) => item.recordType == recordType);
|
|
44
|
+
businessTypeDictCode = match?.businessTypeDictCode || '';
|
|
45
|
+
return businessTypeDictCode;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
interface NodeItem {
|
|
49
|
+
name: string;
|
|
50
|
+
code?: string;
|
|
51
|
+
orgClassification?: string;
|
|
52
|
+
targetOrgCode?: string;
|
|
53
|
+
targetRecordName?: string;
|
|
54
|
+
targetRecordType?: string;
|
|
55
|
+
targetBusinessType?: string;
|
|
56
|
+
targetOtherLineInfo?: string;
|
|
57
|
+
targetRecordNo?: string;
|
|
58
|
+
targetOccupyType?: number;
|
|
59
|
+
targetCreditSettleNo?: string;
|
|
60
|
+
targetRecordId?: string;
|
|
61
|
+
targetCreditSettleId?: string;
|
|
62
|
+
sourceOrgCode?: string;
|
|
63
|
+
sourceRecordName?: string;
|
|
64
|
+
sourceRecordType?: string;
|
|
65
|
+
sourceBusinessType?: string;
|
|
66
|
+
sourceOtherLineInfo?: string;
|
|
67
|
+
sourceRecordNo?: string;
|
|
68
|
+
sourceOccupyType?: number;
|
|
69
|
+
sourceCreditSettleNo?: string;
|
|
70
|
+
sourceRecordId?: string;
|
|
71
|
+
sourceCreditSettleId?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface PathDisplayProps {
|
|
75
|
+
recordType?: string;
|
|
76
|
+
businessType?: string;
|
|
77
|
+
sendOrgCode?: string;
|
|
78
|
+
receiverOrgCode?: string;
|
|
79
|
+
orderNo?: string;
|
|
80
|
+
autoCallApi?: boolean;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface PathDisplayRef {
|
|
84
|
+
fetchData: () => Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const PathDisplay = React.forwardRef<PathDisplayRef, PathDisplayProps>(({
|
|
88
|
+
recordType,
|
|
89
|
+
businessType,
|
|
90
|
+
sendOrgCode,
|
|
91
|
+
receiverOrgCode,
|
|
92
|
+
orderNo,
|
|
93
|
+
autoCallApi = true
|
|
94
|
+
}, ref) => {
|
|
95
|
+
// 组件内部状态管理
|
|
96
|
+
const [pathList, setPathList] = useState<NodeItem[]>([]);
|
|
97
|
+
const [routeCode, setRouteCode] = useState<string>('');
|
|
98
|
+
const [routeCodeName, setRouteCodeName] = useState<string>('');
|
|
99
|
+
const [loading, setLoading] = useState<boolean>(false);
|
|
100
|
+
|
|
101
|
+
// 暴露方法给父组件
|
|
102
|
+
React.useImperativeHandle(ref, () => ({
|
|
103
|
+
fetchData
|
|
104
|
+
}));
|
|
105
|
+
|
|
106
|
+
const boock = (nodeItem: NodeItem) => (
|
|
107
|
+
<div className="pathItem_block">
|
|
108
|
+
<div>【{nodeItem.code}】{nodeItem.name}</div>
|
|
109
|
+
<div>组织分类:{getDictionaryTextByValue('BUSINESS_ORG_CLASSIFICATION', nodeItem.orgClassification || '')}</div>
|
|
110
|
+
</div>
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// 调用接口获取数据
|
|
114
|
+
const fetchData = async () => {
|
|
115
|
+
// 检查必要参数
|
|
116
|
+
if (!recordType || !sendOrgCode || !receiverOrgCode) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
setLoading(true);
|
|
121
|
+
try {
|
|
122
|
+
const params = {
|
|
123
|
+
recordType,
|
|
124
|
+
businessType,
|
|
125
|
+
sendOrgCode,
|
|
126
|
+
receiverOrgCode,
|
|
127
|
+
orderNo,
|
|
128
|
+
};
|
|
129
|
+
console.log('params', params);
|
|
130
|
+
let res = await request({
|
|
131
|
+
url: `/settle/crossOrgSettlementRoute/trialCalculation`,
|
|
132
|
+
method: 'POST',
|
|
133
|
+
data: params,
|
|
134
|
+
});
|
|
135
|
+
debugger
|
|
136
|
+
if (handleError(res.data)) {
|
|
137
|
+
res = res.data;
|
|
138
|
+
if (res.data?.match) {
|
|
139
|
+
setRouteCodeName(res?.data?.routeCodeName || '');
|
|
140
|
+
setRouteCode(res?.data?.routeCode || '');
|
|
141
|
+
|
|
142
|
+
const pList = res?.data?.fontDetails || [];
|
|
143
|
+
const formattedPaths = formatPaths(pList);
|
|
144
|
+
setPathList(formattedPaths);
|
|
145
|
+
} else {
|
|
146
|
+
// 清空历史结果
|
|
147
|
+
setRouteCodeName('');
|
|
148
|
+
setRouteCode('');
|
|
149
|
+
setPathList([]);
|
|
150
|
+
message.warning('匹配不到跨组织链路');
|
|
151
|
+
}
|
|
152
|
+
} else {
|
|
153
|
+
// 清空历史结果
|
|
154
|
+
setRouteCodeName('');
|
|
155
|
+
setRouteCode('');
|
|
156
|
+
setPathList([]);
|
|
157
|
+
message.error('获取数据失败');
|
|
158
|
+
}
|
|
159
|
+
} catch (error) {
|
|
160
|
+
console.error('调用接口失败:', error);
|
|
161
|
+
setRouteCodeName('');
|
|
162
|
+
setRouteCode('');
|
|
163
|
+
setPathList([]);
|
|
164
|
+
message.error('调用接口失败');
|
|
165
|
+
} finally {
|
|
166
|
+
setLoading(false);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
// 监听props变化,自动调用接口
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if (autoCallApi) {
|
|
173
|
+
fetchData();
|
|
174
|
+
}
|
|
175
|
+
}, [recordType, businessType, sendOrgCode, receiverOrgCode, orderNo, autoCallApi]);
|
|
176
|
+
|
|
177
|
+
const line = (nodeItem: NodeItem) => {
|
|
178
|
+
// 物资凭证跳转处理
|
|
179
|
+
const handleMaterialAssetVoucherJump = (recordId: string, recordNo: string) => {
|
|
180
|
+
if ((window as any).$wujie?.props.jump) {
|
|
181
|
+
(window as any).$wujie.props.jump({
|
|
182
|
+
pathname: `/settle/end-term-management/material_asset_voucher/view/${recordId}/${recordNo}`,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
// 取价单跳转处理
|
|
188
|
+
const handleCreditSettleJump = (creditSettleId: string) => {
|
|
189
|
+
if ((window as any).$wujie?.props.jump) {
|
|
190
|
+
(window as any).$wujie.props.jump({
|
|
191
|
+
pathname: `/pay/pay-management/credit-management/credit-settle/view/${creditSettleId}`,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
return (
|
|
197
|
+
<div className="pathItem_line">
|
|
198
|
+
{nodeItem.targetOrgCode && (
|
|
199
|
+
<>
|
|
200
|
+
<Tooltip
|
|
201
|
+
title={
|
|
202
|
+
<div style={{ fontSize: '12px', lineHeight: '1.5' }}>
|
|
203
|
+
<div>结算单据:{nodeItem.targetRecordName}</div>
|
|
204
|
+
<div>业务类型:{getDictionaryTextByValue(getRecordBusinessType(nodeItem.targetRecordType || ''), nodeItem.targetBusinessType || '')}</div>
|
|
205
|
+
<div>价格来源:{nodeItem.targetOtherLineInfo}</div>
|
|
206
|
+
<div>物资凭证:{nodeItem.targetRecordNo || ' '}</div>
|
|
207
|
+
<div>{nodeItem.targetOccupyType === 1 ? '信贷占用单' : '结算取价单' }:{nodeItem.targetCreditSettleNo || ' '}</div>
|
|
208
|
+
</div>
|
|
209
|
+
}
|
|
210
|
+
placement="top"
|
|
211
|
+
>
|
|
212
|
+
<div className="record_info">
|
|
213
|
+
<div style={{ fontSize: '12px', lineHeight: '1.5' }}>
|
|
214
|
+
<div>{nodeItem.targetRecordName}</div>
|
|
215
|
+
<div>{getDictionaryTextByValue(getRecordBusinessType(nodeItem.targetRecordType || ''), nodeItem.targetBusinessType || '')}</div>
|
|
216
|
+
<div>{nodeItem.targetOtherLineInfo}</div>
|
|
217
|
+
<div>
|
|
218
|
+
{nodeItem.targetRecordId && nodeItem.targetRecordNo ? (
|
|
219
|
+
<span
|
|
220
|
+
style={{ cursor: 'pointer', color: '#1890ff', textDecoration: 'underline' }}
|
|
221
|
+
onClick={() => handleMaterialAssetVoucherJump(nodeItem.targetRecordId || '', nodeItem.targetRecordNo || '')}
|
|
222
|
+
>
|
|
223
|
+
{nodeItem.targetRecordNo}
|
|
224
|
+
</span>
|
|
225
|
+
) : (
|
|
226
|
+
nodeItem.targetRecordNo
|
|
227
|
+
)}
|
|
228
|
+
</div>
|
|
229
|
+
<div>
|
|
230
|
+
{nodeItem.targetCreditSettleId ? (
|
|
231
|
+
<span
|
|
232
|
+
style={{ cursor: 'pointer', color: '#1890ff', textDecoration: 'underline' }}
|
|
233
|
+
onClick={() => handleCreditSettleJump(nodeItem.targetCreditSettleId || '')}
|
|
234
|
+
>
|
|
235
|
+
{nodeItem.targetCreditSettleNo}
|
|
236
|
+
</span>
|
|
237
|
+
) : (
|
|
238
|
+
nodeItem.targetCreditSettleNo
|
|
239
|
+
)}
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
</Tooltip>
|
|
244
|
+
<div className="pathItem_line_withRightArrow">
|
|
245
|
+
<div className="pathItem_line_rightArrow"></div>
|
|
246
|
+
</div>
|
|
247
|
+
</>
|
|
248
|
+
) || null}
|
|
249
|
+
{nodeItem.sourceOrgCode && (
|
|
250
|
+
<>
|
|
251
|
+
<div className="pathItem_line_withLeftArrow">
|
|
252
|
+
<div className="pathItem_line_leftArrow"></div>
|
|
253
|
+
</div>
|
|
254
|
+
<Tooltip
|
|
255
|
+
title={
|
|
256
|
+
<div style={{ fontSize: '12px', lineHeight: '1.5' }}>
|
|
257
|
+
<div>结算单据:{nodeItem.sourceRecordName}</div>
|
|
258
|
+
<div>业务类型:{getDictionaryTextByValue(getRecordBusinessType(nodeItem.sourceRecordType || ''), nodeItem.sourceBusinessType || '')}</div>
|
|
259
|
+
<div>价格来源:{nodeItem.sourceOtherLineInfo}</div>
|
|
260
|
+
<div>物资凭证:{nodeItem.sourceRecordNo || ' '}</div>
|
|
261
|
+
<div>{nodeItem.sourceOccupyType === 1 ? '信贷占用单' : '结算取价单' }:{nodeItem.sourceCreditSettleNo || ' '}</div>
|
|
262
|
+
</div>
|
|
263
|
+
}
|
|
264
|
+
placement="top"
|
|
265
|
+
>
|
|
266
|
+
<div className="record_info">
|
|
267
|
+
<div style={{ fontSize: '12px', lineHeight: '1.5' }}>
|
|
268
|
+
<div>{nodeItem.sourceRecordName}</div>
|
|
269
|
+
<div>{getDictionaryTextByValue(getRecordBusinessType(nodeItem.sourceRecordType || ''), nodeItem.sourceBusinessType || '')}</div>
|
|
270
|
+
<div>{nodeItem.sourceOtherLineInfo}</div>
|
|
271
|
+
<div>
|
|
272
|
+
{nodeItem.sourceRecordId && nodeItem.sourceRecordNo ? (
|
|
273
|
+
<span
|
|
274
|
+
style={{ cursor: 'pointer', color: '#1890ff', textDecoration: 'underline' }}
|
|
275
|
+
onClick={() => handleMaterialAssetVoucherJump(nodeItem.sourceRecordId || '', nodeItem.sourceRecordNo || '')}
|
|
276
|
+
>
|
|
277
|
+
{nodeItem.sourceRecordNo || ' '}
|
|
278
|
+
</span>
|
|
279
|
+
) : (
|
|
280
|
+
nodeItem.sourceRecordNo || ' '
|
|
281
|
+
)}
|
|
282
|
+
</div>
|
|
283
|
+
<div>
|
|
284
|
+
{nodeItem.sourceCreditSettleId ? (
|
|
285
|
+
<span
|
|
286
|
+
style={{ cursor: 'pointer', color: '#1890ff', textDecoration: 'underline' }}
|
|
287
|
+
onClick={() => handleCreditSettleJump(nodeItem.sourceCreditSettleId || '')}
|
|
288
|
+
>
|
|
289
|
+
{nodeItem.sourceCreditSettleNo || ' '}
|
|
290
|
+
</span>
|
|
291
|
+
) : (
|
|
292
|
+
nodeItem.sourceCreditSettleNo || ' '
|
|
293
|
+
)}
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
</div>
|
|
297
|
+
</Tooltip>
|
|
298
|
+
</>
|
|
299
|
+
) || null}
|
|
300
|
+
</div>
|
|
301
|
+
);
|
|
302
|
+
};
|
|
303
|
+
|
|
304
|
+
return (
|
|
305
|
+
<div className="wrap_pathContentBox">
|
|
306
|
+
<Spin spinning={loading} tip="加载中...">
|
|
307
|
+
{routeCode && <div className="wrap_pathContentBoxTitle">跨组织链路名称:【{routeCode}】{routeCodeName}</div> }
|
|
308
|
+
|
|
309
|
+
<div className="pathItem_content">
|
|
310
|
+
{pathList.map((nodeItem, index) => (
|
|
311
|
+
<React.Fragment key={`node_${index}`}>
|
|
312
|
+
{boock(nodeItem)}
|
|
313
|
+
{line(nodeItem)}
|
|
314
|
+
</React.Fragment>
|
|
315
|
+
))}
|
|
316
|
+
</div>
|
|
317
|
+
</Spin>
|
|
318
|
+
</div>
|
|
319
|
+
);
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
export default PathDisplay;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import React, { useState } from 'react';
|
|
2
3
|
import { Table, Tooltip, Typography } from 'antd';
|
|
3
4
|
import { Resizable } from 'react-resizable';
|
|
@@ -81,9 +82,9 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
81
82
|
|
|
82
83
|
/**
|
|
83
84
|
* 新增函数,用于根据传入的小数位数进行四舍五入
|
|
84
|
-
* @param number
|
|
85
|
-
* @param decimalPlaces
|
|
86
|
-
* @returns
|
|
85
|
+
* @param number
|
|
86
|
+
* @param decimalPlaces
|
|
87
|
+
* @returns
|
|
87
88
|
*/
|
|
88
89
|
roundToDecimalPlaces = (number: any, decimalPlaces: number) => {
|
|
89
90
|
const factor = Math.pow(10, (decimalPlaces || 2));
|
|
@@ -92,7 +93,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
95
|
* 合计行逻辑
|
|
95
|
-
* @returns
|
|
96
|
+
* @returns
|
|
96
97
|
*/
|
|
97
98
|
getTableSummaryInfo = () => {
|
|
98
99
|
const { summary = undefined, rowSelection, expandable, modeType, dataSource, isSpecial = false, }: any = this.props;
|
|
@@ -232,7 +233,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
232
233
|
|
|
233
234
|
/**
|
|
234
235
|
* 处理行点击事件
|
|
235
|
-
* @param record
|
|
236
|
+
* @param record
|
|
236
237
|
*/
|
|
237
238
|
handleRowClick = (record: any) => {
|
|
238
239
|
const { selectedRowKeys, selectedRows, } = this.state;
|
|
@@ -316,7 +317,7 @@ export default class ColumnSettingTable extends React.Component {
|
|
|
316
317
|
...propRowSelection,
|
|
317
318
|
selectedRowKeys: this.state.selectedRowKeys,
|
|
318
319
|
onChange: (selectedRowKeys: any, selectedRows: any) => {
|
|
319
|
-
this.setState({
|
|
320
|
+
this.setState({
|
|
320
321
|
selectedRowKeys,
|
|
321
322
|
selectedRows
|
|
322
323
|
});
|