@kmkf-fe-packages/kmkf-work-order-service-component 1.19.4 → 1.19.7
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/dist/esm/FlowTemplateDetailV2/components/FormRender/common.d.ts +4 -10
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/common.js +7 -135
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +54 -67
- package/dist/esm/common/utils/constant.d.ts +2 -0
- package/dist/esm/common/utils/constant.js +50 -0
- package/dist/esm/common/utils/tools.d.ts +2 -0
- package/dist/esm/common/utils/tools.js +133 -581
- package/dist/esm/common/utils/transformWorkOrderData.d.ts +2 -0
- package/dist/esm/common/utils/transformWorkOrderData.js +786 -0
- package/dist/esm/model/customizeWorkOrder/selector.d.ts +18 -0
- package/dist/esm/model/logicFlow/selector.d.ts +3 -0
- package/dist/esm/model/paymentWorkOrder/selector.d.ts +9 -0
- package/dist/esm/model/servers/api.d.ts +1 -0
- package/dist/esm/model/servers/api.js +9 -0
- package/dist/esm/model/singleShopWorkOrder/selector.d.ts +5 -0
- package/package.json +5 -5
|
@@ -16,13 +16,7 @@ export declare const getCurrentNodeModifiedShowHideRule: (list: {
|
|
|
16
16
|
}>;
|
|
17
17
|
displayComponentList: Array<string>;
|
|
18
18
|
}[];
|
|
19
|
-
export declare const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
componentConfig: any;
|
|
24
|
-
workOrderComponentType: string;
|
|
25
|
-
}>;
|
|
26
|
-
allValues: any;
|
|
27
|
-
componentShowMap: any;
|
|
28
|
-
}) => any;
|
|
19
|
+
export declare const findComponentUniqueKeyByType: (componentDtoList: {
|
|
20
|
+
workOrderComponentType: string;
|
|
21
|
+
uniqueKey: string;
|
|
22
|
+
}[], workOrderComponentType: string) => string | undefined;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
3
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -11,8 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
11
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
11
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
13
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
import {
|
|
15
|
-
import { cloneDeep, get } from 'lodash';
|
|
13
|
+
import { cloneDeep } from 'lodash';
|
|
16
14
|
// 针对前置组件按照节点id分组
|
|
17
15
|
export var groupByPreNode = function groupByPreNode(list) {
|
|
18
16
|
var map = new Map();
|
|
@@ -66,137 +64,11 @@ export var getCurrentNodeModifiedShowHideRule = function getCurrentNodeModifiedS
|
|
|
66
64
|
}
|
|
67
65
|
return [];
|
|
68
66
|
};
|
|
69
|
-
var isValidNumber = function isValidNumber(value) {
|
|
70
|
-
// 使用 isNaN 函数来检查值是否为数字
|
|
71
|
-
return !isNaN(value) && isFinite(value);
|
|
72
|
-
};
|
|
73
|
-
var parseExpression = function parseExpression(expression) {
|
|
74
|
-
// 使用正则表达式替换匹配的'+-'为'+0-'
|
|
75
|
-
expression = expression.replace(/\+\-/g, '+0-');
|
|
76
|
-
// 如果遇到-号前面没有数字,自动补0
|
|
77
|
-
expression = expression.replace(/(^|[-+*/(])\s*-\s*(?=\d)/g, '$10-');
|
|
78
|
-
var tokens = expression.match(/\d+\.\d+|\d+|[-+*/()]/g);
|
|
79
|
-
if (!tokens) {
|
|
80
|
-
throw new Error('表达式不合法');
|
|
81
|
-
}
|
|
82
|
-
var precedence = {
|
|
83
|
-
'+': 1,
|
|
84
|
-
'-': 1,
|
|
85
|
-
'*': 2,
|
|
86
|
-
'/': 2
|
|
87
|
-
};
|
|
88
|
-
function applyOperator(operators, values) {
|
|
89
|
-
var operator = operators.pop();
|
|
90
|
-
var b = values.pop();
|
|
91
|
-
var a = values.pop();
|
|
92
|
-
switch (operator) {
|
|
93
|
-
case '+':
|
|
94
|
-
values.push(a + b);
|
|
95
|
-
break;
|
|
96
|
-
case '-':
|
|
97
|
-
values.push(a - b);
|
|
98
|
-
break;
|
|
99
|
-
case '*':
|
|
100
|
-
values.push(a * b);
|
|
101
|
-
break;
|
|
102
|
-
case '/':
|
|
103
|
-
if (b === 0) {
|
|
104
|
-
throw new Error('除数不能为零');
|
|
105
|
-
}
|
|
106
|
-
values.push(a / b);
|
|
107
|
-
break;
|
|
108
|
-
default:
|
|
109
|
-
throw new Error('不支持的操作符');
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
var operators = [];
|
|
113
|
-
var values = [];
|
|
114
|
-
var _iterator = _createForOfIteratorHelper(tokens),
|
|
115
|
-
_step;
|
|
116
|
-
try {
|
|
117
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
118
|
-
var token = _step.value;
|
|
119
|
-
if (/\d/.test(token)) {
|
|
120
|
-
values.push(parseFloat(token));
|
|
121
|
-
} else if ('+-*/'.includes(token)) {
|
|
122
|
-
var currentPrecedence = precedence[token];
|
|
123
|
-
while (operators.length && precedence[operators[operators.length - 1]] >= currentPrecedence) {
|
|
124
|
-
applyOperator(operators, values);
|
|
125
|
-
}
|
|
126
|
-
operators.push(token);
|
|
127
|
-
} else if (token === '(') {
|
|
128
|
-
operators.push(token);
|
|
129
|
-
} else if (token === ')') {
|
|
130
|
-
while (operators.length && operators[operators.length - 1] !== '(') {
|
|
131
|
-
applyOperator(operators, values);
|
|
132
|
-
}
|
|
133
|
-
if (operators.length === 0) {
|
|
134
|
-
throw new Error('括号不匹配');
|
|
135
|
-
}
|
|
136
|
-
operators.pop(); // 弹出左括号
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
} catch (err) {
|
|
140
|
-
_iterator.e(err);
|
|
141
|
-
} finally {
|
|
142
|
-
_iterator.f();
|
|
143
|
-
}
|
|
144
|
-
while (operators.length > 0) {
|
|
145
|
-
if ('()'.includes(operators[operators.length - 1])) {
|
|
146
|
-
throw new Error('括号不匹配');
|
|
147
|
-
}
|
|
148
|
-
applyOperator(operators, values);
|
|
149
|
-
}
|
|
150
|
-
if (values.length !== 1 || operators.length !== 0) {
|
|
151
|
-
throw new Error('表达式不合法');
|
|
152
|
-
}
|
|
153
|
-
return values[0];
|
|
154
|
-
};
|
|
155
67
|
|
|
156
|
-
//
|
|
157
|
-
export var
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var componentInstance = factory(nxt.workOrderComponentType, {
|
|
163
|
-
id: nxt.uniqueKey,
|
|
164
|
-
name: nxt.name,
|
|
165
|
-
componentConfig: (nxt === null || nxt === void 0 ? void 0 : nxt.componentConfig) || {},
|
|
166
|
-
effects: {},
|
|
167
|
-
type: nxt.workOrderComponentType
|
|
168
|
-
});
|
|
169
|
-
if (componentInstance) {
|
|
170
|
-
var _nxt$componentConfig, _nxt$componentConfig$, _nxt$componentConfig$2;
|
|
171
|
-
var express = nxt === null || nxt === void 0 ? void 0 : (_nxt$componentConfig = nxt.componentConfig) === null || _nxt$componentConfig === void 0 ? void 0 : (_nxt$componentConfig$ = _nxt$componentConfig.config) === null || _nxt$componentConfig$ === void 0 ? void 0 : (_nxt$componentConfig$2 = _nxt$componentConfig$.calcList) === null || _nxt$componentConfig$2 === void 0 ? void 0 : _nxt$componentConfig$2.reduce(function (cur, nxt) {
|
|
172
|
-
if ((nxt === null || nxt === void 0 ? void 0 : nxt.type) === 'value') {
|
|
173
|
-
var innerComponentInstance = factory(nxt.componentType, {
|
|
174
|
-
id: nxt.value,
|
|
175
|
-
name: nxt.label,
|
|
176
|
-
componentConfig: {},
|
|
177
|
-
effects: {},
|
|
178
|
-
type: nxt.componentType
|
|
179
|
-
});
|
|
180
|
-
// 如果当前计算组件是隐藏的时候,直接返回0
|
|
181
|
-
if (!componentShowMap[innerComponentInstance === null || innerComponentInstance === void 0 ? void 0 : innerComponentInstance.id]) return "".concat(cur, "0");
|
|
182
|
-
return "".concat(cur).concat(Number(get(allValues, innerComponentInstance === null || innerComponentInstance === void 0 ? void 0 : innerComponentInstance.id, 0)));
|
|
183
|
-
}
|
|
184
|
-
return "".concat(cur).concat(nxt === null || nxt === void 0 ? void 0 : nxt.label);
|
|
185
|
-
}, '');
|
|
186
|
-
var value = 0;
|
|
187
|
-
try {
|
|
188
|
-
var _value;
|
|
189
|
-
// 使用 eval 函数计算表达式,如果抛出异常则表示表达式不合法
|
|
190
|
-
value = parseExpression(express);
|
|
191
|
-
//TODO: 针对0.1+0.2的问题,这里对浮点类型的小数截取小数点后2位
|
|
192
|
-
value = parseFloat((_value = value) === null || _value === void 0 ? void 0 : _value.toFixed(2));
|
|
193
|
-
console.debug('计算组件计算结果', value, express);
|
|
194
|
-
} catch (error) {
|
|
195
|
-
console.error('计算组件计算异常', express);
|
|
196
|
-
value = 0;
|
|
197
|
-
}
|
|
198
|
-
cur[componentInstance.id] = isValidNumber(value) ? value : 0;
|
|
199
|
-
}
|
|
200
|
-
return cur;
|
|
201
|
-
}, {});
|
|
68
|
+
// 根据组件类型获取组件的UniqueKey
|
|
69
|
+
export var findComponentUniqueKeyByType = function findComponentUniqueKeyByType(componentDtoList, workOrderComponentType) {
|
|
70
|
+
var _componentDtoList$fin;
|
|
71
|
+
return (_componentDtoList$fin = componentDtoList.find(function (item) {
|
|
72
|
+
return item.workOrderComponentType === workOrderComponentType;
|
|
73
|
+
})) === null || _componentDtoList$fin === void 0 ? void 0 : _componentDtoList$fin.uniqueKey;
|
|
202
74
|
};
|
|
@@ -29,24 +29,17 @@ import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, grou
|
|
|
29
29
|
import 'moment/locale/zh-cn';
|
|
30
30
|
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
|
|
31
31
|
// 重复检验不需要展示在顶部的
|
|
32
|
-
INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, getMappingTargetValue } from "../../../common/utils/tools";
|
|
32
|
+
INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, bsE3SystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, getMappingTargetValue } from "../../../common/utils/tools";
|
|
33
33
|
import { replaceCheck, orderDetail, queryLabelByTradeId } from "../../../model/servers/api";
|
|
34
34
|
import { factory } from '@kmkf-fe-packages/services-components';
|
|
35
35
|
import { getExpression, formatDisplayConfig, isNull, LabelData } from '@kmkf-fe-packages/kmkf-utils';
|
|
36
36
|
import ShopName from "../ShopName";
|
|
37
37
|
import { PlatForm } from "../../../model/flowTemplateDetail/types";
|
|
38
|
-
import { groupByPreNode, getCurrentNodeModifiedShowHideRule } from "./common";
|
|
38
|
+
import { groupByPreNode, getCurrentNodeModifiedShowHideRule, findComponentUniqueKeyByType } from "./common";
|
|
39
39
|
import { getCalculationComponentValue } from "../../../common/utils/arithmetic";
|
|
40
40
|
import "./index.less";
|
|
41
41
|
import { CHILD_FIELD_TYPE, CHILD_FIELD_VALUE } from "../../../common/constant";
|
|
42
42
|
import { jsonParseSecurity } from "../../../common/utils/tools";
|
|
43
|
-
var hasComponent = function hasComponent(componentDtoList, workOrderComponentType) {
|
|
44
|
-
var _componentDtoList$fin;
|
|
45
|
-
return (_componentDtoList$fin = componentDtoList.find(function (item) {
|
|
46
|
-
return item.workOrderComponentType === workOrderComponentType;
|
|
47
|
-
})) === null || _componentDtoList$fin === void 0 ? void 0 : _componentDtoList$fin.uniqueKey;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
43
|
// 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
|
|
51
44
|
// TODO: 用useState会有bug, 不确定是哪里导致的
|
|
52
45
|
var hideByXYComponentsMap = {};
|
|
@@ -79,7 +72,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
79
72
|
isErpUse = _props$isErpUse === void 0 ? false : _props$isErpUse,
|
|
80
73
|
_props$autoSubmit = props.autoSubmit,
|
|
81
74
|
autoSubmit = _props$autoSubmit === void 0 ? false : _props$autoSubmit;
|
|
82
|
-
var
|
|
75
|
+
var shopIdToUniqueKeyMap = useMemo(function () {
|
|
83
76
|
var json = {};
|
|
84
77
|
shopList.forEach(function (shop) {
|
|
85
78
|
json[shop.shopId] = shop.uniqueKey;
|
|
@@ -89,23 +82,18 @@ var FormRender = function FormRender(props, ref) {
|
|
|
89
82
|
var mappingConfig = useMemo(function () {
|
|
90
83
|
return getMappingConfigByTemplateDetail(templateDetail);
|
|
91
84
|
}, [templateDetail]);
|
|
92
|
-
var
|
|
85
|
+
var activeLogisticsComponents = useMemo(function () {
|
|
93
86
|
return templateDetail.componentDtoList.filter(function (item) {
|
|
94
87
|
var _item$componentConfig;
|
|
95
88
|
return ['LOGISTICS_TRAJECTORY_MORE', 'LOGISTICS_INTERCEPTION_MORE'].includes(item.workOrderComponentType) && ((_item$componentConfig = item.componentConfig) === null || _item$componentConfig === void 0 ? void 0 : _item$componentConfig.isOpen);
|
|
96
89
|
});
|
|
97
90
|
}, [templateDetail]);
|
|
98
|
-
var
|
|
91
|
+
var finallyMappingHideComponents = useRef(mappingConfig.hideComponents);
|
|
99
92
|
var replaceValueRef = useRef();
|
|
100
93
|
var _useState = useState(mappingConfig.hideComponents),
|
|
101
94
|
_useState2 = _slicedToArray(_useState, 2),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
// // 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
|
|
105
|
-
// const [hideByXYComponents, setHideByXYComponents] = useState<string[]>([])
|
|
106
|
-
|
|
107
|
-
// console.log('************* mappingConfig **************', { mappingConfig, mappdingHideComponents, templateDetail })
|
|
108
|
-
|
|
95
|
+
mappingHideComponents = _useState2[0],
|
|
96
|
+
setMappingHideComponents = _useState2[1];
|
|
109
97
|
var orderNo = plat.orderNo,
|
|
110
98
|
buyerId = plat.buyerId,
|
|
111
99
|
buyerNick = plat.buyerNick,
|
|
@@ -374,7 +362,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
374
362
|
batchFillByMapping(initialValues);
|
|
375
363
|
orderBackReplace(transData, templateDetail);
|
|
376
364
|
// TODO: 非开始节点录入,都会有workOrderId,这里判断是否有前置组件含有订单号;如果存在订单号,进行订单反填。
|
|
377
|
-
var tradeIdUniqueKey =
|
|
365
|
+
var tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'TRADE_ID_INPUT');
|
|
378
366
|
if (tradeIdUniqueKey && shopId && record !== null && record !== void 0 && (_record$jsonMap2 = record.jsonMap) !== null && _record$jsonMap2 !== void 0 && _record$jsonMap2["".concat(tradeIdUniqueKey, "_tradeId")] && firstOrderBackfill) {
|
|
379
367
|
var _record$jsonMap3, _record$jsonMap4;
|
|
380
368
|
orderBack({
|
|
@@ -459,7 +447,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
459
447
|
}
|
|
460
448
|
var antFormEl = document.getElementsByClassName('ant-form');
|
|
461
449
|
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
|
462
|
-
|
|
450
|
+
resetMappingHideComponents();
|
|
463
451
|
};
|
|
464
452
|
useEffect(function () {
|
|
465
453
|
if (isErpUse) return;
|
|
@@ -475,20 +463,20 @@ var FormRender = function FormRender(props, ref) {
|
|
|
475
463
|
}, [workOrderId, record, shopId, isErpUse]);
|
|
476
464
|
|
|
477
465
|
// 重置映射隐藏的组件, 目前只有单选、下拉组件可能会因为映射关系隐藏
|
|
478
|
-
var
|
|
466
|
+
var resetMappingHideComponents = function resetMappingHideComponents() {
|
|
479
467
|
var hideComponents = mappingConfig.hideComponents.filter(function (key) {
|
|
480
468
|
var value = form.getFieldValue(key);
|
|
481
469
|
return _typeof(value) === 'object' ? !value.value : !value;
|
|
482
470
|
});
|
|
483
|
-
if (!
|
|
484
|
-
|
|
471
|
+
if (!finallyMappingHideComponents.current) {
|
|
472
|
+
finallyMappingHideComponents.current = mappingConfig.hideComponents;
|
|
485
473
|
}
|
|
486
|
-
var noChange = hideComponents.length ===
|
|
487
|
-
return
|
|
474
|
+
var noChange = hideComponents.length === finallyMappingHideComponents.current.length && hideComponents.every(function (k) {
|
|
475
|
+
return finallyMappingHideComponents.current.includes(k);
|
|
488
476
|
});
|
|
489
477
|
if (!noChange) {
|
|
490
|
-
|
|
491
|
-
|
|
478
|
+
finallyMappingHideComponents.current = _toConsumableArray(hideComponents);
|
|
479
|
+
setMappingHideComponents(hideComponents);
|
|
492
480
|
}
|
|
493
481
|
};
|
|
494
482
|
|
|
@@ -496,7 +484,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
496
484
|
var fillByShopId = function fillByShopId(shopId) {
|
|
497
485
|
// PS: 增加setTimeout 为了让后续的items渲染,然后触发对应的映射
|
|
498
486
|
setTimeout(function () {
|
|
499
|
-
var shopUniqueKey = shopId ?
|
|
487
|
+
var shopUniqueKey = shopId ? shopIdToUniqueKeyMap[shopId] : '';
|
|
500
488
|
shopUniqueKey && fillByMapping('SHOP_SELECT_MAPPING', shopUniqueKey);
|
|
501
489
|
}, 0);
|
|
502
490
|
};
|
|
@@ -528,7 +516,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
528
516
|
}
|
|
529
517
|
form.resetFields(_toConsumableArray(resetSet));
|
|
530
518
|
}
|
|
531
|
-
|
|
519
|
+
resetMappingHideComponents();
|
|
532
520
|
};
|
|
533
521
|
var checkFillMapping = function checkFillMapping(show, uniqueKey, workOrderComponentType) {
|
|
534
522
|
if (['RADIO', 'SELECT'].includes(workOrderComponentType)) {
|
|
@@ -538,7 +526,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
538
526
|
}
|
|
539
527
|
if (!show && !hideByXYComponentsMap[_formUniqueKey].includes(uniqueKey)) {
|
|
540
528
|
hideByXYComponentsMap[_formUniqueKey] = [uniqueKey].concat(_toConsumableArray(hideByXYComponentsMap[_formUniqueKey]));
|
|
541
|
-
// setHideByXYComponents([uniqueKey, ...hideByXYComponents])
|
|
542
529
|
fillByMapping(uniqueKey, '');
|
|
543
530
|
}
|
|
544
531
|
if (show && hideByXYComponentsMap[_formUniqueKey].includes(uniqueKey)) {
|
|
@@ -547,7 +534,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
547
534
|
return k !== uniqueKey;
|
|
548
535
|
});
|
|
549
536
|
hideByXYComponentsMap[_formUniqueKey] = newHideByXYComponents;
|
|
550
|
-
// setHideByXYComponents(newHideByXYComponents)
|
|
551
537
|
fillByMapping(uniqueKey, (_form$getFieldValue = form.getFieldValue(uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.value);
|
|
552
538
|
}
|
|
553
539
|
}
|
|
@@ -648,9 +634,16 @@ var FormRender = function FormRender(props, ref) {
|
|
|
648
634
|
form: form
|
|
649
635
|
});
|
|
650
636
|
}
|
|
651
|
-
if (
|
|
637
|
+
if (workOrderComponentType === 'BS_E3_SYSTEM_ORDER') {
|
|
638
|
+
bsE3SystemOrderBackValues({
|
|
639
|
+
templateList: templateDetail,
|
|
640
|
+
value: value,
|
|
641
|
+
form: form
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
if (activeLogisticsComponents && ['INPUT', 'EXPRESS_LOGISTICS_SELECT', 'BS_LOGISTICS'].includes(workOrderComponentType)) {
|
|
652
645
|
setLogisticsInfo({
|
|
653
|
-
logisticsMappingConfig:
|
|
646
|
+
logisticsMappingConfig: activeLogisticsComponents,
|
|
654
647
|
uniqueKey: uniqueKey,
|
|
655
648
|
workOrderComponentType: workOrderComponentType,
|
|
656
649
|
value: value,
|
|
@@ -702,7 +695,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
702
695
|
setShopId(val);
|
|
703
696
|
// 清空表单字段
|
|
704
697
|
var needClearFormFields = get(templateDetail, 'componentDtoList', []).reduce(function (cur, nxt) {
|
|
705
|
-
if (['ITEM_SELECT_THIRD', 'STATUS', 'ITEM_SELECT', 'ITEM_ID', 'ITEM_ENCODE', 'JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD', 'BS_GOODS', 'BS_EXCHANGE_GOODS', 'BS_REISSUE_GOODS', 'BS_RETURN_GOODS', 'BS_LOGISTICS', 'BS_SEND_GOOD', 'BS_SYSTEM_ORDER', 'WLN_SYSTEM_ORDER', 'WLN_GOODS', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WDT_SYSTEM_ORDER', 'WDT_REISSUE_GOODS', 'WDT_RETURN_GOODS', 'WDT_EXCHANGE_GOODS', 'KM_SEND_GOOD'].includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
|
|
698
|
+
if (['ITEM_SELECT_THIRD', 'STATUS', 'ITEM_SELECT', 'ITEM_ID', 'ITEM_ENCODE', 'JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD', 'BS_GOODS', 'BS_EXCHANGE_GOODS', 'BS_REISSUE_GOODS', 'BS_RETURN_GOODS', 'BS_LOGISTICS', 'BS_SEND_GOOD', 'BS_SYSTEM_ORDER', 'WLN_SYSTEM_ORDER', 'WLN_GOODS', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WDT_SYSTEM_ORDER', 'WDT_REISSUE_GOODS', 'WDT_RETURN_GOODS', 'WDT_EXCHANGE_GOODS', 'KM_SEND_GOOD', 'BS_E3_SYSTEM_ORDER'].includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
|
|
706
699
|
cur.push(nxt === null || nxt === void 0 ? void 0 : nxt.uniqueKey);
|
|
707
700
|
}
|
|
708
701
|
return cur;
|
|
@@ -769,8 +762,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
769
762
|
}
|
|
770
763
|
//切换店铺时,判断是否有订单号 有订单号自动订单返填
|
|
771
764
|
var allValue = form.getFieldsValue();
|
|
772
|
-
var tradeIdUniqueKey =
|
|
773
|
-
var paymentUniqueKey =
|
|
765
|
+
var tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, 'TRADE_ID_INPUT');
|
|
766
|
+
var paymentUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, 'ENTERPRISE_PAYMENT');
|
|
774
767
|
if (tradeIdUniqueKey) {
|
|
775
768
|
var tradeValue = allValue[tradeIdUniqueKey];
|
|
776
769
|
queryLabels(tradeValue, val);
|
|
@@ -892,15 +885,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
892
885
|
componentCanShow = _getDisplayAndDisable.display;
|
|
893
886
|
// TODO: 非前置节点组件渲染消费是否可以编辑配置
|
|
894
887
|
if (!isPreRender) {
|
|
895
|
-
// console.debug(
|
|
896
|
-
// workOrderId ? '编辑状态:' : '新建状态:',
|
|
897
|
-
// name,
|
|
898
|
-
// '是否可以展示: ',
|
|
899
|
-
// componentCanShow,
|
|
900
|
-
// '是否可以编辑: ',
|
|
901
|
-
// !componentCanEdit,
|
|
902
|
-
// componentConfig?.status,
|
|
903
|
-
// );
|
|
904
888
|
newComponentConfig['disabled'] = componentCanEdit;
|
|
905
889
|
}
|
|
906
890
|
if (workOrderComponentType === 'ENTERPRISE_PAYMENT') {
|
|
@@ -976,7 +960,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
976
960
|
onChange: function onChange(value) {
|
|
977
961
|
return componentOnValueChange(uniqueKey, value, workOrderComponentType);
|
|
978
962
|
},
|
|
979
|
-
hidden: !show ||
|
|
963
|
+
hidden: !show || mappingHideComponents.includes(uniqueKey),
|
|
980
964
|
platform: platform,
|
|
981
965
|
innerReplaceValueCh: innerReplaceValueCh,
|
|
982
966
|
display: isPreRender ? true : componentCanShow
|
|
@@ -988,7 +972,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
988
972
|
onChange: function onChange(value) {
|
|
989
973
|
return componentOnValueChange(uniqueKey, value, workOrderComponentType);
|
|
990
974
|
},
|
|
991
|
-
hidden:
|
|
975
|
+
hidden: mappingHideComponents.includes(uniqueKey),
|
|
992
976
|
platform: platform,
|
|
993
977
|
innerReplaceValueCh: innerReplaceValueCh,
|
|
994
978
|
display: isPreRender ? true : componentCanShow
|
|
@@ -1031,7 +1015,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1031
1015
|
return [].concat(_toConsumableArray(hiddenPreNode), [ShopName], _toConsumableArray(otherItems));
|
|
1032
1016
|
}
|
|
1033
1017
|
return [].concat(_toConsumableArray(hiddenPreNode), _toConsumableArray(otherItems));
|
|
1034
|
-
}, [platform, templateDetail, shopList, shopId, record,
|
|
1018
|
+
}, [platform, templateDetail, shopList, shopId, record, mappingHideComponents, currentShopId, look, handleChangeTradeId, innerReplaceValue]);
|
|
1035
1019
|
// TODO: 计算类型组件列表
|
|
1036
1020
|
var calculationTypeComponentList = useMemo(function () {
|
|
1037
1021
|
var _templateDetail$compo2;
|
|
@@ -1072,9 +1056,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1072
1056
|
}
|
|
1073
1057
|
}
|
|
1074
1058
|
}, 1000);
|
|
1075
|
-
|
|
1076
|
-
// const renderFinalFormItems = finalFormItems.filter(item => !mappdingHideComponents.includes(item.props?.name))
|
|
1077
|
-
|
|
1078
1059
|
var preNodeFormItems = useMemo(function () {
|
|
1079
1060
|
var _get, _groupByPreNode;
|
|
1080
1061
|
var configVosPrams = get(templateDetail, 'componentTemplateConfigVos', []).reduce(function (prv, next) {
|
|
@@ -1091,7 +1072,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1091
1072
|
componentConfig: _objectSpread(_objectSpread({}, item.componentConfig), config)
|
|
1092
1073
|
});
|
|
1093
1074
|
});
|
|
1094
|
-
var preNodeItems =
|
|
1075
|
+
var preNodeItems = new Array(preNodeComponentDtoList.length);
|
|
1095
1076
|
(_groupByPreNode = groupByPreNode(preNodeComponentDtoList)) === null || _groupByPreNode === void 0 ? void 0 : _groupByPreNode.forEach(function (item, key) {
|
|
1096
1077
|
var displayConfig = getCurrentNodeModifiedShowHideRule(flowAllShowHideRules === null || flowAllShowHideRules === void 0 ? void 0 : flowAllShowHideRules.allShowHideRules, key);
|
|
1097
1078
|
var finalDisplayConfig = displayConfig === null || displayConfig === void 0 ? void 0 : displayConfig.filter(function (item) {
|
|
@@ -1112,23 +1093,29 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1112
1093
|
});
|
|
1113
1094
|
console.debug('当前前置节点生效的显影规则', finalDisplayConfig);
|
|
1114
1095
|
console.log('finalDisplayConfig', finalDisplayConfig);
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1096
|
+
//排序前置组件顺序
|
|
1097
|
+
item.forEach(function (t) {
|
|
1098
|
+
var index = preNodeComponentDtoList.findIndex(function (node) {
|
|
1099
|
+
return node.uniqueKey === t.uniqueKey;
|
|
1100
|
+
});
|
|
1101
|
+
preNodeItems[index] = newRenderColumnItem({
|
|
1102
|
+
platform: platform,
|
|
1103
|
+
form: form,
|
|
1104
|
+
shopList: shopList,
|
|
1105
|
+
shopId: shopId,
|
|
1106
|
+
isEditing: !!workOrderId,
|
|
1107
|
+
workOrderDetail: record,
|
|
1108
|
+
templateDetail: templateDetail,
|
|
1109
|
+
disabled: true,
|
|
1110
|
+
displayConfig: finalDisplayConfig,
|
|
1111
|
+
isPreRender: true
|
|
1112
|
+
})(t);
|
|
1113
|
+
});
|
|
1127
1114
|
});
|
|
1128
1115
|
return preNodeItems;
|
|
1129
|
-
}, [templateDetail, shopList, shopId, record,
|
|
1116
|
+
}, [templateDetail, shopList, shopId, record, mappingHideComponents, currentShopId, look, handleChangeTradeId]);
|
|
1130
1117
|
useWhyDidYouUpdate('useWhyDidYouUpdateComponent', _objectSpread(_objectSpread({}, props), {}, {
|
|
1131
|
-
|
|
1118
|
+
mappingHideComponents: mappingHideComponents,
|
|
1132
1119
|
replaceValue: replaceValue,
|
|
1133
1120
|
labelList: labelList,
|
|
1134
1121
|
shopId: shopId
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export var updateWorkTypeKeys = {
|
|
2
|
+
BASIC_GRADE: 'basicGrade',
|
|
3
|
+
TRADE_ID_INPUT: 'tradeId',
|
|
4
|
+
SHOP_NAME_INPUT: 'shopName',
|
|
5
|
+
RECEIVER_NAME_INPUT: 'receiveName',
|
|
6
|
+
//收件人姓名
|
|
7
|
+
RECEIVER_MOBILE_INPUT: 'receiveMobile',
|
|
8
|
+
//收件人手机号
|
|
9
|
+
TRADE_CREATE_DATETIME: 'tradeCreateDateTime',
|
|
10
|
+
//下单时间
|
|
11
|
+
TRADE_PAYMENT_DATETIME: 'tradePaymentDateTime',
|
|
12
|
+
//付款时间
|
|
13
|
+
TRADE_DELIVERY_DATETIME: 'tradeDeliveryDateTime',
|
|
14
|
+
//发货时间
|
|
15
|
+
TRADE_CLOSING_DATETIME: 'tradeClosingDateTime',
|
|
16
|
+
//成交时间
|
|
17
|
+
ACTUAL_PAYMENT: 'actualPayment',
|
|
18
|
+
SYSTEM_ORDER_NO: 'systemOrderNo',
|
|
19
|
+
BS_SIGNING_TIME: 'bsSigningTime',
|
|
20
|
+
BS_SEND_TIME: 'bsSendTime',
|
|
21
|
+
BS_TRADE_PAYMENT_TIME: 'bsTradePaymentTime',
|
|
22
|
+
BS_NET_RECEIPTS: 'bsNetReceipts',
|
|
23
|
+
BS_PACKAGE_WEIGHT: 'bsPackageWeight',
|
|
24
|
+
BS_DEPOSIT: 'bsDeposit',
|
|
25
|
+
NEW_PAYMENT_STATUS: 'newPaymentStatus',
|
|
26
|
+
BUSINESS_ORDER_NO: 'businessOrderNo',
|
|
27
|
+
PAYMENT_VOUCHER_CODE: 'paymentVoucherCode'
|
|
28
|
+
};
|
|
29
|
+
export var systemOrderMap = {
|
|
30
|
+
BS_SYSTEM_ORDER: {
|
|
31
|
+
no: 'bsSystemOrderNo',
|
|
32
|
+
ids: 'bsSystemSelectIds',
|
|
33
|
+
order: 'bsSystemShowOrder'
|
|
34
|
+
},
|
|
35
|
+
WLN_SYSTEM_ORDER: {
|
|
36
|
+
no: 'wlnSystemOrderNo',
|
|
37
|
+
ids: 'wlnSystemSelectIds',
|
|
38
|
+
order: 'wlnSystemShowOrder'
|
|
39
|
+
},
|
|
40
|
+
WDT_SYSTEM_ORDER: {
|
|
41
|
+
no: 'wdtSystemOrderNo',
|
|
42
|
+
ids: 'wdtSystemSelectIds',
|
|
43
|
+
order: 'wdtSystemShowOrder'
|
|
44
|
+
},
|
|
45
|
+
BS_E3_SYSTEM_ORDER: {
|
|
46
|
+
no: 'bsE3SystemOrderNo',
|
|
47
|
+
ids: 'bsE3SystemSelectIds',
|
|
48
|
+
order: 'bsE3SystemShowOrder'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -47,6 +47,7 @@ export interface WorkOrderDetail {
|
|
|
47
47
|
}[];
|
|
48
48
|
}
|
|
49
49
|
export declare const formatPictures: (pictures: any) => any;
|
|
50
|
+
export declare const transTextToNumber: (value: string | number) => string | number;
|
|
50
51
|
export declare const calcWorkOrderList: (source: Partial<WorkOrderDetail>[], templateColumns: {
|
|
51
52
|
componentConfig: any;
|
|
52
53
|
workOrderComponentType: string;
|
|
@@ -97,6 +98,7 @@ export declare const deleteCacheOrder: ({ templateList, values, nodeId, flowTemp
|
|
|
97
98
|
unDeleteOrderInfo: boolean;
|
|
98
99
|
}) => void;
|
|
99
100
|
export declare const bsSystemOrderBackValues: ({ templateList, value, form }: any) => void;
|
|
101
|
+
export declare const bsE3SystemOrderBackValues: ({ templateList, value, form }: any) => void;
|
|
100
102
|
export declare const wlnSystemOrderBackValues: ({ templateList, value, form }: any) => void;
|
|
101
103
|
export declare const wdtSystemOrderBackValues: ({ templateList, value, form }: any) => void;
|
|
102
104
|
export declare const getMappingConfigByTemplateDetail: (templateDetail: {
|