@kmkf-fe-packages/kmkf-work-order-service-component 2.2.5-beta.35 → 2.2.5-beta.37
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.
|
@@ -46,6 +46,7 @@ import { orderBackKmAddress } from "./constants";
|
|
|
46
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
|
+
import { skxOrderBack } from "./skxOrderBack";
|
|
49
50
|
// 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
|
|
50
51
|
// TODO: 用useState会有bug, 不确定是哪里导致的
|
|
51
52
|
var hideByXYComponentsMap = {};
|
|
@@ -410,7 +411,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
410
411
|
return prv;
|
|
411
412
|
}, {});
|
|
412
413
|
if (!workOrderId) {
|
|
413
|
-
_context2.next =
|
|
414
|
+
_context2.next = 39;
|
|
414
415
|
break;
|
|
415
416
|
}
|
|
416
417
|
// 先初始化端上内容
|
|
@@ -442,7 +443,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
442
443
|
// TODO: 非开始节点录入,都会有workOrderId,这里判断是否有前置组件含有订单号;如果存在订单号,进行订单反填。
|
|
443
444
|
tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'TRADE_ID_INPUT');
|
|
444
445
|
if (!newRecord.notAutoFillWithFirstSubmit) {
|
|
445
|
-
_context2.next =
|
|
446
|
+
_context2.next = 29;
|
|
446
447
|
break;
|
|
447
448
|
}
|
|
448
449
|
_tradeIdUniqueKey = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList, 'TRADE_ID_INPUT');
|
|
@@ -462,16 +463,24 @@ var FormRender = function FormRender(props, ref) {
|
|
|
462
463
|
setLoading: setLoading
|
|
463
464
|
});
|
|
464
465
|
case 25:
|
|
465
|
-
_context2.next =
|
|
466
|
-
|
|
466
|
+
_context2.next = 27;
|
|
467
|
+
return skxOrderBack({
|
|
468
|
+
form: form,
|
|
469
|
+
companyKey: companyKey,
|
|
470
|
+
templateDetail: templateDetail,
|
|
471
|
+
componentOnBlur: componentOnBlur
|
|
472
|
+
});
|
|
467
473
|
case 27:
|
|
474
|
+
_context2.next = 37;
|
|
475
|
+
break;
|
|
476
|
+
case 29:
|
|
468
477
|
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 =
|
|
478
|
+
_context2.next = 36;
|
|
470
479
|
break;
|
|
471
480
|
}
|
|
472
481
|
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
482
|
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 =
|
|
483
|
+
_context2.next = 34;
|
|
475
484
|
return orderBack({
|
|
476
485
|
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
486
|
form: form,
|
|
@@ -484,16 +493,16 @@ var FormRender = function FormRender(props, ref) {
|
|
|
484
493
|
callKey: 1,
|
|
485
494
|
setLoading: setLoading
|
|
486
495
|
});
|
|
487
|
-
case 32:
|
|
488
|
-
_context2.next = 35;
|
|
489
|
-
break;
|
|
490
496
|
case 34:
|
|
497
|
+
_context2.next = 37;
|
|
498
|
+
break;
|
|
499
|
+
case 36:
|
|
491
500
|
// 如果没有订单反填,则单独更新remark
|
|
492
501
|
fetchRemark(shopId, currentNodeTid);
|
|
493
|
-
case 35:
|
|
494
|
-
_context2.next = 60;
|
|
495
|
-
break;
|
|
496
502
|
case 37:
|
|
503
|
+
_context2.next = 62;
|
|
504
|
+
break;
|
|
505
|
+
case 39:
|
|
497
506
|
fillByShopId(shopId);
|
|
498
507
|
initFormValues = null;
|
|
499
508
|
if (plat !== null && plat !== void 0 && plat.subOrderNo) {
|
|
@@ -512,7 +521,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
512
521
|
|
|
513
522
|
// console.log(orderNo, initFormValues);
|
|
514
523
|
if (!initFormValues) {
|
|
515
|
-
_context2.next =
|
|
524
|
+
_context2.next = 50;
|
|
516
525
|
break;
|
|
517
526
|
}
|
|
518
527
|
form.setFieldsValue(_objectSpread(_objectSpread({}, initFormValues), {}, {
|
|
@@ -529,9 +538,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
529
538
|
_orderNo = orderNoField !== null && orderNoField !== void 0 && orderNoField.uniqueKey ? initFormValues[orderNoField === null || orderNoField === void 0 ? void 0 : orderNoField.uniqueKey] || _orderNo : _orderNo;
|
|
530
539
|
}
|
|
531
540
|
fetchRemark(_shopId, _orderNo);
|
|
532
|
-
_context2.next =
|
|
541
|
+
_context2.next = 62;
|
|
533
542
|
break;
|
|
534
|
-
case
|
|
543
|
+
case 50:
|
|
535
544
|
_transData = calcWorkOrderList([{
|
|
536
545
|
jsonMap: jsonMap
|
|
537
546
|
}], [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || [])), 'init');
|
|
@@ -543,12 +552,12 @@ var FormRender = function FormRender(props, ref) {
|
|
|
543
552
|
batchFillByMapping(_initialValues);
|
|
544
553
|
//如果有订单号 订单返填 通过订单号入口进行工单录入,需要将订单数据反填到工单
|
|
545
554
|
if (!(orderNo && shopId)) {
|
|
546
|
-
_context2.next =
|
|
555
|
+
_context2.next = 61;
|
|
547
556
|
break;
|
|
548
557
|
}
|
|
549
558
|
queryLabels(orderNo, shopId);
|
|
550
559
|
queryMemberLevels(orderNo, shopId);
|
|
551
|
-
_context2.next =
|
|
560
|
+
_context2.next = 59;
|
|
552
561
|
return orderBack({
|
|
553
562
|
order_no: orderNo,
|
|
554
563
|
form: form,
|
|
@@ -562,13 +571,13 @@ var FormRender = function FormRender(props, ref) {
|
|
|
562
571
|
callKey: 2,
|
|
563
572
|
setLoading: setLoading
|
|
564
573
|
});
|
|
565
|
-
case 57:
|
|
566
|
-
_context2.next = 60;
|
|
567
|
-
break;
|
|
568
574
|
case 59:
|
|
575
|
+
_context2.next = 62;
|
|
576
|
+
break;
|
|
577
|
+
case 61:
|
|
569
578
|
// 如果没有订单反填,则单独更新remark
|
|
570
579
|
fetchRemark(shopId, currentNodeTid);
|
|
571
|
-
case
|
|
580
|
+
case 62:
|
|
572
581
|
antFormEl = document.getElementsByClassName('ant-form');
|
|
573
582
|
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
|
574
583
|
resetMappingHideComponents();
|
|
@@ -577,7 +586,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
577
586
|
type: 'setaAutoSubmitFlag',
|
|
578
587
|
payload: true
|
|
579
588
|
});
|
|
580
|
-
case
|
|
589
|
+
case 66:
|
|
581
590
|
case "end":
|
|
582
591
|
return _context2.stop();
|
|
583
592
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FormInstance } from 'antd';
|
|
2
|
+
export declare type skxOrderBackParamsType = {
|
|
3
|
+
companyKey: string;
|
|
4
|
+
templateDetail: any;
|
|
5
|
+
componentOnBlur: (value: any, type: string) => Promise<void>;
|
|
6
|
+
form: FormInstance;
|
|
7
|
+
};
|
|
8
|
+
export declare const skxOrderBack: ({ companyKey, templateDetail, form, componentOnBlur, }: skxOrderBackParamsType) => Promise<void>;
|
|
@@ -0,0 +1,116 @@
|
|
|
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 _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import { get } from 'lodash';
|
|
6
|
+
import { onBlurSkxLogisticsCode, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo } from "./onBlur";
|
|
7
|
+
import { findComponentUniqueKeyByType } from "../../../common/utils/tools";
|
|
8
|
+
var isMatchCompanyKey = function isMatchCompanyKey(companyKey) {
|
|
9
|
+
return ['TR3E2FYXFZCFANVG6O6AALSM', 'SZF4ZGWZSNW6PYXMCIFEWBXT'].includes(companyKey);
|
|
10
|
+
};
|
|
11
|
+
var existSkxReturnLogisticsComponent = function existSkxReturnLogisticsComponent(templateDetail) {
|
|
12
|
+
return get(templateDetail, 'componentDtoList', []).some(function (item) {
|
|
13
|
+
return ['SKX_RETURN_LOGISTICS'].includes(item.workOrderComponentType);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var existSkxOutBoundNoticeComponent = function existSkxOutBoundNoticeComponent(templateDetail) {
|
|
17
|
+
return get(templateDetail, 'componentDtoList', []).some(function (item) {
|
|
18
|
+
return ['SKX_OUTBOUND_NOTICE_NO'].includes(item.workOrderComponentType);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
var existSkxReturnBillNoComponent = function existSkxReturnBillNoComponent(templateDetail) {
|
|
22
|
+
return get(templateDetail, 'componentDtoList', []).some(function (item) {
|
|
23
|
+
return ['SKX_RETURN_BILL_NO'].includes(item.workOrderComponentType);
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var existExpressLogisticsSelectComponent = function existExpressLogisticsSelectComponent(templateDetail) {
|
|
27
|
+
return get(templateDetail, 'componentDtoList', []).some(function (item) {
|
|
28
|
+
return ['EXPRESS_LOGISTICS_SELECT'].includes(item.workOrderComponentType);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
var getSkxReturnLogisticsFromValue = function getSkxReturnLogisticsFromValue(form, templateDetail) {
|
|
32
|
+
var _findComponentUniqueK;
|
|
33
|
+
var skxReturnLogisticsUniqueKey = (_findComponentUniqueK = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'SKX_RETURN_LOGISTICS')) !== null && _findComponentUniqueK !== void 0 ? _findComponentUniqueK : '';
|
|
34
|
+
return form.getFieldValue("".concat(skxReturnLogisticsUniqueKey, "_skxReturnLogistics_skxReturnLogisticsCode"));
|
|
35
|
+
};
|
|
36
|
+
var getSkxOutBoundNoticeFromValue = function getSkxOutBoundNoticeFromValue(form, templateDetail) {
|
|
37
|
+
var _findComponentUniqueK2;
|
|
38
|
+
var skxOutBoundNoticeUniqueKey = (_findComponentUniqueK2 = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'SKX_OUTBOUND_NOTICE_NO')) !== null && _findComponentUniqueK2 !== void 0 ? _findComponentUniqueK2 : '';
|
|
39
|
+
return form.getFieldValue("".concat(skxOutBoundNoticeUniqueKey, "_skxOutboundNoticeNo"));
|
|
40
|
+
};
|
|
41
|
+
var getSkxReturnBillNoFromValue = function getSkxReturnBillNoFromValue(form, templateDetail) {
|
|
42
|
+
var _findComponentUniqueK3;
|
|
43
|
+
var skxOutBoundNoticeUniqueKey = (_findComponentUniqueK3 = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'SKX_RETURN_BILL_NO')) !== null && _findComponentUniqueK3 !== void 0 ? _findComponentUniqueK3 : '';
|
|
44
|
+
return form.getFieldValue("".concat(skxOutBoundNoticeUniqueKey, "_skxReturnBillNo"));
|
|
45
|
+
};
|
|
46
|
+
var getExpressLogisticsFromValue = function getExpressLogisticsFromValue(form, templateDetail) {
|
|
47
|
+
var _findComponentUniqueK4;
|
|
48
|
+
var skxOutBoundNoticeUniqueKey = (_findComponentUniqueK4 = findComponentUniqueKeyByType(templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList, 'EXPRESS_LOGISTICS_SELECT')) !== null && _findComponentUniqueK4 !== void 0 ? _findComponentUniqueK4 : '';
|
|
49
|
+
return form.getFieldValue("".concat(skxOutBoundNoticeUniqueKey, "_expressLogisticsCode"));
|
|
50
|
+
};
|
|
51
|
+
export var skxOrderBack = /*#__PURE__*/function () {
|
|
52
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
53
|
+
var companyKey, templateDetail, form, componentOnBlur, skxReturnLogistics, promises, skxOutBoundNotice, skxReturnBillNo, expressLogistics;
|
|
54
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
55
|
+
while (1) switch (_context.prev = _context.next) {
|
|
56
|
+
case 0:
|
|
57
|
+
companyKey = _ref.companyKey, templateDetail = _ref.templateDetail, form = _ref.form, componentOnBlur = _ref.componentOnBlur;
|
|
58
|
+
if (isMatchCompanyKey(companyKey)) {
|
|
59
|
+
_context.next = 3;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
return _context.abrupt("return");
|
|
63
|
+
case 3:
|
|
64
|
+
if (!existSkxReturnLogisticsComponent(templateDetail)) {
|
|
65
|
+
_context.next = 7;
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
skxReturnLogistics = getSkxReturnLogisticsFromValue(form, templateDetail);
|
|
69
|
+
_context.next = 7;
|
|
70
|
+
return onBlurSkxLogisticsCode({
|
|
71
|
+
form: form,
|
|
72
|
+
value: skxReturnLogistics,
|
|
73
|
+
templateDetail: templateDetail,
|
|
74
|
+
componentOnBlur: componentOnBlur
|
|
75
|
+
});
|
|
76
|
+
case 7:
|
|
77
|
+
promises = [];
|
|
78
|
+
if (existSkxOutBoundNoticeComponent(templateDetail)) {
|
|
79
|
+
skxOutBoundNotice = getSkxOutBoundNoticeFromValue(form, templateDetail);
|
|
80
|
+
promises.push(onBlurSkxOutboundNoticeNo({
|
|
81
|
+
form: form,
|
|
82
|
+
value: skxOutBoundNotice,
|
|
83
|
+
templateDetail: templateDetail,
|
|
84
|
+
componentOnBlur: componentOnBlur
|
|
85
|
+
}));
|
|
86
|
+
}
|
|
87
|
+
if (existSkxReturnBillNoComponent(templateDetail)) {
|
|
88
|
+
skxReturnBillNo = getSkxReturnBillNoFromValue(form, templateDetail);
|
|
89
|
+
promises.push(onBlurSkxReturnBillNo({
|
|
90
|
+
form: form,
|
|
91
|
+
value: skxReturnBillNo,
|
|
92
|
+
templateDetail: templateDetail,
|
|
93
|
+
componentOnBlur: componentOnBlur
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
if (existExpressLogisticsSelectComponent(templateDetail)) {
|
|
97
|
+
expressLogistics = getExpressLogisticsFromValue(form, templateDetail);
|
|
98
|
+
promises.push(onBlurSkxLogisticsCode({
|
|
99
|
+
form: form,
|
|
100
|
+
value: expressLogistics,
|
|
101
|
+
templateDetail: templateDetail,
|
|
102
|
+
componentOnBlur: componentOnBlur
|
|
103
|
+
}));
|
|
104
|
+
}
|
|
105
|
+
_context.next = 13;
|
|
106
|
+
return Promise.all(promises);
|
|
107
|
+
case 13:
|
|
108
|
+
case "end":
|
|
109
|
+
return _context.stop();
|
|
110
|
+
}
|
|
111
|
+
}, _callee);
|
|
112
|
+
}));
|
|
113
|
+
return function skxOrderBack(_x) {
|
|
114
|
+
return _ref2.apply(this, arguments);
|
|
115
|
+
};
|
|
116
|
+
}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-work-order-service-component",
|
|
3
|
-
"version": "2.2.5-beta.
|
|
3
|
+
"version": "2.2.5-beta.37",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/icons": "^4.7.0",
|
|
35
|
-
"@kmkf-fe-packages/basic-components": "2.2.5-beta.
|
|
35
|
+
"@kmkf-fe-packages/basic-components": "2.2.5-beta.37",
|
|
36
36
|
"@kmkf-fe-packages/kmkf-utils": "2.2.5-beta.28",
|
|
37
|
-
"@kmkf-fe-packages/services-components": "2.2.5-beta.
|
|
37
|
+
"@kmkf-fe-packages/services-components": "2.2.5-beta.37",
|
|
38
38
|
"@reduxjs/toolkit": "^1.8.5",
|
|
39
39
|
"ahooks": "^3.7.4",
|
|
40
40
|
"copy-to-clipboard": "^3.3.3",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"publishConfig": {
|
|
75
75
|
"access": "public"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "831aa90d44dcb20b71c75a59a09d29320c26eed2",
|
|
78
78
|
"gitHooks": {
|
|
79
79
|
"pre-commit": "lint-staged"
|
|
80
80
|
}
|