@kmkf-fe-packages/kmkf-work-order-service-component 2.2.9 → 2.2.11
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/CustomerServiceToDoList/index.d.ts +3 -0
- package/dist/esm/CustomerServiceToDoList/index.js +155 -0
- package/dist/esm/CustomerServiceToDoList/index.module.less +134 -0
- package/dist/esm/FlowTemplateDetailV2/common.js +1 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +313 -228
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.d.ts +12 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.js +130 -0
- package/dist/esm/FlowTemplateDetailV2/index.js +41 -23
- package/dist/esm/FlowTemplateDetailV2/store/reducers.d.ts +2 -0
- package/dist/esm/FlowTemplateDetailV2/store/reducers.js +9 -2
- package/dist/esm/FlowTemplateDetailV2/store/selector.d.ts +1 -0
- package/dist/esm/FlowTemplateDetailV2/store/selector.js +3 -0
- package/dist/esm/WorkOrder/components/CustomerServiceToDoCard/index.d.ts +3 -0
- package/dist/esm/WorkOrder/components/CustomerServiceToDoCard/index.js +76 -0
- package/dist/esm/WorkOrder/components/CustomerServiceToDoCard/index.module.less +20 -0
- package/dist/esm/WorkOrder/components/WorkOrderList/components/CustomizeWorkOrderCard/index.js +6 -0
- package/dist/esm/WorkOrder/components/WorkOrderList/index.js +7 -2
- package/dist/esm/WorkOrder/components/WorkOrderList/index.less +4 -3
- package/dist/esm/WorkOrder/index.js +21 -1
- package/dist/esm/common/constant.d.ts +5 -0
- package/dist/esm/common/constant.js +3 -2
- package/dist/esm/common/imgs/ai.png +0 -0
- package/dist/esm/common/imgs/notification.png +0 -0
- package/dist/esm/common/utils/tools.js +20 -13
- package/dist/esm/common/utils/xzSDK.d.ts +2 -0
- package/dist/esm/common/utils/xzSDK.js +45 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/model/customizeWorkOrder/index.d.ts +1 -1
- package/dist/esm/model/customizeWorkOrder/index.js +17 -3
- package/dist/esm/model/customizeWorkOrder/types.d.ts +2 -0
- package/dist/esm/model/flowTemplateDetail/types.d.ts +1 -0
- package/dist/esm/model/servers/api.d.ts +1 -0
- package/dist/esm/model/servers/api.js +8 -0
- package/package.json +5 -5
|
@@ -43,7 +43,7 @@ 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 } from "./onBlur";
|
|
46
|
+
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo, onBlurSkxLogisticsCode, onBlurSkxReturnTHLogisticsCode } from "./onBlur";
|
|
47
47
|
import { findAllDependencies } from "./component-dependency-finder";
|
|
48
48
|
import { findValueDependencies } from "./value-mapping-finder";
|
|
49
49
|
// 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
|
|
@@ -378,160 +378,215 @@ var FormRender = function FormRender(props, ref) {
|
|
|
378
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")], []));
|
|
379
379
|
}
|
|
380
380
|
}, [labelComponent, record]);
|
|
381
|
-
var queryDetail = function
|
|
382
|
-
var
|
|
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
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
shopId: shopId,
|
|
432
|
-
shopName: newRecord.shopName,
|
|
433
|
-
submitter: newRecord.submitter,
|
|
434
|
-
created: newRecord.created,
|
|
435
|
-
processTime: newRecord.processTime
|
|
436
|
-
}));
|
|
437
|
-
var initialValues = get(transData, '0', {});
|
|
438
|
-
newRecord.preCreateAndNotModified && batchFillByMapping(initialValues);
|
|
439
|
-
orderBackReplace(transData, templateDetail);
|
|
440
|
-
// TODO: 非开始节点录入,都会有workOrderId,这里判断是否有前置组件含有订单号;如果存在订单号,进行订单反填。
|
|
441
|
-
var tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'TRADE_ID_INPUT');
|
|
442
|
-
if (tradeIdUniqueKey && shopId && record !== null && record !== void 0 && (_record$jsonMap2 = record.jsonMap) !== null && _record$jsonMap2 !== void 0 && _record$jsonMap2["".concat(tradeIdUniqueKey, "_tradeId")] && firstOrderBackfill) {
|
|
443
|
-
var _record$jsonMap3, _record$jsonMap4, _record$jsonMap5;
|
|
444
|
-
orderBack({
|
|
445
|
-
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")],
|
|
446
|
-
form: form,
|
|
447
|
-
shopId: shopId,
|
|
448
|
-
shopList: shopList,
|
|
449
|
-
templateDetail: templateDetail,
|
|
450
|
-
callback: orderBackReplace,
|
|
451
|
-
fromQNCreateWorkOrderByOrderNo: fromQNCreateWorkOrderByOrderNo,
|
|
452
|
-
plat: plat,
|
|
453
|
-
callKey: 1,
|
|
454
|
-
setLoading: setLoading
|
|
455
|
-
});
|
|
456
|
-
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);
|
|
457
|
-
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);
|
|
458
|
-
} else {
|
|
459
|
-
// 如果没有订单反填,则单独更新remark
|
|
460
|
-
fetchRemark(shopId, currentNodeTid);
|
|
461
|
-
}
|
|
462
|
-
} else {
|
|
463
|
-
fillByShopId(shopId);
|
|
464
|
-
var initFormValues = null;
|
|
465
|
-
if (plat !== null && plat !== void 0 && plat.subOrderNo) {
|
|
466
|
-
var _getCacheInfo = JSON.parse(sessionStorage.getItem('cacheOmsOrderInfo') || '{}');
|
|
467
|
-
if (plat !== null && plat !== void 0 && plat.subOrderNo && plat.buyerId) {
|
|
468
|
-
var _getCacheInfo2;
|
|
469
|
-
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];
|
|
470
|
-
}
|
|
471
|
-
} else {
|
|
472
|
-
var _getCacheInfo3 = JSON.parse(sessionStorage.getItem('cacheOrderInfo') || '{}');
|
|
473
|
-
if (orderNo && plat.buyerId) {
|
|
474
|
-
var _getCacheInfo4;
|
|
475
|
-
initFormValues = (_getCacheInfo4 = _getCacheInfo3["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)]) === null || _getCacheInfo4 === void 0 ? void 0 : _getCacheInfo4[orderNo];
|
|
476
|
-
} else if (!orderNo && plat.buyerId) {
|
|
477
|
-
initFormValues = Object.values(_getCacheInfo3["".concat(templateDetail.flowTemplateConfig.flowTemplateId, "-").concat(plat.buyerId)] || {})[0];
|
|
478
|
-
}
|
|
479
|
-
}
|
|
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);
|
|
480
431
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
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
|
+
}
|
|
508
512
|
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
//
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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();
|
|
528
583
|
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
};
|
|
584
|
+
}, _callee2);
|
|
585
|
+
}));
|
|
586
|
+
return function queryDetail(_x4) {
|
|
587
|
+
return _ref3.apply(this, arguments);
|
|
588
|
+
};
|
|
589
|
+
}();
|
|
535
590
|
useEffect(function () {
|
|
536
591
|
if (isErpUse) return;
|
|
537
592
|
queryDetail({
|
|
@@ -631,26 +686,26 @@ var FormRender = function FormRender(props, ref) {
|
|
|
631
686
|
|
|
632
687
|
// 查询标签
|
|
633
688
|
var queryLabels = /*#__PURE__*/function () {
|
|
634
|
-
var
|
|
689
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(tid, shopId) {
|
|
635
690
|
var oldLabelList, _yield$queryLabelByTr, _yield$queryLabelByTr2, data;
|
|
636
|
-
return _regeneratorRuntime().wrap(function
|
|
637
|
-
while (1) switch (
|
|
691
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
692
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
638
693
|
case 0:
|
|
639
694
|
if (!isNull(labelComponent)) {
|
|
640
|
-
|
|
695
|
+
_context3.next = 2;
|
|
641
696
|
break;
|
|
642
697
|
}
|
|
643
|
-
return
|
|
698
|
+
return _context3.abrupt("return", console.debug('当前节点不需要查询标签'));
|
|
644
699
|
case 2:
|
|
645
700
|
if (shopId) {
|
|
646
|
-
|
|
701
|
+
_context3.next = 4;
|
|
647
702
|
break;
|
|
648
703
|
}
|
|
649
|
-
return
|
|
704
|
+
return _context3.abrupt("return", console.debug('查询标签缺少必要参数-shopId'));
|
|
650
705
|
case 4:
|
|
651
706
|
oldLabelList = form.getFieldValue("".concat(labelComponent.uniqueKey));
|
|
652
707
|
if (tid) {
|
|
653
|
-
|
|
708
|
+
_context3.next = 9;
|
|
654
709
|
break;
|
|
655
710
|
}
|
|
656
711
|
setLabelList(function (list) {
|
|
@@ -660,15 +715,15 @@ var FormRender = function FormRender(props, ref) {
|
|
|
660
715
|
if (oldLabelList.length !== 0) {
|
|
661
716
|
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), []));
|
|
662
717
|
}
|
|
663
|
-
return
|
|
718
|
+
return _context3.abrupt("return", console.debug('查询标签缺少必要参数-tradeId'));
|
|
664
719
|
case 9:
|
|
665
|
-
|
|
720
|
+
_context3.next = 11;
|
|
666
721
|
return queryLabelByTradeId({
|
|
667
722
|
tid: tid,
|
|
668
723
|
shopId: shopId
|
|
669
724
|
});
|
|
670
725
|
case 11:
|
|
671
|
-
_yield$queryLabelByTr =
|
|
726
|
+
_yield$queryLabelByTr = _context3.sent;
|
|
672
727
|
_yield$queryLabelByTr2 = _yield$queryLabelByTr.data;
|
|
673
728
|
data = _yield$queryLabelByTr2 === void 0 ? [] : _yield$queryLabelByTr2;
|
|
674
729
|
setLabelList(function (list) {
|
|
@@ -680,50 +735,50 @@ var FormRender = function FormRender(props, ref) {
|
|
|
680
735
|
}
|
|
681
736
|
case 16:
|
|
682
737
|
case "end":
|
|
683
|
-
return
|
|
738
|
+
return _context3.stop();
|
|
684
739
|
}
|
|
685
|
-
},
|
|
740
|
+
}, _callee3);
|
|
686
741
|
}));
|
|
687
|
-
return function queryLabels(
|
|
688
|
-
return
|
|
742
|
+
return function queryLabels(_x5, _x6) {
|
|
743
|
+
return _ref4.apply(this, arguments);
|
|
689
744
|
};
|
|
690
745
|
}();
|
|
691
746
|
// 查询会员等级
|
|
692
747
|
var queryMemberLevels = /*#__PURE__*/function () {
|
|
693
|
-
var
|
|
748
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(tid, shopId) {
|
|
694
749
|
var oldMemberLevel, _yield$queryMemberLev, _yield$queryMemberLev2, data;
|
|
695
|
-
return _regeneratorRuntime().wrap(function
|
|
696
|
-
while (1) switch (
|
|
750
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
751
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
697
752
|
case 0:
|
|
698
753
|
if (!isNull(memberLevelComponent)) {
|
|
699
|
-
|
|
754
|
+
_context4.next = 2;
|
|
700
755
|
break;
|
|
701
756
|
}
|
|
702
|
-
return
|
|
757
|
+
return _context4.abrupt("return", console.debug('当前节点不需要查询会员等级'));
|
|
703
758
|
case 2:
|
|
704
759
|
if (shopId) {
|
|
705
|
-
|
|
760
|
+
_context4.next = 4;
|
|
706
761
|
break;
|
|
707
762
|
}
|
|
708
|
-
return
|
|
763
|
+
return _context4.abrupt("return", console.debug('查询标签缺少必要参数-shopId'));
|
|
709
764
|
case 4:
|
|
710
765
|
oldMemberLevel = form.getFieldValue("".concat(labelComponent.uniqueKey));
|
|
711
766
|
if (tid) {
|
|
712
|
-
|
|
767
|
+
_context4.next = 8;
|
|
713
768
|
break;
|
|
714
769
|
}
|
|
715
770
|
if (oldMemberLevel.length !== 0) {
|
|
716
771
|
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), []));
|
|
717
772
|
}
|
|
718
|
-
return
|
|
773
|
+
return _context4.abrupt("return", console.debug('查询标签缺少必要参数-tradeId'));
|
|
719
774
|
case 8:
|
|
720
|
-
|
|
775
|
+
_context4.next = 10;
|
|
721
776
|
return queryMemberLevel({
|
|
722
777
|
tid: tid,
|
|
723
778
|
shopId: shopId
|
|
724
779
|
});
|
|
725
780
|
case 10:
|
|
726
|
-
_yield$queryMemberLev =
|
|
781
|
+
_yield$queryMemberLev = _context4.sent;
|
|
727
782
|
_yield$queryMemberLev2 = _yield$queryMemberLev.data;
|
|
728
783
|
data = _yield$queryMemberLev2 === void 0 ? [] : _yield$queryMemberLev2;
|
|
729
784
|
if (!isEqual(oldMemberLevel, data)) {
|
|
@@ -731,31 +786,31 @@ var FormRender = function FormRender(props, ref) {
|
|
|
731
786
|
}
|
|
732
787
|
case 14:
|
|
733
788
|
case "end":
|
|
734
|
-
return
|
|
789
|
+
return _context4.stop();
|
|
735
790
|
}
|
|
736
|
-
},
|
|
791
|
+
}, _callee4);
|
|
737
792
|
}));
|
|
738
|
-
return function queryMemberLevels(
|
|
739
|
-
return
|
|
793
|
+
return function queryMemberLevels(_x7, _x8) {
|
|
794
|
+
return _ref5.apply(this, arguments);
|
|
740
795
|
};
|
|
741
796
|
}();
|
|
742
797
|
|
|
743
798
|
//订单返填
|
|
744
799
|
var changeHandle = /*#__PURE__*/function () {
|
|
745
|
-
var
|
|
746
|
-
return _regeneratorRuntime().wrap(function
|
|
747
|
-
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) {
|
|
748
803
|
case 0:
|
|
749
804
|
if (order_no) {
|
|
750
|
-
|
|
805
|
+
_context5.next = 2;
|
|
751
806
|
break;
|
|
752
807
|
}
|
|
753
|
-
return
|
|
808
|
+
return _context5.abrupt("return");
|
|
754
809
|
case 2:
|
|
755
810
|
// console.log('[订单返填 changeHandle order_no ] >', order_no);
|
|
756
811
|
|
|
757
812
|
sessionStorage.setItem('order_no_test', order_no);
|
|
758
|
-
|
|
813
|
+
_context5.next = 5;
|
|
759
814
|
return orderBack({
|
|
760
815
|
order_no: order_no,
|
|
761
816
|
form: form,
|
|
@@ -778,12 +833,12 @@ var FormRender = function FormRender(props, ref) {
|
|
|
778
833
|
});
|
|
779
834
|
case 5:
|
|
780
835
|
case "end":
|
|
781
|
-
return
|
|
836
|
+
return _context5.stop();
|
|
782
837
|
}
|
|
783
|
-
},
|
|
838
|
+
}, _callee5);
|
|
784
839
|
}));
|
|
785
|
-
return function changeHandle(
|
|
786
|
-
return
|
|
840
|
+
return function changeHandle(_x9) {
|
|
841
|
+
return _ref6.apply(this, arguments);
|
|
787
842
|
};
|
|
788
843
|
}();
|
|
789
844
|
// 组件值变化
|
|
@@ -864,16 +919,16 @@ var FormRender = function FormRender(props, ref) {
|
|
|
864
919
|
|
|
865
920
|
//组件失焦事件
|
|
866
921
|
var componentOnBlur = /*#__PURE__*/function () {
|
|
867
|
-
var
|
|
922
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(value, type) {
|
|
868
923
|
var promises;
|
|
869
|
-
return _regeneratorRuntime().wrap(function
|
|
870
|
-
while (1) switch (
|
|
924
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
925
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
871
926
|
case 0:
|
|
872
927
|
if (!(type === 'erpAfterSaleTradeId')) {
|
|
873
|
-
|
|
928
|
+
_context6.next = 5;
|
|
874
929
|
break;
|
|
875
930
|
}
|
|
876
|
-
|
|
931
|
+
_context6.next = 3;
|
|
877
932
|
return onBlurErpAfterSaleTradeId({
|
|
878
933
|
form: form,
|
|
879
934
|
value: value,
|
|
@@ -881,14 +936,14 @@ var FormRender = function FormRender(props, ref) {
|
|
|
881
936
|
setKmLoading: setKmLoading
|
|
882
937
|
});
|
|
883
938
|
case 3:
|
|
884
|
-
|
|
939
|
+
_context6.next = 41;
|
|
885
940
|
break;
|
|
886
941
|
case 5:
|
|
887
942
|
if (!(type === 'expressLogisticsCode')) {
|
|
888
|
-
|
|
943
|
+
_context6.next = 13;
|
|
889
944
|
break;
|
|
890
945
|
}
|
|
891
|
-
|
|
946
|
+
_context6.next = 8;
|
|
892
947
|
return onBlurExpressLogisticsCode({
|
|
893
948
|
form: form,
|
|
894
949
|
value: value,
|
|
@@ -897,41 +952,68 @@ var FormRender = function FormRender(props, ref) {
|
|
|
897
952
|
componentOnBlur: componentOnBlur
|
|
898
953
|
});
|
|
899
954
|
case 8:
|
|
900
|
-
|
|
955
|
+
if (!['TR3E2FYXFZCFANVG6O6AALSM', 'SZF4ZGWZSNW6PYXMCIFEWBXT'].includes(companyKey)) {
|
|
956
|
+
_context6.next = 11;
|
|
957
|
+
break;
|
|
958
|
+
}
|
|
959
|
+
_context6.next = 11;
|
|
960
|
+
return onBlurSkxLogisticsCode({
|
|
961
|
+
form: form,
|
|
962
|
+
value: value,
|
|
963
|
+
templateDetail: templateDetail,
|
|
964
|
+
componentOnBlur: componentOnBlur
|
|
965
|
+
});
|
|
966
|
+
case 11:
|
|
967
|
+
_context6.next = 41;
|
|
901
968
|
break;
|
|
902
|
-
case
|
|
969
|
+
case 13:
|
|
903
970
|
if (!(type === 'skxOutboundNoticeNo')) {
|
|
904
|
-
|
|
971
|
+
_context6.next = 19;
|
|
905
972
|
break;
|
|
906
973
|
}
|
|
907
974
|
//[SKX]ON出库通知单号 返填
|
|
908
975
|
console.log('skxOutboundNoticeNo', value);
|
|
909
|
-
|
|
976
|
+
_context6.next = 17;
|
|
910
977
|
return onBlurSkxOutboundNoticeNo({
|
|
911
978
|
form: form,
|
|
912
979
|
value: value,
|
|
913
980
|
templateDetail: templateDetail,
|
|
914
981
|
componentOnBlur: componentOnBlur
|
|
915
982
|
});
|
|
916
|
-
case
|
|
917
|
-
|
|
983
|
+
case 17:
|
|
984
|
+
_context6.next = 41;
|
|
918
985
|
break;
|
|
919
|
-
case
|
|
986
|
+
case 19:
|
|
920
987
|
if (!(type === 'skxReturnBillNo')) {
|
|
921
|
-
|
|
988
|
+
_context6.next = 24;
|
|
922
989
|
break;
|
|
923
990
|
}
|
|
924
|
-
|
|
991
|
+
_context6.next = 22;
|
|
925
992
|
return onBlurSkxReturnBillNo({
|
|
926
993
|
form: form,
|
|
927
994
|
value: value,
|
|
928
995
|
templateDetail: templateDetail,
|
|
929
996
|
componentOnBlur: componentOnBlur
|
|
930
997
|
});
|
|
931
|
-
case
|
|
932
|
-
|
|
998
|
+
case 22:
|
|
999
|
+
_context6.next = 41;
|
|
1000
|
+
break;
|
|
1001
|
+
case 24:
|
|
1002
|
+
if (!(type === 'skxReturnTHLogisticsCode')) {
|
|
1003
|
+
_context6.next = 29;
|
|
1004
|
+
break;
|
|
1005
|
+
}
|
|
1006
|
+
_context6.next = 27;
|
|
1007
|
+
return onBlurSkxReturnTHLogisticsCode({
|
|
1008
|
+
form: form,
|
|
1009
|
+
value: value,
|
|
1010
|
+
templateDetail: templateDetail,
|
|
1011
|
+
componentOnBlur: componentOnBlur
|
|
1012
|
+
});
|
|
1013
|
+
case 27:
|
|
1014
|
+
_context6.next = 41;
|
|
933
1015
|
break;
|
|
934
|
-
case
|
|
1016
|
+
case 29:
|
|
935
1017
|
// 收集所有需要执行的异步操作
|
|
936
1018
|
promises = [];
|
|
937
1019
|
if (type === 'tradeId') {
|
|
@@ -943,7 +1025,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
943
1025
|
promises.push(handleChangeTradeId(value));
|
|
944
1026
|
}
|
|
945
1027
|
if (value) {
|
|
946
|
-
|
|
1028
|
+
_context6.next = 36;
|
|
947
1029
|
break;
|
|
948
1030
|
}
|
|
949
1031
|
setReplaceValue(function (prev) {
|
|
@@ -953,26 +1035,26 @@ var FormRender = function FormRender(props, ref) {
|
|
|
953
1035
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, type, 0));
|
|
954
1036
|
});
|
|
955
1037
|
replaceValueRef.current = _objectSpread(_objectSpread({}, replaceValue), {}, _defineProperty({}, type, 0));
|
|
956
|
-
return
|
|
957
|
-
case
|
|
1038
|
+
return _context6.abrupt("return");
|
|
1039
|
+
case 36:
|
|
958
1040
|
promises.push(queryReplaceCount(_defineProperty({}, type, value), templateDetail));
|
|
959
1041
|
// TODO: ERP不走订单反弹逻辑
|
|
960
1042
|
if ((type === 'tradeId' || type === 'enterprisePaymentTid') && !isErpUse) {
|
|
961
1043
|
promises.push(changeHandle(value));
|
|
962
1044
|
}
|
|
963
1045
|
// 等待所有异步操作完成
|
|
964
|
-
|
|
1046
|
+
_context6.next = 40;
|
|
965
1047
|
return Promise.all(promises);
|
|
966
|
-
case
|
|
967
|
-
return
|
|
968
|
-
case
|
|
1048
|
+
case 40:
|
|
1049
|
+
return _context6.abrupt("return", Promise.resolve());
|
|
1050
|
+
case 41:
|
|
969
1051
|
case "end":
|
|
970
|
-
return
|
|
1052
|
+
return _context6.stop();
|
|
971
1053
|
}
|
|
972
|
-
},
|
|
1054
|
+
}, _callee6);
|
|
973
1055
|
}));
|
|
974
|
-
return function componentOnBlur(
|
|
975
|
-
return
|
|
1056
|
+
return function componentOnBlur(_x10, _x11) {
|
|
1057
|
+
return _ref7.apply(this, arguments);
|
|
976
1058
|
};
|
|
977
1059
|
}();
|
|
978
1060
|
// 切换店铺
|
|
@@ -1176,9 +1258,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1176
1258
|
var newComponentConfig = _objectSpread(_objectSpread({}, componentConfig), {}, {
|
|
1177
1259
|
disabled: disabled
|
|
1178
1260
|
});
|
|
1179
|
-
var
|
|
1180
|
-
upgrade =
|
|
1181
|
-
created =
|
|
1261
|
+
var _ref8 = (componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.status) || {},
|
|
1262
|
+
upgrade = _ref8.upgrade,
|
|
1263
|
+
created = _ref8.created;
|
|
1182
1264
|
if (['REISSUE_TRADE_ID', 'EXCHANGE_TRADE_ID', 'ERP_AFTER_SALE_TRADE_ID'].includes(workOrderComponentType)) {
|
|
1183
1265
|
// 售后单id、补发单id和换货单id默认值是可见不可编辑(2)
|
|
1184
1266
|
if (typeof upgrade !== 'number') {
|
|
@@ -1247,8 +1329,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1247
1329
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
1248
1330
|
noStyle: true,
|
|
1249
1331
|
dependencies: _toConsumableArray(new Set(dependencies.concat(currentDependenciesMappingComponent)))
|
|
1250
|
-
}, function (
|
|
1251
|
-
var getFieldValue =
|
|
1332
|
+
}, function (_ref9) {
|
|
1333
|
+
var getFieldValue = _ref9.getFieldValue;
|
|
1252
1334
|
var show = currentIdDependenceOtherFields === null || currentIdDependenceOtherFields === void 0 ? void 0 : currentIdDependenceOtherFields.reduce(function (cur, nxt) {
|
|
1253
1335
|
// 如果有一项满足展示条件则展示
|
|
1254
1336
|
if (cur) {
|
|
@@ -1494,6 +1576,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1494
1576
|
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
1495
1577
|
name: "fixed_field_buyerOpenUid",
|
|
1496
1578
|
hidden: true
|
|
1579
|
+
}), /*#__PURE__*/React.createElement(Form.Item, {
|
|
1580
|
+
name: "skx_return_billNo_blur_from",
|
|
1581
|
+
hidden: true
|
|
1497
1582
|
}), finalFormItems));
|
|
1498
1583
|
};
|
|
1499
1584
|
export default /*#__PURE__*/forwardRef(FormRender);
|