@kmkf-fe-packages/kmkf-work-order-service-component 2.2.5-beta.2 → 2.2.5-beta.21
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/component-dependency-finder.d.ts +75 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/component-dependency-finder.js +328 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +378 -257
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.d.ts +6 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.js +67 -1
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/types.d.ts +41 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/types.js +1 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-finder.d.ts +61 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-finder.js +292 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-types.d.ts +65 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-types.js +1 -0
- package/dist/esm/FlowTemplateDetailV2/components/ShareLinkModal/index.d.ts +0 -1
- package/dist/esm/FlowTemplateDetailV2/components/ShareLinkModal/index.js +25 -26
- package/dist/esm/FlowTemplateDetailV2/components/ShareLinkModal/index.module.less +2 -2
- package/dist/esm/FlowTemplateDetailV2/index.js +37 -27
- package/dist/esm/FlowTemplateDetailV2/store/reducers.d.ts +2 -0
- package/dist/esm/FlowTemplateDetailV2/store/reducers.js +13 -7
- package/dist/esm/FlowTemplateDetailV2/store/selector.d.ts +1 -0
- package/dist/esm/FlowTemplateDetailV2/store/selector.js +3 -0
- package/dist/esm/common/utils/tools.js +20 -12
- package/dist/esm/model/flowTemplateDetail/api.js +2 -1
- package/dist/esm/model/flowTemplateDetail/types.d.ts +1 -0
- package/dist/esm/model/servers/request.js +1 -1
- package/package.json +5 -5
|
@@ -25,7 +25,7 @@ import React, { useState, useRef, useEffect, useMemo, forwardRef, useImperativeH
|
|
|
25
25
|
import { ConfigProvider, Form, Space, Tag } from 'antd';
|
|
26
26
|
import { useWhyDidYouUpdate } from 'ahooks';
|
|
27
27
|
import zhCN from 'antd/es/locale/zh_CN';
|
|
28
|
-
import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, groupBy, find, isArray } from 'lodash';
|
|
28
|
+
import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, groupBy, find, isArray, debounce, isMatch, isEqual } from 'lodash';
|
|
29
29
|
import 'moment/locale/zh-cn';
|
|
30
30
|
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
|
|
31
31
|
// 重复检验不需要展示在顶部的
|
|
@@ -43,7 +43,9 @@ import { jsonParseSecurity, findComponentUniqueKeyByType } from "../../../common
|
|
|
43
43
|
import { NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE } from "../../constant";
|
|
44
44
|
import { Context } from "../../context";
|
|
45
45
|
import { orderBackKmAddress } from "./constants";
|
|
46
|
-
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo, onBlurSkxLogisticsCode } from "./onBlur";
|
|
46
|
+
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo, onBlurSkxLogisticsCode, onBlurSkxReturnTHLogisticsCode } from "./onBlur";
|
|
47
|
+
import { findAllDependencies } from "./component-dependency-finder";
|
|
48
|
+
import { findValueDependencies } from "./value-mapping-finder";
|
|
47
49
|
// 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
|
|
48
50
|
// TODO: 用useState会有bug, 不确定是哪里导致的
|
|
49
51
|
var hideByXYComponentsMap = {};
|
|
@@ -221,6 +223,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
221
223
|
}
|
|
222
224
|
});
|
|
223
225
|
setReplaceValue(function (value) {
|
|
226
|
+
if (isMatch(value, obj)) {
|
|
227
|
+
return value;
|
|
228
|
+
}
|
|
224
229
|
return _objectSpread(_objectSpread({}, value), obj);
|
|
225
230
|
});
|
|
226
231
|
};
|
|
@@ -278,6 +283,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
278
283
|
return prv;
|
|
279
284
|
}, {});
|
|
280
285
|
setReplaceValue(function (prev) {
|
|
286
|
+
if (isMatch(prev, resultParams)) {
|
|
287
|
+
return prev;
|
|
288
|
+
}
|
|
281
289
|
return _objectSpread(_objectSpread({}, prev), resultParams);
|
|
282
290
|
});
|
|
283
291
|
setReplaceConfig(function (prev) {
|
|
@@ -342,6 +350,11 @@ var FormRender = function FormRender(props, ref) {
|
|
|
342
350
|
// 清空打款组件之前的重复校验
|
|
343
351
|
if (!enterprisePaymentAlipayNo) {
|
|
344
352
|
setReplaceValue(function (value) {
|
|
353
|
+
if (isMatch(value, {
|
|
354
|
+
enterprisePaymentAlipayNo: 0
|
|
355
|
+
})) {
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
345
358
|
return _objectSpread(_objectSpread({}, value), {}, {
|
|
346
359
|
enterprisePaymentAlipayNo: 0
|
|
347
360
|
});
|
|
@@ -365,160 +378,215 @@ var FormRender = function FormRender(props, ref) {
|
|
|
365
378
|
setLabelList(jsonParseSecurity(record === null || record === void 0 ? void 0 : (_record$jsonMap = record.jsonMap) === null || _record$jsonMap === void 0 ? void 0 : _record$jsonMap["".concat(labelComponent === null || labelComponent === void 0 ? void 0 : labelComponent.uniqueKey, "_label")], []));
|
|
366
379
|
}
|
|
367
380
|
}, [labelComponent, record]);
|
|
368
|
-
var queryDetail = function
|
|
369
|
-
var
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
shopId: shopId,
|
|
419
|
-
shopName: newRecord.shopName,
|
|
420
|
-
submitter: newRecord.submitter,
|
|
421
|
-
created: newRecord.created,
|
|
422
|
-
processTime: newRecord.processTime
|
|
423
|
-
}));
|
|
424
|
-
var initialValues = get(transData, '0', {});
|
|
425
|
-
newRecord.preCreateAndNotModified && batchFillByMapping(initialValues);
|
|
426
|
-
orderBackReplace(transData, templateDetail);
|
|
427
|
-
// TODO: 非开始节点录入,都会有workOrderId,这里判断是否有前置组件含有订单号;如果存在订单号,进行订单反填。
|
|
428
|
-
var tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'TRADE_ID_INPUT');
|
|
429
|
-
if (tradeIdUniqueKey && shopId && record !== null && record !== void 0 && (_record$jsonMap2 = record.jsonMap) !== null && _record$jsonMap2 !== void 0 && _record$jsonMap2["".concat(tradeIdUniqueKey, "_tradeId")] && firstOrderBackfill) {
|
|
430
|
-
var _record$jsonMap3, _record$jsonMap4, _record$jsonMap5;
|
|
431
|
-
orderBack({
|
|
432
|
-
order_no: record === null || record === void 0 ? void 0 : (_record$jsonMap3 = record.jsonMap) === null || _record$jsonMap3 === void 0 ? void 0 : _record$jsonMap3["".concat(tradeIdUniqueKey, "_tradeId")],
|
|
433
|
-
form: form,
|
|
434
|
-
shopId: shopId,
|
|
435
|
-
shopList: shopList,
|
|
436
|
-
templateDetail: templateDetail,
|
|
437
|
-
callback: orderBackReplace,
|
|
438
|
-
fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
|
|
439
|
-
plat: plat,
|
|
440
|
-
callKey: 1,
|
|
441
|
-
setLoading: setLoading
|
|
442
|
-
});
|
|
443
|
-
queryLabels(record === null || record === void 0 ? void 0 : (_record$jsonMap4 = record.jsonMap) === null || _record$jsonMap4 === void 0 ? void 0 : _record$jsonMap4["".concat(tradeIdUniqueKey, "_tradeId")], shopId);
|
|
444
|
-
queryMemberLevels(record === null || record === void 0 ? void 0 : (_record$jsonMap5 = record.jsonMap) === null || _record$jsonMap5 === void 0 ? void 0 : _record$jsonMap5["".concat(tradeIdUniqueKey, "_tradeId")], shopId);
|
|
445
|
-
} else {
|
|
446
|
-
// 如果没有订单反填,则单独更新remark
|
|
447
|
-
fetchRemark(shopId, currentNodeTid);
|
|
448
|
-
}
|
|
449
|
-
} else {
|
|
450
|
-
fillByShopId(shopId);
|
|
451
|
-
var initFormValues = null;
|
|
452
|
-
if (plat !== null && plat !== void 0 && plat.subOrderNo) {
|
|
453
|
-
var _getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOmsOrderInfo') || '{}');
|
|
454
|
-
if (plat !== null && plat !== void 0 && plat.subOrderNo && plat.buyerId) {
|
|
455
|
-
var _getCacheInfo2;
|
|
456
|
-
initFormValues = (_getCacheInfo2 = _getCacheInfo["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)]) === null || _getCacheInfo2 === void 0 ? void 0 : _getCacheInfo2[plat === null || plat === void 0 ? void 0 : plat.subOrderNo];
|
|
457
|
-
}
|
|
458
|
-
} else {
|
|
459
|
-
var _getCacheInfo3 = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
|
|
460
|
-
if (orderNo && plat.buyerId) {
|
|
461
|
-
var _getCacheInfo4;
|
|
462
|
-
initFormValues = (_getCacheInfo4 = _getCacheInfo3["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)]) === null || _getCacheInfo4 === void 0 ? void 0 : _getCacheInfo4[orderNo];
|
|
463
|
-
} else if (!orderNo && plat.buyerId) {
|
|
464
|
-
initFormValues = Object.values(_getCacheInfo3["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)] || {})[0];
|
|
465
|
-
}
|
|
466
|
-
}
|
|
381
|
+
var queryDetail = /*#__PURE__*/function () {
|
|
382
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref2) {
|
|
383
|
+
var workOrderId, shopId, shopList, record, orderNo, buyerId, buyerNick, jsonMap, _record$jsonMap5, newRecord, jsonMapOrderId, getCacheInfo, newFormValues, transData, initialValues, tradeIdUniqueKey, _record$jsonMap2, _record$jsonMap3, _record$jsonMap4, _tradeIdUniqueKey, _record$jsonMap6, _record$jsonMap7, _record$jsonMap8, initFormValues, _getCacheInfo, _getCacheInfo2, _getCacheInfo3, _getCacheInfo4, _orderNo, _shopId, orderNoField, _transData, _initialValues, antFormEl;
|
|
384
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
385
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
386
|
+
case 0:
|
|
387
|
+
workOrderId = _ref2.workOrderId, shopId = _ref2.shopId, shopList = _ref2.shopList, record = _ref2.record, orderNo = _ref2.orderNo, buyerId = _ref2.buyerId, buyerNick = _ref2.buyerNick;
|
|
388
|
+
if (!isOrderBackShopId) {
|
|
389
|
+
_context2.next = 4;
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
setIsOrderBackShopId(false);
|
|
393
|
+
return _context2.abrupt("return");
|
|
394
|
+
case 4:
|
|
395
|
+
form.resetFields();
|
|
396
|
+
//获取一些默认数据
|
|
397
|
+
jsonMap = templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList.reduce(function (prv, next) {
|
|
398
|
+
if (next.workOrderComponentType === 'TRADE_ID_INPUT') {
|
|
399
|
+
prv["".concat(next.uniqueKey, "_tradeId")] = orderNo;
|
|
400
|
+
}
|
|
401
|
+
if (next.workOrderComponentType === 'BUYER_NICK_INPUT') {
|
|
402
|
+
prv["".concat(next.uniqueKey, "_buyerOpenUid")] = buyerId;
|
|
403
|
+
prv["".concat(next.uniqueKey, "_buyerNick")] = buyerNick;
|
|
404
|
+
}
|
|
405
|
+
if (next.workOrderComponentType === 'ENTERPRISE_PAYMENT') {
|
|
406
|
+
prv["".concat(next.uniqueKey, "_enterprisePaymentTid")] = orderNo || '';
|
|
407
|
+
prv["".concat(next.uniqueKey, "_enterprisePaymentBuyerOpenUid")] = buyerId;
|
|
408
|
+
prv["".concat(next.uniqueKey, "_enterprisePaymentBuyerNick")] = buyerNick;
|
|
409
|
+
}
|
|
410
|
+
return prv;
|
|
411
|
+
}, {});
|
|
412
|
+
if (!workOrderId) {
|
|
413
|
+
_context2.next = 37;
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
// 先初始化端上内容
|
|
417
|
+
newRecord = cloneDeep(record);
|
|
418
|
+
jsonMapOrderId = Object.keys(newRecord.jsonMap).reduce(function (prv, next) {
|
|
419
|
+
var arrText = next.split('_');
|
|
420
|
+
if (arrText[arrText.length - 1] === 'tradeId') {
|
|
421
|
+
prv = newRecord.jsonMap[next];
|
|
422
|
+
}
|
|
423
|
+
return prv;
|
|
424
|
+
}, ''); //获取保存时的订单缓存数据,解决用户显隐组件不展示二次编辑没有订单信息的问题
|
|
425
|
+
getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
|
|
426
|
+
newFormValues = _objectSpread({}, getCacheInfo[jsonMapOrderId] || {});
|
|
427
|
+
newFormValues = reversalFormValues(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, newFormValues);
|
|
428
|
+
newRecord.jsonMap = _objectSpread(_objectSpread(_objectSpread({}, newFormValues), jsonMap), newRecord.jsonMap);
|
|
429
|
+
transData = calcWorkOrderList([newRecord], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), newRecord.preCreateAndNotModified ? 'init' : 'edit' // TODO: 修复非首节点录入时丢失初始值问题
|
|
430
|
+
); // console.log(newRecord.jsonMap, newFormValues, transData);
|
|
467
431
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
432
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, get(transData, '0', {})), {}, {
|
|
433
|
+
shopId: shopId,
|
|
434
|
+
shopName: newRecord.shopName,
|
|
435
|
+
submitter: newRecord.submitter,
|
|
436
|
+
created: newRecord.created,
|
|
437
|
+
processTime: newRecord.processTime
|
|
438
|
+
}));
|
|
439
|
+
initialValues = get(transData, '0', {});
|
|
440
|
+
newRecord.preCreateAndNotModified && batchFillByMapping(initialValues);
|
|
441
|
+
orderBackReplace(transData, templateDetail);
|
|
442
|
+
// TODO: 非开始节点录入,都会有workOrderId,这里判断是否有前置组件含有订单号;如果存在订单号,进行订单反填。
|
|
443
|
+
tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'TRADE_ID_INPUT');
|
|
444
|
+
if (!newRecord.notAutoFillWithFirstSubmit) {
|
|
445
|
+
_context2.next = 27;
|
|
446
|
+
break;
|
|
447
|
+
}
|
|
448
|
+
_tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, 'TRADE_ID_INPUT');
|
|
449
|
+
queryLabels(record === null || record === void 0 ? void 0 : (_record$jsonMap2 = record.jsonMap) === null || _record$jsonMap2 === void 0 ? void 0 : _record$jsonMap2["".concat(_tradeIdUniqueKey, "_tradeId")], shopId);
|
|
450
|
+
queryMemberLevels(record === null || record === void 0 ? void 0 : (_record$jsonMap3 = record.jsonMap) === null || _record$jsonMap3 === void 0 ? void 0 : _record$jsonMap3["".concat(_tradeIdUniqueKey, "_tradeId")], shopId);
|
|
451
|
+
_context2.next = 25;
|
|
452
|
+
return orderBack({
|
|
453
|
+
order_no: record === null || record === void 0 ? void 0 : (_record$jsonMap4 = record.jsonMap) === null || _record$jsonMap4 === void 0 ? void 0 : _record$jsonMap4["".concat(_tradeIdUniqueKey, "_tradeId")],
|
|
454
|
+
form: form,
|
|
455
|
+
shopId: shopId,
|
|
456
|
+
shopList: shopList,
|
|
457
|
+
templateDetail: templateDetail,
|
|
458
|
+
callback: orderBackReplace,
|
|
459
|
+
fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
|
|
460
|
+
plat: plat,
|
|
461
|
+
callKey: 1,
|
|
462
|
+
setLoading: setLoading
|
|
463
|
+
});
|
|
464
|
+
case 25:
|
|
465
|
+
_context2.next = 35;
|
|
466
|
+
break;
|
|
467
|
+
case 27:
|
|
468
|
+
if (!(tradeIdUniqueKey && shopId && record !== null && record !== void 0 && (_record$jsonMap5 = record.jsonMap) !== null && _record$jsonMap5 !== void 0 && _record$jsonMap5["".concat(tradeIdUniqueKey, "_tradeId")] && firstOrderBackfill)) {
|
|
469
|
+
_context2.next = 34;
|
|
470
|
+
break;
|
|
471
|
+
}
|
|
472
|
+
queryLabels(record === null || record === void 0 ? void 0 : (_record$jsonMap6 = record.jsonMap) === null || _record$jsonMap6 === void 0 ? void 0 : _record$jsonMap6["".concat(tradeIdUniqueKey, "_tradeId")], shopId);
|
|
473
|
+
queryMemberLevels(record === null || record === void 0 ? void 0 : (_record$jsonMap7 = record.jsonMap) === null || _record$jsonMap7 === void 0 ? void 0 : _record$jsonMap7["".concat(tradeIdUniqueKey, "_tradeId")], shopId);
|
|
474
|
+
_context2.next = 32;
|
|
475
|
+
return orderBack({
|
|
476
|
+
order_no: record === null || record === void 0 ? void 0 : (_record$jsonMap8 = record.jsonMap) === null || _record$jsonMap8 === void 0 ? void 0 : _record$jsonMap8["".concat(tradeIdUniqueKey, "_tradeId")],
|
|
477
|
+
form: form,
|
|
478
|
+
shopId: shopId,
|
|
479
|
+
shopList: shopList,
|
|
480
|
+
templateDetail: templateDetail,
|
|
481
|
+
callback: orderBackReplace,
|
|
482
|
+
fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
|
|
483
|
+
plat: plat,
|
|
484
|
+
callKey: 1,
|
|
485
|
+
setLoading: setLoading
|
|
486
|
+
});
|
|
487
|
+
case 32:
|
|
488
|
+
_context2.next = 35;
|
|
489
|
+
break;
|
|
490
|
+
case 34:
|
|
491
|
+
// 如果没有订单反填,则单独更新remark
|
|
492
|
+
fetchRemark(shopId, currentNodeTid);
|
|
493
|
+
case 35:
|
|
494
|
+
_context2.next = 60;
|
|
495
|
+
break;
|
|
496
|
+
case 37:
|
|
497
|
+
fillByShopId(shopId);
|
|
498
|
+
initFormValues = null;
|
|
499
|
+
if (plat !== null && plat !== void 0 && plat.subOrderNo) {
|
|
500
|
+
_getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOmsOrderInfo') || '{}');
|
|
501
|
+
if (plat !== null && plat !== void 0 && plat.subOrderNo && plat.buyerId) {
|
|
502
|
+
initFormValues = (_getCacheInfo2 = _getCacheInfo["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)]) === null || _getCacheInfo2 === void 0 ? void 0 : _getCacheInfo2[plat === null || plat === void 0 ? void 0 : plat.subOrderNo];
|
|
503
|
+
}
|
|
504
|
+
} else {
|
|
505
|
+
_getCacheInfo3 = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
|
|
506
|
+
if (orderNo && plat.buyerId) {
|
|
507
|
+
initFormValues = (_getCacheInfo4 = _getCacheInfo3["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)]) === null || _getCacheInfo4 === void 0 ? void 0 : _getCacheInfo4[orderNo];
|
|
508
|
+
} else if (!orderNo && plat.buyerId) {
|
|
509
|
+
initFormValues = Object.values(_getCacheInfo3["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)] || {})[0];
|
|
510
|
+
}
|
|
511
|
+
}
|
|
495
512
|
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
//
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
513
|
+
// console.log(orderNo, initFormValues);
|
|
514
|
+
if (!initFormValues) {
|
|
515
|
+
_context2.next = 48;
|
|
516
|
+
break;
|
|
517
|
+
}
|
|
518
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, initFormValues), {}, {
|
|
519
|
+
shopId: shopId
|
|
520
|
+
}));
|
|
521
|
+
// 没有触发订单反填的情况下,更新备注,
|
|
522
|
+
// PS: orderNo 和 shopId 可能需要从initFormValues中获取
|
|
523
|
+
_orderNo = orderNo;
|
|
524
|
+
_shopId = shopId || initFormValues['shopId'];
|
|
525
|
+
if (!_orderNo) {
|
|
526
|
+
orderNoField = ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).find(function (item) {
|
|
527
|
+
return (item === null || item === void 0 ? void 0 : item.workOrderComponentType) === 'TRADE_ID_INPUT';
|
|
528
|
+
});
|
|
529
|
+
_orderNo = orderNoField !== null && orderNoField !== void 0 && orderNoField.uniqueKey ? initFormValues[orderNoField === null || orderNoField === void 0 ? void 0 : orderNoField.uniqueKey] || _orderNo : _orderNo;
|
|
530
|
+
}
|
|
531
|
+
fetchRemark(_shopId, _orderNo);
|
|
532
|
+
_context2.next = 60;
|
|
533
|
+
break;
|
|
534
|
+
case 48:
|
|
535
|
+
_transData = calcWorkOrderList([{
|
|
536
|
+
jsonMap: jsonMap
|
|
537
|
+
}], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), 'init');
|
|
538
|
+
_initialValues = get(_transData, '0', {});
|
|
539
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, _initialValues), {}, {
|
|
540
|
+
shopId: shopId
|
|
541
|
+
}));
|
|
542
|
+
// 默认值触发映射
|
|
543
|
+
batchFillByMapping(_initialValues);
|
|
544
|
+
//如果有订单号 订单返填 通过订单号入口进行工单录入,需要将订单数据反填到工单
|
|
545
|
+
if (!(orderNo && shopId)) {
|
|
546
|
+
_context2.next = 59;
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
queryLabels(orderNo, shopId);
|
|
550
|
+
queryMemberLevels(orderNo, shopId);
|
|
551
|
+
_context2.next = 57;
|
|
552
|
+
return orderBack({
|
|
553
|
+
order_no: orderNo,
|
|
554
|
+
form: form,
|
|
555
|
+
shopId: shopId,
|
|
556
|
+
shopList: shopList,
|
|
557
|
+
templateDetail: templateDetail,
|
|
558
|
+
callback: orderBackReplace,
|
|
559
|
+
fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
|
|
560
|
+
// TODO: 只有在千牛端通过订单号录入工单的时候,订单备注不需要反填
|
|
561
|
+
plat: plat,
|
|
562
|
+
callKey: 2,
|
|
563
|
+
setLoading: setLoading
|
|
564
|
+
});
|
|
565
|
+
case 57:
|
|
566
|
+
_context2.next = 60;
|
|
567
|
+
break;
|
|
568
|
+
case 59:
|
|
569
|
+
// 如果没有订单反填,则单独更新remark
|
|
570
|
+
fetchRemark(shopId, currentNodeTid);
|
|
571
|
+
case 60:
|
|
572
|
+
antFormEl = document.getElementsByClassName('ant-form');
|
|
573
|
+
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
|
574
|
+
resetMappingHideComponents();
|
|
575
|
+
// TODO: 临时方案,解决批量提交时未带入订单反填数据
|
|
576
|
+
dispatch({
|
|
577
|
+
type: 'setaAutoSubmitFlag',
|
|
578
|
+
payload: true
|
|
579
|
+
});
|
|
580
|
+
case 64:
|
|
581
|
+
case "end":
|
|
582
|
+
return _context2.stop();
|
|
515
583
|
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
};
|
|
584
|
+
}, _callee2);
|
|
585
|
+
}));
|
|
586
|
+
return function queryDetail(_x4) {
|
|
587
|
+
return _ref3.apply(this, arguments);
|
|
588
|
+
};
|
|
589
|
+
}();
|
|
522
590
|
useEffect(function () {
|
|
523
591
|
if (isErpUse) return;
|
|
524
592
|
queryDetail({
|
|
@@ -618,115 +686,131 @@ var FormRender = function FormRender(props, ref) {
|
|
|
618
686
|
|
|
619
687
|
// 查询标签
|
|
620
688
|
var queryLabels = /*#__PURE__*/function () {
|
|
621
|
-
var
|
|
622
|
-
var _yield$queryLabelByTr, _yield$queryLabelByTr2, data;
|
|
623
|
-
return _regeneratorRuntime().wrap(function
|
|
624
|
-
while (1) switch (
|
|
689
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(tid, shopId) {
|
|
690
|
+
var oldLabelList, _yield$queryLabelByTr, _yield$queryLabelByTr2, data;
|
|
691
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
692
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
625
693
|
case 0:
|
|
626
694
|
if (!isNull(labelComponent)) {
|
|
627
|
-
|
|
695
|
+
_context3.next = 2;
|
|
628
696
|
break;
|
|
629
697
|
}
|
|
630
|
-
return
|
|
698
|
+
return _context3.abrupt("return", console.debug('当前节点不需要查询标签'));
|
|
631
699
|
case 2:
|
|
632
700
|
if (shopId) {
|
|
633
|
-
|
|
701
|
+
_context3.next = 4;
|
|
634
702
|
break;
|
|
635
703
|
}
|
|
636
|
-
return
|
|
704
|
+
return _context3.abrupt("return", console.debug('查询标签缺少必要参数-shopId'));
|
|
637
705
|
case 4:
|
|
706
|
+
oldLabelList = form.getFieldValue("".concat(labelComponent.uniqueKey));
|
|
638
707
|
if (tid) {
|
|
639
|
-
|
|
708
|
+
_context3.next = 9;
|
|
640
709
|
break;
|
|
641
710
|
}
|
|
642
|
-
setLabelList(
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
711
|
+
setLabelList(function (list) {
|
|
712
|
+
if (list.length === 0) return list;
|
|
713
|
+
return [];
|
|
714
|
+
});
|
|
715
|
+
if (oldLabelList.length !== 0) {
|
|
716
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), []));
|
|
717
|
+
}
|
|
718
|
+
return _context3.abrupt("return", console.debug('查询标签缺少必要参数-tradeId'));
|
|
719
|
+
case 9:
|
|
720
|
+
_context3.next = 11;
|
|
647
721
|
return queryLabelByTradeId({
|
|
648
722
|
tid: tid,
|
|
649
723
|
shopId: shopId
|
|
650
724
|
});
|
|
651
|
-
case
|
|
652
|
-
_yield$queryLabelByTr =
|
|
725
|
+
case 11:
|
|
726
|
+
_yield$queryLabelByTr = _context3.sent;
|
|
653
727
|
_yield$queryLabelByTr2 = _yield$queryLabelByTr.data;
|
|
654
728
|
data = _yield$queryLabelByTr2 === void 0 ? [] : _yield$queryLabelByTr2;
|
|
655
|
-
setLabelList(
|
|
656
|
-
|
|
657
|
-
|
|
729
|
+
setLabelList(function (list) {
|
|
730
|
+
if (isEqual(list, data)) return list;
|
|
731
|
+
return data;
|
|
732
|
+
});
|
|
733
|
+
if (!isEqual(oldLabelList, data)) {
|
|
734
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), data));
|
|
735
|
+
}
|
|
736
|
+
case 16:
|
|
658
737
|
case "end":
|
|
659
|
-
return
|
|
738
|
+
return _context3.stop();
|
|
660
739
|
}
|
|
661
|
-
},
|
|
740
|
+
}, _callee3);
|
|
662
741
|
}));
|
|
663
|
-
return function queryLabels(
|
|
664
|
-
return
|
|
742
|
+
return function queryLabels(_x5, _x6) {
|
|
743
|
+
return _ref4.apply(this, arguments);
|
|
665
744
|
};
|
|
666
745
|
}();
|
|
667
746
|
// 查询会员等级
|
|
668
747
|
var queryMemberLevels = /*#__PURE__*/function () {
|
|
669
|
-
var
|
|
670
|
-
var _yield$queryMemberLev, _yield$queryMemberLev2, data;
|
|
671
|
-
return _regeneratorRuntime().wrap(function
|
|
672
|
-
while (1) switch (
|
|
748
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(tid, shopId) {
|
|
749
|
+
var oldMemberLevel, _yield$queryMemberLev, _yield$queryMemberLev2, data;
|
|
750
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
751
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
673
752
|
case 0:
|
|
674
753
|
if (!isNull(memberLevelComponent)) {
|
|
675
|
-
|
|
754
|
+
_context4.next = 2;
|
|
676
755
|
break;
|
|
677
756
|
}
|
|
678
|
-
return
|
|
757
|
+
return _context4.abrupt("return", console.debug('当前节点不需要查询会员等级'));
|
|
679
758
|
case 2:
|
|
680
759
|
if (shopId) {
|
|
681
|
-
|
|
760
|
+
_context4.next = 4;
|
|
682
761
|
break;
|
|
683
762
|
}
|
|
684
|
-
return
|
|
763
|
+
return _context4.abrupt("return", console.debug('查询标签缺少必要参数-shopId'));
|
|
685
764
|
case 4:
|
|
765
|
+
oldMemberLevel = form.getFieldValue("".concat(labelComponent.uniqueKey));
|
|
686
766
|
if (tid) {
|
|
687
|
-
|
|
767
|
+
_context4.next = 8;
|
|
688
768
|
break;
|
|
689
769
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
770
|
+
if (oldMemberLevel.length !== 0) {
|
|
771
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), []));
|
|
772
|
+
}
|
|
773
|
+
return _context4.abrupt("return", console.debug('查询标签缺少必要参数-tradeId'));
|
|
774
|
+
case 8:
|
|
775
|
+
_context4.next = 10;
|
|
694
776
|
return queryMemberLevel({
|
|
695
777
|
tid: tid,
|
|
696
778
|
shopId: shopId
|
|
697
779
|
});
|
|
698
|
-
case
|
|
699
|
-
_yield$queryMemberLev =
|
|
780
|
+
case 10:
|
|
781
|
+
_yield$queryMemberLev = _context4.sent;
|
|
700
782
|
_yield$queryMemberLev2 = _yield$queryMemberLev.data;
|
|
701
783
|
data = _yield$queryMemberLev2 === void 0 ? [] : _yield$queryMemberLev2;
|
|
702
|
-
|
|
703
|
-
|
|
784
|
+
if (!isEqual(oldMemberLevel, data)) {
|
|
785
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), data));
|
|
786
|
+
}
|
|
787
|
+
case 14:
|
|
704
788
|
case "end":
|
|
705
|
-
return
|
|
789
|
+
return _context4.stop();
|
|
706
790
|
}
|
|
707
|
-
},
|
|
791
|
+
}, _callee4);
|
|
708
792
|
}));
|
|
709
|
-
return function queryMemberLevels(
|
|
710
|
-
return
|
|
793
|
+
return function queryMemberLevels(_x7, _x8) {
|
|
794
|
+
return _ref5.apply(this, arguments);
|
|
711
795
|
};
|
|
712
796
|
}();
|
|
713
797
|
|
|
714
798
|
//订单返填
|
|
715
799
|
var changeHandle = /*#__PURE__*/function () {
|
|
716
|
-
var
|
|
717
|
-
return _regeneratorRuntime().wrap(function
|
|
718
|
-
while (1) switch (
|
|
800
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(order_no) {
|
|
801
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
802
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
719
803
|
case 0:
|
|
720
804
|
if (order_no) {
|
|
721
|
-
|
|
805
|
+
_context5.next = 2;
|
|
722
806
|
break;
|
|
723
807
|
}
|
|
724
|
-
return
|
|
808
|
+
return _context5.abrupt("return");
|
|
725
809
|
case 2:
|
|
726
810
|
// console.log('[订单返填 changeHandle order_no ] >', order_no);
|
|
727
811
|
|
|
728
812
|
sessionStorage.setItem('order_no_test', order_no);
|
|
729
|
-
|
|
813
|
+
_context5.next = 5;
|
|
730
814
|
return orderBack({
|
|
731
815
|
order_no: order_no,
|
|
732
816
|
form: form,
|
|
@@ -749,12 +833,12 @@ var FormRender = function FormRender(props, ref) {
|
|
|
749
833
|
});
|
|
750
834
|
case 5:
|
|
751
835
|
case "end":
|
|
752
|
-
return
|
|
836
|
+
return _context5.stop();
|
|
753
837
|
}
|
|
754
|
-
},
|
|
838
|
+
}, _callee5);
|
|
755
839
|
}));
|
|
756
|
-
return function changeHandle(
|
|
757
|
-
return
|
|
840
|
+
return function changeHandle(_x9) {
|
|
841
|
+
return _ref6.apply(this, arguments);
|
|
758
842
|
};
|
|
759
843
|
}();
|
|
760
844
|
// 组件值变化
|
|
@@ -849,16 +933,16 @@ var FormRender = function FormRender(props, ref) {
|
|
|
849
933
|
|
|
850
934
|
//组件失焦事件
|
|
851
935
|
var componentOnBlur = /*#__PURE__*/function () {
|
|
852
|
-
var
|
|
936
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(value, type) {
|
|
853
937
|
var promises;
|
|
854
|
-
return _regeneratorRuntime().wrap(function
|
|
855
|
-
while (1) switch (
|
|
938
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
939
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
856
940
|
case 0:
|
|
857
941
|
if (!(type === 'erpAfterSaleTradeId')) {
|
|
858
|
-
|
|
942
|
+
_context6.next = 5;
|
|
859
943
|
break;
|
|
860
944
|
}
|
|
861
|
-
|
|
945
|
+
_context6.next = 3;
|
|
862
946
|
return onBlurErpAfterSaleTradeId({
|
|
863
947
|
form: form,
|
|
864
948
|
value: value,
|
|
@@ -866,14 +950,14 @@ var FormRender = function FormRender(props, ref) {
|
|
|
866
950
|
setKmLoading: setKmLoading
|
|
867
951
|
});
|
|
868
952
|
case 3:
|
|
869
|
-
|
|
953
|
+
_context6.next = 41;
|
|
870
954
|
break;
|
|
871
955
|
case 5:
|
|
872
956
|
if (!(type === 'expressLogisticsCode')) {
|
|
873
|
-
|
|
957
|
+
_context6.next = 13;
|
|
874
958
|
break;
|
|
875
959
|
}
|
|
876
|
-
|
|
960
|
+
_context6.next = 8;
|
|
877
961
|
return onBlurExpressLogisticsCode({
|
|
878
962
|
form: form,
|
|
879
963
|
value: value,
|
|
@@ -883,10 +967,10 @@ var FormRender = function FormRender(props, ref) {
|
|
|
883
967
|
});
|
|
884
968
|
case 8:
|
|
885
969
|
if (!['TR3E2FYXFZCFANVG6O6AALSM', 'SZF4ZGWZSNW6PYXMCIFEWBXT'].includes(companyKey)) {
|
|
886
|
-
|
|
970
|
+
_context6.next = 11;
|
|
887
971
|
break;
|
|
888
972
|
}
|
|
889
|
-
|
|
973
|
+
_context6.next = 11;
|
|
890
974
|
return onBlurSkxLogisticsCode({
|
|
891
975
|
form: form,
|
|
892
976
|
value: value,
|
|
@@ -894,16 +978,16 @@ var FormRender = function FormRender(props, ref) {
|
|
|
894
978
|
componentOnBlur: componentOnBlur
|
|
895
979
|
});
|
|
896
980
|
case 11:
|
|
897
|
-
|
|
981
|
+
_context6.next = 41;
|
|
898
982
|
break;
|
|
899
983
|
case 13:
|
|
900
984
|
if (!(type === 'skxOutboundNoticeNo')) {
|
|
901
|
-
|
|
985
|
+
_context6.next = 19;
|
|
902
986
|
break;
|
|
903
987
|
}
|
|
904
988
|
//[SKX]ON出库通知单号 返填
|
|
905
989
|
console.log('skxOutboundNoticeNo', value);
|
|
906
|
-
|
|
990
|
+
_context6.next = 17;
|
|
907
991
|
return onBlurSkxOutboundNoticeNo({
|
|
908
992
|
form: form,
|
|
909
993
|
value: value,
|
|
@@ -911,14 +995,14 @@ var FormRender = function FormRender(props, ref) {
|
|
|
911
995
|
componentOnBlur: componentOnBlur
|
|
912
996
|
});
|
|
913
997
|
case 17:
|
|
914
|
-
|
|
998
|
+
_context6.next = 41;
|
|
915
999
|
break;
|
|
916
1000
|
case 19:
|
|
917
1001
|
if (!(type === 'skxReturnBillNo')) {
|
|
918
|
-
|
|
1002
|
+
_context6.next = 24;
|
|
919
1003
|
break;
|
|
920
1004
|
}
|
|
921
|
-
|
|
1005
|
+
_context6.next = 22;
|
|
922
1006
|
return onBlurSkxReturnBillNo({
|
|
923
1007
|
form: form,
|
|
924
1008
|
value: value,
|
|
@@ -926,9 +1010,24 @@ var FormRender = function FormRender(props, ref) {
|
|
|
926
1010
|
componentOnBlur: componentOnBlur
|
|
927
1011
|
});
|
|
928
1012
|
case 22:
|
|
929
|
-
|
|
1013
|
+
_context6.next = 41;
|
|
930
1014
|
break;
|
|
931
1015
|
case 24:
|
|
1016
|
+
if (!(type === 'skxReturnTHLogisticsCode')) {
|
|
1017
|
+
_context6.next = 29;
|
|
1018
|
+
break;
|
|
1019
|
+
}
|
|
1020
|
+
_context6.next = 27;
|
|
1021
|
+
return onBlurSkxReturnTHLogisticsCode({
|
|
1022
|
+
form: form,
|
|
1023
|
+
value: value,
|
|
1024
|
+
templateDetail: templateDetail,
|
|
1025
|
+
componentOnBlur: componentOnBlur
|
|
1026
|
+
});
|
|
1027
|
+
case 27:
|
|
1028
|
+
_context6.next = 41;
|
|
1029
|
+
break;
|
|
1030
|
+
case 29:
|
|
932
1031
|
// 收集所有需要执行的异步操作
|
|
933
1032
|
promises = [];
|
|
934
1033
|
if (type === 'tradeId') {
|
|
@@ -940,33 +1039,36 @@ var FormRender = function FormRender(props, ref) {
|
|
|
940
1039
|
promises.push(handleChangeTradeId(value));
|
|
941
1040
|
}
|
|
942
1041
|
if (value) {
|
|
943
|
-
|
|
1042
|
+
_context6.next = 36;
|
|
944
1043
|
break;
|
|
945
1044
|
}
|
|
946
1045
|
setReplaceValue(function (prev) {
|
|
1046
|
+
if (isMatch(prev, _defineProperty({}, type, 0))) {
|
|
1047
|
+
return prev;
|
|
1048
|
+
}
|
|
947
1049
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, type, 0));
|
|
948
1050
|
});
|
|
949
1051
|
replaceValueRef.current = _objectSpread(_objectSpread({}, replaceValue), {}, _defineProperty({}, type, 0));
|
|
950
|
-
return
|
|
951
|
-
case
|
|
1052
|
+
return _context6.abrupt("return");
|
|
1053
|
+
case 36:
|
|
952
1054
|
promises.push(queryReplaceCount(_defineProperty({}, type, value), templateDetail));
|
|
953
1055
|
// TODO: ERP不走订单反弹逻辑
|
|
954
1056
|
if ((type === 'tradeId' || type === 'enterprisePaymentTid') && !isErpUse) {
|
|
955
1057
|
promises.push(changeHandle(value));
|
|
956
1058
|
}
|
|
957
1059
|
// 等待所有异步操作完成
|
|
958
|
-
|
|
1060
|
+
_context6.next = 40;
|
|
959
1061
|
return Promise.all(promises);
|
|
960
|
-
case
|
|
961
|
-
return
|
|
962
|
-
case
|
|
1062
|
+
case 40:
|
|
1063
|
+
return _context6.abrupt("return", Promise.resolve());
|
|
1064
|
+
case 41:
|
|
963
1065
|
case "end":
|
|
964
|
-
return
|
|
1066
|
+
return _context6.stop();
|
|
965
1067
|
}
|
|
966
|
-
},
|
|
1068
|
+
}, _callee6);
|
|
967
1069
|
}));
|
|
968
|
-
return function componentOnBlur(
|
|
969
|
-
return
|
|
1070
|
+
return function componentOnBlur(_x10, _x11) {
|
|
1071
|
+
return _ref7.apply(this, arguments);
|
|
970
1072
|
};
|
|
971
1073
|
}();
|
|
972
1074
|
// 切换店铺
|
|
@@ -1140,13 +1242,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1140
1242
|
if (Reflect.has(currentComponentDisplayStatus.current, prefixId) && !currentComponentDisplayStatus.current[prefixId]) {
|
|
1141
1243
|
return false;
|
|
1142
1244
|
}
|
|
1143
|
-
// console.debug(
|
|
1144
|
-
// '显影计算',
|
|
1145
|
-
// dependenceDetail?.type,
|
|
1146
|
-
// leftValue,
|
|
1147
|
-
// item.compareSymbol?.toUpperCase(),
|
|
1148
|
-
// item.rightValue,
|
|
1149
|
-
// );
|
|
1150
1245
|
return getExpression((_item$compareSymbol = item.compareSymbol) === null || _item$compareSymbol === void 0 ? void 0 : _item$compareSymbol.toUpperCase(), leftValue, item.rightValue);
|
|
1151
1246
|
};
|
|
1152
1247
|
var getDisplayAndDisabledConfig = function getDisplayAndDisabledConfig(config) {
|
|
@@ -1179,9 +1274,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1179
1274
|
var newComponentConfig = _objectSpread(_objectSpread({}, componentConfig), {}, {
|
|
1180
1275
|
disabled: disabled
|
|
1181
1276
|
});
|
|
1182
|
-
var
|
|
1183
|
-
upgrade =
|
|
1184
|
-
created =
|
|
1277
|
+
var _ref8 = (componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.status) || {},
|
|
1278
|
+
upgrade = _ref8.upgrade,
|
|
1279
|
+
created = _ref8.created;
|
|
1185
1280
|
if (['REISSUE_TRADE_ID', 'EXCHANGE_TRADE_ID', 'ERP_AFTER_SALE_TRADE_ID'].includes(workOrderComponentType)) {
|
|
1186
1281
|
// 售后单id、补发单id和换货单id默认值是可见不可编辑(2)
|
|
1187
1282
|
if (typeof upgrade !== 'number') {
|
|
@@ -1233,14 +1328,25 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1233
1328
|
currentTemplateAllComponentsDisplay.current[instance === null || instance === void 0 ? void 0 : instance.id] = true;
|
|
1234
1329
|
if (Reflect.has(idConditionListMap, instance.id)) {
|
|
1235
1330
|
var currentIdDependenceOtherFields = idConditionListMap[instance.id];
|
|
1331
|
+
// console.group('当前组件', instance.id, instance.name);
|
|
1332
|
+
var dependencies = findAllDependencies(instance.id, idConditionListMap);
|
|
1333
|
+
// console.log('当前组件所依赖项: ', dependencies);
|
|
1334
|
+
var currentDependenciesMappingComponent = _toConsumableArray(new Set(dependencies.concat(instance.id))).reduce(function (cur, nxt) {
|
|
1335
|
+
var _findValueDependencie, _findValueDependencie2;
|
|
1336
|
+
var mappingDependencies = (_findValueDependencie = findValueDependencies(nxt, mappingConfig.config)) === null || _findValueDependencie === void 0 ? void 0 : (_findValueDependencie2 = _findValueDependencie.dependencies) === null || _findValueDependencie2 === void 0 ? void 0 : _findValueDependencie2.map(function (item) {
|
|
1337
|
+
return item.sourceComponent;
|
|
1338
|
+
});
|
|
1339
|
+
cur = cur.concat(mappingDependencies);
|
|
1340
|
+
return cur;
|
|
1341
|
+
}, []);
|
|
1342
|
+
// console.log('当前组件所依赖项+值映射依赖项: ', currentDependenciesMappingComponent);
|
|
1343
|
+
// console.groupEnd();
|
|
1236
1344
|
// 需要增加显隐处理逻辑
|
|
1237
1345
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
1238
1346
|
noStyle: true,
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
}, function (_ref8) {
|
|
1243
|
-
var getFieldValue = _ref8.getFieldValue;
|
|
1347
|
+
dependencies: _toConsumableArray(new Set(dependencies.concat(currentDependenciesMappingComponent)))
|
|
1348
|
+
}, function (_ref9) {
|
|
1349
|
+
var getFieldValue = _ref9.getFieldValue;
|
|
1244
1350
|
var show = currentIdDependenceOtherFields === null || currentIdDependenceOtherFields === void 0 ? void 0 : currentIdDependenceOtherFields.reduce(function (cur, nxt) {
|
|
1245
1351
|
// 如果有一项满足展示条件则展示
|
|
1246
1352
|
if (cur) {
|
|
@@ -1341,17 +1447,29 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1341
1447
|
var handleWatchFormValueChange = function handleWatchFormValueChange(changedValues) {
|
|
1342
1448
|
var allValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1343
1449
|
var componentShowMap = currentTemplateAllComponentsDisplay.current;
|
|
1344
|
-
var formValue =
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1450
|
+
var formValue = {};
|
|
1451
|
+
// FIXME: 计算组件存在,此处还可能出现性能问题
|
|
1452
|
+
if (calculationTypeComponentList.length > 0) {
|
|
1453
|
+
formValue = getCalculationComponentValue({
|
|
1454
|
+
calculationTypeComponentList: calculationTypeComponentList,
|
|
1455
|
+
allValues: allValues,
|
|
1456
|
+
componentShowMap: componentShowMap
|
|
1457
|
+
});
|
|
1458
|
+
if (!isMatch(allValues, formValue)) {
|
|
1459
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, allValues), formValue));
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1350
1463
|
//缓存防止bs商品组件联动返填获取不到值
|
|
1351
1464
|
setTimeout(function () {
|
|
1352
1465
|
changeValuesCacheOrderInfo(_objectSpread(_objectSpread({}, form.getFieldsValue()), formValue), templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList);
|
|
1353
1466
|
});
|
|
1354
1467
|
};
|
|
1468
|
+
var debouncedHandleWatchFormValueChange = useMemo(function () {
|
|
1469
|
+
return debounce(handleWatchFormValueChange, 150);
|
|
1470
|
+
},
|
|
1471
|
+
// 150ms防抖
|
|
1472
|
+
[handleWatchFormValueChange]);
|
|
1355
1473
|
var changeValuesCacheOrderInfo = throttle(function (value, tempLateList) {
|
|
1356
1474
|
//如果店铺id不存在 不缓存
|
|
1357
1475
|
if (!(value !== null && value !== void 0 && value.shopId)) return;
|
|
@@ -1465,7 +1583,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1465
1583
|
}, formProps), preNodeFormItems), /*#__PURE__*/React.createElement(Form, _extends({
|
|
1466
1584
|
form: form
|
|
1467
1585
|
}, formProps, {
|
|
1468
|
-
onValuesChange:
|
|
1586
|
+
onValuesChange: debouncedHandleWatchFormValueChange
|
|
1469
1587
|
}), /*#__PURE__*/React.createElement(ShopName, {
|
|
1470
1588
|
shopList: shopList,
|
|
1471
1589
|
handleChangeShopId: handleChangeShopId,
|
|
@@ -1474,6 +1592,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1474
1592
|
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
1475
1593
|
name: "fixed_field_buyerOpenUid",
|
|
1476
1594
|
hidden: true
|
|
1595
|
+
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
1596
|
+
name: "skx_return_billNo_blur_from",
|
|
1597
|
+
hidden: true
|
|
1477
1598
|
}), finalFormItems));
|
|
1478
1599
|
};
|
|
1479
1600
|
export default /*#__PURE__*/forwardRef(FormRender);
|