@kmkf-fe-packages/kmkf-work-order-service-component 1.19.6 → 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 +26 -52
- 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 +1 -0
- package/dist/esm/common/utils/tools.js +6 -560
- package/dist/esm/common/utils/transformWorkOrderData.d.ts +2 -0
- package/dist/esm/common/utils/transformWorkOrderData.js +786 -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
|
};
|
|
@@ -35,18 +35,11 @@ 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
|
}
|
|
@@ -655,9 +641,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
655
641
|
form: form
|
|
656
642
|
});
|
|
657
643
|
}
|
|
658
|
-
if (
|
|
644
|
+
if (activeLogisticsComponents && ['INPUT', 'EXPRESS_LOGISTICS_SELECT', 'BS_LOGISTICS'].includes(workOrderComponentType)) {
|
|
659
645
|
setLogisticsInfo({
|
|
660
|
-
logisticsMappingConfig:
|
|
646
|
+
logisticsMappingConfig: activeLogisticsComponents,
|
|
661
647
|
uniqueKey: uniqueKey,
|
|
662
648
|
workOrderComponentType: workOrderComponentType,
|
|
663
649
|
value: value,
|
|
@@ -776,8 +762,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
776
762
|
}
|
|
777
763
|
//切换店铺时,判断是否有订单号 有订单号自动订单返填
|
|
778
764
|
var allValue = form.getFieldsValue();
|
|
779
|
-
var tradeIdUniqueKey =
|
|
780
|
-
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');
|
|
781
767
|
if (tradeIdUniqueKey) {
|
|
782
768
|
var tradeValue = allValue[tradeIdUniqueKey];
|
|
783
769
|
queryLabels(tradeValue, val);
|
|
@@ -899,15 +885,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
899
885
|
componentCanShow = _getDisplayAndDisable.display;
|
|
900
886
|
// TODO: 非前置节点组件渲染消费是否可以编辑配置
|
|
901
887
|
if (!isPreRender) {
|
|
902
|
-
// console.debug(
|
|
903
|
-
// workOrderId ? '编辑状态:' : '新建状态:',
|
|
904
|
-
// name,
|
|
905
|
-
// '是否可以展示: ',
|
|
906
|
-
// componentCanShow,
|
|
907
|
-
// '是否可以编辑: ',
|
|
908
|
-
// !componentCanEdit,
|
|
909
|
-
// componentConfig?.status,
|
|
910
|
-
// );
|
|
911
888
|
newComponentConfig['disabled'] = componentCanEdit;
|
|
912
889
|
}
|
|
913
890
|
if (workOrderComponentType === 'ENTERPRISE_PAYMENT') {
|
|
@@ -983,7 +960,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
983
960
|
onChange: function onChange(value) {
|
|
984
961
|
return componentOnValueChange(uniqueKey, value, workOrderComponentType);
|
|
985
962
|
},
|
|
986
|
-
hidden: !show ||
|
|
963
|
+
hidden: !show || mappingHideComponents.includes(uniqueKey),
|
|
987
964
|
platform: platform,
|
|
988
965
|
innerReplaceValueCh: innerReplaceValueCh,
|
|
989
966
|
display: isPreRender ? true : componentCanShow
|
|
@@ -995,7 +972,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
995
972
|
onChange: function onChange(value) {
|
|
996
973
|
return componentOnValueChange(uniqueKey, value, workOrderComponentType);
|
|
997
974
|
},
|
|
998
|
-
hidden:
|
|
975
|
+
hidden: mappingHideComponents.includes(uniqueKey),
|
|
999
976
|
platform: platform,
|
|
1000
977
|
innerReplaceValueCh: innerReplaceValueCh,
|
|
1001
978
|
display: isPreRender ? true : componentCanShow
|
|
@@ -1038,7 +1015,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1038
1015
|
return [].concat(_toConsumableArray(hiddenPreNode), [ShopName], _toConsumableArray(otherItems));
|
|
1039
1016
|
}
|
|
1040
1017
|
return [].concat(_toConsumableArray(hiddenPreNode), _toConsumableArray(otherItems));
|
|
1041
|
-
}, [platform, templateDetail, shopList, shopId, record,
|
|
1018
|
+
}, [platform, templateDetail, shopList, shopId, record, mappingHideComponents, currentShopId, look, handleChangeTradeId, innerReplaceValue]);
|
|
1042
1019
|
// TODO: 计算类型组件列表
|
|
1043
1020
|
var calculationTypeComponentList = useMemo(function () {
|
|
1044
1021
|
var _templateDetail$compo2;
|
|
@@ -1079,9 +1056,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1079
1056
|
}
|
|
1080
1057
|
}
|
|
1081
1058
|
}, 1000);
|
|
1082
|
-
|
|
1083
|
-
// const renderFinalFormItems = finalFormItems.filter(item => !mappdingHideComponents.includes(item.props?.name))
|
|
1084
|
-
|
|
1085
1059
|
var preNodeFormItems = useMemo(function () {
|
|
1086
1060
|
var _get, _groupByPreNode;
|
|
1087
1061
|
var configVosPrams = get(templateDetail, 'componentTemplateConfigVos', []).reduce(function (prv, next) {
|
|
@@ -1139,9 +1113,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1139
1113
|
});
|
|
1140
1114
|
});
|
|
1141
1115
|
return preNodeItems;
|
|
1142
|
-
}, [templateDetail, shopList, shopId, record,
|
|
1116
|
+
}, [templateDetail, shopList, shopId, record, mappingHideComponents, currentShopId, look, handleChangeTradeId]);
|
|
1143
1117
|
useWhyDidYouUpdate('useWhyDidYouUpdateComponent', _objectSpread(_objectSpread({}, props), {}, {
|
|
1144
|
-
|
|
1118
|
+
mappingHideComponents: mappingHideComponents,
|
|
1145
1119
|
replaceValue: replaceValue,
|
|
1146
1120
|
labelList: labelList,
|
|
1147
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;
|