kmkf-work-order-service-component 0.4.11 → 0.4.13-alpha.1
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/FormRender/index.js +42 -7
- package/dist/esm/FormRender/index.less +1 -1
- package/dist/esm/SingleShopWorkOrder/components/Card/index.less +1 -1
- package/dist/esm/SingleShopWorkOrder/components/CustomizeFormModal/index.js +4 -4
- package/dist/esm/SingleShopWorkOrder/components/CustomizeFormModal/index.less +1 -1
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeWorkOrderCard/index.js +40 -3
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeWorkOrderCard/index.less +1 -1
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/RecordLog/index.js +2 -2
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/RepeatWorkOrderListModal/index.d.ts +4 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/RepeatWorkOrderListModal/index.js +168 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/RepeatWorkOrderListModal/index.less +30 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.js +9 -3
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/PaymentWorkOrderCard/index.js +62 -13
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/PaymentWorkOrderCard/index.less +5 -0
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/RepeatWorkOrderListModal/index.d.ts +4 -0
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/RepeatWorkOrderListModal/index.js +49 -0
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/RepeatWorkOrderListModal/index.less +21 -0
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/index.js +4 -2
- package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.d.ts +3 -1
- package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.js +48 -10
- package/dist/esm/WorkOrder/components/Widget/index.d.ts +5 -1
- package/dist/esm/WorkOrder/components/Widget/index.js +16 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstItemSelect/index.d.ts +17 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstItemSelect/index.js +129 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstLogistics/index.d.ts +14 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstLogistics/index.js +121 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSendGood/index.d.ts +14 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSendGood/index.js +129 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSupply/index.d.ts +14 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSupply/index.js +117 -0
- package/dist/esm/assets/repeat.png +0 -0
- package/dist/esm/common/utils/express.d.ts +1 -0
- package/dist/esm/common/utils/express.js +7 -1
- package/dist/esm/common/utils/tools.d.ts +5 -1
- package/dist/esm/common/utils/tools.js +431 -181
- package/dist/esm/model/customizeWorkOrder/index.d.ts +2 -2
- package/dist/esm/model/customizeWorkOrder/index.js +18 -5
- package/dist/esm/model/customizeWorkOrder/selector.d.ts +24 -0
- package/dist/esm/model/customizeWorkOrder/selector.js +6 -0
- package/dist/esm/model/customizeWorkOrder/types.d.ts +11 -0
- package/dist/esm/model/paymentWorkOrder/index.d.ts +1 -1
- package/dist/esm/model/paymentWorkOrder/index.js +16 -3
- package/dist/esm/model/paymentWorkOrder/selector.d.ts +31 -0
- package/dist/esm/model/paymentWorkOrder/selector.js +6 -0
- package/dist/esm/model/paymentWorkOrder/types.d.ts +2 -0
- package/dist/esm/model/servers/api.d.ts +2 -0
- package/dist/esm/model/servers/api.js +16 -0
- package/dist/esm/model/workOrder.js +5 -4
- package/package.json +2 -2
@@ -1,3 +1,11 @@
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
2
|
+
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
6
|
+
|
7
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
8
|
+
|
1
9
|
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, $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 generator._invoke = function (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); } }; }(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; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return 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, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), 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 (object) { var 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; }
|
2
10
|
|
3
11
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
@@ -26,7 +34,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
26
34
|
|
27
35
|
import { get, isEmpty, find, keys, every } from 'lodash';
|
28
36
|
import V from 'voca';
|
29
|
-
import { orderDetail,
|
37
|
+
import { orderDetail, jstOrderDetail } from "../../model/servers/api";
|
30
38
|
import moment from 'moment';
|
31
39
|
import express from "./express";
|
32
40
|
import cache from "../cache";
|
@@ -434,6 +442,110 @@ export var submitDataTransOldFormat = function submitDataTransOldFormat(nowData,
|
|
434
442
|
}).join(),
|
435
443
|
name: item.name
|
436
444
|
});
|
445
|
+
} else if (item.workOrderComponentType === 'JST_LOGISTICS') {
|
446
|
+
var logisticsList = get(nowData, "".concat(item.uniqueKey), []); //判断单个组件是否有输入值 没有就传空
|
447
|
+
// if (
|
448
|
+
// logisticsList.length === 1 &&
|
449
|
+
// !logisticsList[0]?.items?.length &&
|
450
|
+
// logisticsList.some((t) => {
|
451
|
+
// return !t.logisticsCompany && !t.logisticsCode;
|
452
|
+
// })
|
453
|
+
// ) {
|
454
|
+
// logisticsList = [];
|
455
|
+
// }
|
456
|
+
|
457
|
+
contentVoList.push({
|
458
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
459
|
+
content: JSON.stringify(logisticsList),
|
460
|
+
name: item.name
|
461
|
+
});
|
462
|
+
contentVoList.push({
|
463
|
+
uniqueKey: "".concat(item.uniqueKey, "_logisticsCompany"),
|
464
|
+
content: logisticsList.map(function (item) {
|
465
|
+
return item.logisticsCompany;
|
466
|
+
}).join(),
|
467
|
+
name: item.name
|
468
|
+
});
|
469
|
+
contentVoList.push({
|
470
|
+
uniqueKey: "".concat(item.uniqueKey, "_logisticsCode"),
|
471
|
+
content: logisticsList.map(function (item) {
|
472
|
+
return item.logisticsCode;
|
473
|
+
}).join(),
|
474
|
+
name: item.name
|
475
|
+
});
|
476
|
+
} else if (item.workOrderComponentType === 'JST_SUPPLY') {
|
477
|
+
var supplyList = get(nowData, "".concat(item.uniqueKey), []); // if (
|
478
|
+
// supplyList.length === 1 &&
|
479
|
+
// !supplyList[0]?.items?.length &&
|
480
|
+
// supplyList.some((t) => {
|
481
|
+
// return !t.supplyId;
|
482
|
+
// })
|
483
|
+
// ) {
|
484
|
+
// supplyList = [];
|
485
|
+
// }
|
486
|
+
|
487
|
+
contentVoList.push({
|
488
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
489
|
+
content: JSON.stringify(supplyList),
|
490
|
+
name: item.name
|
491
|
+
});
|
492
|
+
contentVoList.push({
|
493
|
+
uniqueKey: "".concat(item.uniqueKey, "_supplyId"),
|
494
|
+
content: supplyList.map(function (item) {
|
495
|
+
return item.supplyId;
|
496
|
+
}).join(),
|
497
|
+
name: item.name
|
498
|
+
});
|
499
|
+
} else if (item.workOrderComponentType === 'JST_SEND_GOOD') {
|
500
|
+
var sendList = get(nowData, "".concat(item.uniqueKey), []); // if (
|
501
|
+
// sendList.length === 1 &&
|
502
|
+
// !sendList[0]?.items?.length &&
|
503
|
+
// sendList.some((t) => {
|
504
|
+
// return !t.sendId && !t.sendName;
|
505
|
+
// })
|
506
|
+
// ) {
|
507
|
+
// sendList = [];
|
508
|
+
// }
|
509
|
+
|
510
|
+
contentVoList.push({
|
511
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
512
|
+
content: JSON.stringify(sendList),
|
513
|
+
name: item.name
|
514
|
+
});
|
515
|
+
contentVoList.push({
|
516
|
+
uniqueKey: "".concat(item.uniqueKey, "_sendId"),
|
517
|
+
content: sendList.map(function (item) {
|
518
|
+
return item.sendId;
|
519
|
+
}).join(),
|
520
|
+
name: item.name
|
521
|
+
});
|
522
|
+
contentVoList.push({
|
523
|
+
uniqueKey: "".concat(item.uniqueKey, "_sendName"),
|
524
|
+
content: sendList.map(function (item) {
|
525
|
+
return item.sendName;
|
526
|
+
}).join(),
|
527
|
+
name: item.name
|
528
|
+
});
|
529
|
+
} else if (item.workOrderComponentType === 'JST_ITEM_SELECT_THIRD') {
|
530
|
+
contentVoList.push({
|
531
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
532
|
+
content: JSON.stringify(get(nowData, "".concat(item.uniqueKey), [])),
|
533
|
+
name: item.name
|
534
|
+
});
|
535
|
+
contentVoList.push({
|
536
|
+
uniqueKey: "".concat(item.uniqueKey, "_itemId"),
|
537
|
+
content: get(nowData, "".concat(item.uniqueKey), []).map(function (item) {
|
538
|
+
return item.itemId;
|
539
|
+
}).join(),
|
540
|
+
name: item.name
|
541
|
+
});
|
542
|
+
contentVoList.push({
|
543
|
+
uniqueKey: "".concat(item.uniqueKey, "_supplierName"),
|
544
|
+
content: get(nowData, "".concat(item.uniqueKey), []).map(function (item) {
|
545
|
+
return item.supplierName;
|
546
|
+
}).join(),
|
547
|
+
name: item.name
|
548
|
+
});
|
437
549
|
} else {
|
438
550
|
var _nowData$item$uniqueK;
|
439
551
|
|
@@ -642,6 +754,30 @@ var transDataSource = function transDataSource(templateColumns) {
|
|
642
754
|
}));
|
643
755
|
} else if (nex.workOrderComponentType === 'SYSTEM_ORDER_NO') {
|
644
756
|
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_systemOrderNo")]));
|
757
|
+
} else if (nex.workOrderComponentType === 'JST_LOGISTICS') {
|
758
|
+
var _itemList2 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
|
759
|
+
logisticsCompany: null,
|
760
|
+
logisticsCode: null
|
761
|
+
}]);
|
762
|
+
|
763
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList2));
|
764
|
+
} else if (nex.workOrderComponentType === 'JST_ITEM_SELECT_THIRD') {
|
765
|
+
var _itemList3 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], []);
|
766
|
+
|
767
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList3));
|
768
|
+
} else if (nex.workOrderComponentType === 'JST_SUPPLY') {
|
769
|
+
var _itemList4 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
|
770
|
+
supplyId: null
|
771
|
+
}]);
|
772
|
+
|
773
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList4));
|
774
|
+
} else if (nex.workOrderComponentType === 'JST_SEND_GOOD') {
|
775
|
+
var _itemList5 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
|
776
|
+
sendName: '',
|
777
|
+
sendId: ''
|
778
|
+
}]);
|
779
|
+
|
780
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList5));
|
645
781
|
}
|
646
782
|
|
647
783
|
return cur;
|
@@ -656,7 +792,8 @@ export var calcWorkOrderList = function calcWorkOrderList(source, templateColumn
|
|
656
792
|
return _objectSpread(_objectSpread(_objectSpread({}, item.jsonMap), value), {}, {
|
657
793
|
shopId: item.shopId,
|
658
794
|
shopName: item.shopName,
|
659
|
-
id: item.id
|
795
|
+
id: item.id,
|
796
|
+
repeatValueList: item.repeatValueList
|
660
797
|
});
|
661
798
|
});
|
662
799
|
return finalSource;
|
@@ -666,7 +803,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
666
803
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
667
804
|
var _shopList$find;
|
668
805
|
|
669
|
-
var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, JOIN_SHOP, shopSourceStr,
|
806
|
+
var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, JOIN_SHOP, shopSourceStr, _data$value, _jstOrder$value, _jstOrder$value$data, promise, hasJst, _yield$Promise$allSet, _yield$Promise$allSet2, data, jstOrder, orderInfo, jstInfo, formValue, detail, values, _templateDetail$compo, paymentUniqueKey;
|
670
807
|
|
671
808
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
672
809
|
while (1) {
|
@@ -690,24 +827,22 @@ export var orderBack = /*#__PURE__*/function () {
|
|
690
827
|
return item.shopId == shopId;
|
691
828
|
})) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSourceStr;
|
692
829
|
_context.prev = 5;
|
693
|
-
taobaoId = (_shopList$find2 = shopList.find(function (item) {
|
694
|
-
return item.shopSourceStr === 'TAOBAO' && item.shopId == shopId;
|
695
|
-
})) === null || _shopList$find2 === void 0 ? void 0 : _shopList$find2.taobaoId;
|
696
830
|
promise = [orderDetail({
|
697
831
|
shopId: shopId,
|
698
832
|
//店铺id
|
699
833
|
orderNo: order_no,
|
700
834
|
//订单id
|
701
835
|
templateId: templateDetail.uniqueKey
|
702
|
-
})];
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
}
|
836
|
+
})]; //判断是否有聚水潭组件 有就请求jst订单接口
|
837
|
+
|
838
|
+
hasJst = HasJstHandle(templateDetail);
|
839
|
+
|
840
|
+
if (hasJst) {
|
841
|
+
promise.push(jstOrderDetail({
|
842
|
+
soId: order_no
|
843
|
+
}));
|
844
|
+
}
|
845
|
+
|
711
846
|
_context.next = 11;
|
712
847
|
return Promise.allSettled(promise);
|
713
848
|
|
@@ -715,115 +850,138 @@ export var orderBack = /*#__PURE__*/function () {
|
|
715
850
|
_yield$Promise$allSet = _context.sent;
|
716
851
|
_yield$Promise$allSet2 = _slicedToArray(_yield$Promise$allSet, 2);
|
717
852
|
data = _yield$Promise$allSet2[0];
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
buyerInfo = buyer === null || buyer === void 0 ? void 0 : (_buyer$value = buyer.value) === null || _buyer$value === void 0 ? void 0 : _buyer$value.data;
|
722
|
-
_ref3 = orderInfo || {}, orderNo = _ref3.orderNo, provinceCode = _ref3.provinceCode, cityCode = _ref3.cityCode, townCode = _ref3.townCode, orderCreateDateTime = _ref3.orderCreateDateTime, orderPaymentDateTime = _ref3.orderPaymentDateTime, orderDeliveryDateTime = _ref3.orderDeliveryDateTime, orderClosingDateTime = _ref3.orderClosingDateTime, itemList = _ref3.itemList;
|
723
|
-
transField = orderInfo ? {
|
724
|
-
tradeId: orderNo,
|
725
|
-
province: provinceCode,
|
726
|
-
city: cityCode,
|
727
|
-
district: townCode,
|
728
|
-
tradeCreateDateTime: orderCreateDateTime,
|
729
|
-
tradePaymentDateTime: orderPaymentDateTime,
|
730
|
-
tradeDeliveryDateTime: orderDeliveryDateTime,
|
731
|
-
tradeClosingDateTime: orderClosingDateTime,
|
732
|
-
goodId: itemList,
|
733
|
-
goodSerial: itemList
|
734
|
-
} : {};
|
735
|
-
finalResponse = {};
|
736
|
-
|
737
|
-
if (orderInfo) {
|
738
|
-
finalResponse = _objectSpread(_objectSpread({}, orderInfo || {}), transField);
|
739
|
-
}
|
740
|
-
|
741
|
-
if (buyerInfo) {
|
742
|
-
finalResponse = _objectSpread(_objectSpread({}, finalResponse), {}, {
|
743
|
-
buyer: buyerInfo || {},
|
744
|
-
payBuyer: buyerInfo || {}
|
745
|
-
});
|
746
|
-
} //获取当前表单字段
|
747
|
-
|
853
|
+
jstOrder = _yield$Promise$allSet2[1];
|
854
|
+
orderInfo = (data === null || data === void 0 ? void 0 : (_data$value = data.value) === null || _data$value === void 0 ? void 0 : _data$value.data) || {};
|
855
|
+
jstInfo = (jstOrder === null || jstOrder === void 0 ? void 0 : (_jstOrder$value = jstOrder.value) === null || _jstOrder$value === void 0 ? void 0 : (_jstOrder$value$data = _jstOrder$value.data) === null || _jstOrder$value$data === void 0 ? void 0 : _jstOrder$value$data.orders) || []; //获取当前表单字段
|
748
856
|
|
749
857
|
formValue = form.getFieldsValue();
|
750
|
-
detail =
|
858
|
+
detail = _objectSpread(_objectSpread({}, orderInfo), {}, {
|
859
|
+
jstItemList: jstInfo
|
860
|
+
});
|
861
|
+
console.log(detail); //抖音数据特殊处理
|
751
862
|
|
752
863
|
if (shopSourceStr === 'FXG') {
|
753
|
-
detail = updateDYDetails(
|
754
|
-
}
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
var
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
864
|
+
detail = updateDYDetails(detail);
|
865
|
+
} //整合返回值
|
866
|
+
|
867
|
+
|
868
|
+
values = ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
|
869
|
+
var uniqueKey = next.uniqueKey;
|
870
|
+
var config = next.componentConfig;
|
871
|
+
|
872
|
+
switch (next.workOrderComponentType) {
|
873
|
+
case 'TRADE_ID_INPUT':
|
874
|
+
prv[uniqueKey] = order_no || detail['orderNo'];
|
875
|
+
break;
|
876
|
+
|
877
|
+
case 'BUYER_NICK_INPUT':
|
878
|
+
prv[uniqueKey] = {
|
879
|
+
buyerNick: detail['buyerNick'],
|
880
|
+
buyerOpenUid: detail['buyerOpenUid']
|
881
|
+
};
|
882
|
+
break;
|
883
|
+
|
884
|
+
case 'RECEIVER_NAME_INPUT':
|
885
|
+
prv[uniqueKey] = detail['receiveName'];
|
886
|
+
break;
|
887
|
+
|
888
|
+
case 'RECEIVER_MOBILE_INPUT':
|
889
|
+
prv[uniqueKey] = detail['receiveMobile'];
|
890
|
+
break;
|
891
|
+
|
892
|
+
case 'RECEIVER_ADDRESS_INPUT':
|
893
|
+
prv[uniqueKey] = {
|
894
|
+
address: [+detail['provinceCode'], +detail['cityCode'], +detail['townCode']],
|
895
|
+
detail: detail['address'] || ''
|
896
|
+
};
|
897
|
+
break;
|
898
|
+
|
899
|
+
case 'TRADE_CREATE_DATETIME':
|
900
|
+
prv[uniqueKey] = detail['orderCreateDateTime'] ? moment(detail['orderCreateDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
901
|
+
break;
|
902
|
+
|
903
|
+
case 'TRADE_PAYMENT_DATETIME':
|
904
|
+
prv[uniqueKey] = detail['orderPaymentDateTime'] ? moment(detail['orderPaymentDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
905
|
+
break;
|
906
|
+
|
907
|
+
case 'TRADE_DELIVERY_DATETIME':
|
908
|
+
prv[uniqueKey] = detail['orderDeliveryDateTime'] ? moment(detail['orderDeliveryDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
909
|
+
break;
|
910
|
+
|
911
|
+
case 'TRADE_CLOSING_DATETIME':
|
912
|
+
prv[uniqueKey] = detail['orderClosingDateTime'] ? moment(detail['orderClosingDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
913
|
+
break;
|
914
|
+
|
915
|
+
case 'ACTUAL_PAYMENT':
|
916
|
+
prv[uniqueKey] = detail['actualPayment'];
|
917
|
+
break;
|
918
|
+
|
919
|
+
case 'EXPRESS_LOGISTICS_SELECT':
|
920
|
+
prv[uniqueKey] = {
|
921
|
+
company: detail['expressLogisticsCompany'],
|
922
|
+
order: detail['expressLogisticsCode']
|
923
|
+
};
|
924
|
+
break;
|
925
|
+
|
926
|
+
case 'RETURN_LOGISTICS_SELECT':
|
927
|
+
prv[uniqueKey] = {
|
928
|
+
company: detail['returnLogisticsCompany'],
|
929
|
+
order: detail['returnLogisticsCode']
|
930
|
+
};
|
931
|
+
break;
|
932
|
+
|
933
|
+
case 'ALI_PAY_INPUT':
|
934
|
+
prv[uniqueKey] = {
|
935
|
+
name: detail['alipayName'],
|
936
|
+
user: detail['alipayAccount']
|
937
|
+
};
|
938
|
+
break;
|
939
|
+
|
940
|
+
case 'ITEM_SELECT':
|
941
|
+
case 'ITEM_ID':
|
942
|
+
case 'ITEM_ENCODE':
|
943
|
+
prv[uniqueKey] = taobaoGoodHandle(detail['itemList'], next.workOrderComponentType, next.componentConfig);
|
944
|
+
break;
|
945
|
+
|
946
|
+
case 'REMARK_INPUT':
|
947
|
+
prv[uniqueKey] = {
|
948
|
+
remark: detail['remark'] || '',
|
949
|
+
flag: !!detail['flag'] ? Number(detail['flag']) : detail['flag']
|
950
|
+
};
|
951
|
+
break;
|
952
|
+
|
953
|
+
case 'ENTERPRISE_PAYMENT':
|
954
|
+
//编辑的时候不能修改打款信息
|
955
|
+
if (type === 'edit') break;
|
956
|
+
prv[uniqueKey] = {
|
957
|
+
enterprisePaymentTid: '',
|
958
|
+
enterprisePaymentRefundFee: '',
|
959
|
+
enterprisePaymentBuyerNick: detail['buyerNick'],
|
960
|
+
enterprisePaymentBuyerOpenUid: detail['buyerOpenUid'],
|
961
|
+
enterprisePaymentAlipayNick: '',
|
962
|
+
enterprisePaymentAlipayNo: ''
|
963
|
+
};
|
964
|
+
break;
|
965
|
+
|
966
|
+
case 'JST_ITEM_SELECT_THIRD':
|
967
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'itemList', config);
|
968
|
+
break;
|
969
|
+
|
970
|
+
case 'JST_SUPPLY':
|
971
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'supply', config);
|
972
|
+
break;
|
973
|
+
|
974
|
+
case 'JST_SEND_GOOD':
|
975
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'send', config);
|
976
|
+
break;
|
977
|
+
|
978
|
+
case 'JST_LOGISTICS':
|
979
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'logistics', config);
|
980
|
+
break;
|
823
981
|
}
|
824
982
|
|
825
983
|
return prv;
|
826
|
-
}, {});
|
984
|
+
}, {}); //新建的情况下订单返填不能清空打款信息
|
827
985
|
|
828
986
|
if (type !== 'edit') {
|
829
987
|
paymentUniqueKey = templateDetail === null || templateDetail === void 0 ? void 0 : (_templateDetail$compo = templateDetail.componentDtoList.find(function (item) {
|
@@ -831,29 +989,28 @@ export var orderBack = /*#__PURE__*/function () {
|
|
831
989
|
})) === null || _templateDetail$compo === void 0 ? void 0 : _templateDetail$compo.uniqueKey;
|
832
990
|
|
833
991
|
if (paymentUniqueKey && orderInfo) {
|
834
|
-
|
992
|
+
values[paymentUniqueKey] = _objectSpread(_objectSpread(_objectSpread({}, formValue[paymentUniqueKey]), values[paymentUniqueKey]), {}, {
|
835
993
|
enterprisePaymentTid: order_no
|
836
994
|
});
|
837
995
|
}
|
838
996
|
}
|
839
997
|
|
840
|
-
console.
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
_context.next = 35;
|
998
|
+
console.log(values);
|
999
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
|
1000
|
+
callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
|
1001
|
+
_context.next = 30;
|
845
1002
|
break;
|
846
1003
|
|
847
|
-
case
|
848
|
-
_context.prev =
|
1004
|
+
case 28:
|
1005
|
+
_context.prev = 28;
|
849
1006
|
_context.t0 = _context["catch"](5);
|
850
1007
|
|
851
|
-
case
|
1008
|
+
case 30:
|
852
1009
|
case "end":
|
853
1010
|
return _context.stop();
|
854
1011
|
}
|
855
1012
|
}
|
856
|
-
}, _callee, null, [[5,
|
1013
|
+
}, _callee, null, [[5, 28]]);
|
857
1014
|
}));
|
858
1015
|
|
859
1016
|
return function orderBack(_x) {
|
@@ -862,33 +1019,23 @@ export var orderBack = /*#__PURE__*/function () {
|
|
862
1019
|
}(); //抖音平台数据处理
|
863
1020
|
|
864
1021
|
var updateDYDetails = function updateDYDetails(value) {
|
865
|
-
var details = _objectSpread({}, value);
|
1022
|
+
var details = _objectSpread({}, value); //处理地址
|
866
1023
|
|
867
|
-
var address = ['province', 'city', 'district']; //处理地址
|
868
1024
|
|
869
|
-
if (details['
|
870
|
-
// let cityData: string[] = [],
|
871
|
-
// areaData: string[] = [];
|
1025
|
+
if (details['provinceCode']) {
|
872
1026
|
//直辖市区特殊处理
|
873
1027
|
var addList = ['110000', '120000', '310000', '500000'];
|
874
1028
|
|
875
|
-
if (addList.includes(details.
|
876
|
-
var
|
877
|
-
var newCity =
|
1029
|
+
if (addList.includes(details.provinceCode)) {
|
1030
|
+
var cityCode = details['cityCode'];
|
1031
|
+
var newCity = cityCode.split('');
|
878
1032
|
newCity[3] = '1';
|
879
|
-
details['
|
880
|
-
}
|
881
|
-
// if (item === 'city') {
|
882
|
-
// cityData = details['province'] ? formatAddrData.getCityByProCode(details['province']) : []
|
883
|
-
// } else if (item === 'district') {
|
884
|
-
// areaData = details['city'] ? formatAddrData.getAreaByCityCode(details['city']) : []
|
885
|
-
// }
|
886
|
-
// })
|
887
|
-
|
1033
|
+
details['cityCode'] = newCity.join('');
|
1034
|
+
}
|
888
1035
|
} //处理时间
|
889
1036
|
|
890
1037
|
|
891
|
-
var times = ['
|
1038
|
+
var times = ['orderClosingDateTime', 'orderCreateDateTime', 'orderDeliveryDateTime', 'orderPaymentDateTime'];
|
892
1039
|
times.forEach(function (item) {
|
893
1040
|
if (details[item]) {
|
894
1041
|
details[item] = moment(details[item]).format('YYYY-MM-DD HH:mm:ss');
|
@@ -906,42 +1053,6 @@ var updateDYDetails = function updateDYDetails(value) {
|
|
906
1053
|
}
|
907
1054
|
});
|
908
1055
|
return details;
|
909
|
-
}; //获取模版组件
|
910
|
-
|
911
|
-
|
912
|
-
var getComponentsValue = function getComponentsValue() {
|
913
|
-
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
914
|
-
//订单详情映射字段
|
915
|
-
var mapList = {
|
916
|
-
TRADE_ID_INPUT: 'tradeId',
|
917
|
-
RECEIVER_NAME_INPUT: 'receiveName',
|
918
|
-
RECEIVER_MOBILE_INPUT: 'receiveMobile',
|
919
|
-
RECEIVER_ADDRESS_INPUT: 'province',
|
920
|
-
TRADE_CREATE_DATETIME: 'tradeCreateDateTime',
|
921
|
-
TRADE_PAYMENT_DATETIME: 'tradePaymentDateTime',
|
922
|
-
TRADE_DELIVERY_DATETIME: 'tradeDeliveryDateTime',
|
923
|
-
TRADE_CLOSING_DATETIME: 'tradeClosingDateTime',
|
924
|
-
ACTUAL_PAYMENT: 'actualPayment',
|
925
|
-
EXPRESS_LOGISTICS_SELECT: 'expressLogisticsCompany',
|
926
|
-
RETURN_LOGISTICS_SELECT: 'returnLogisticsCompany',
|
927
|
-
ALI_PAY_INPUT: 'alipayName',
|
928
|
-
ITEM_SELECT: 'itemList',
|
929
|
-
REMARK_INPUT: 'remark',
|
930
|
-
ITEM_ID: 'goodId',
|
931
|
-
ITEM_ENCODE: 'goodSerial',
|
932
|
-
BUYER_NICK_INPUT: 'buyer',
|
933
|
-
ENTERPRISE_PAYMENT: 'payBuyer'
|
934
|
-
};
|
935
|
-
return list.reduce(function (prv, next) {
|
936
|
-
if (mapList[next.workOrderComponentType]) {
|
937
|
-
prv[mapList[next.workOrderComponentType]] = {
|
938
|
-
uniqueKey: next.uniqueKey,
|
939
|
-
key: mapList[next.workOrderComponentType]
|
940
|
-
};
|
941
|
-
}
|
942
|
-
|
943
|
-
return prv;
|
944
|
-
}, {});
|
945
1056
|
}; //图片压缩
|
946
1057
|
|
947
1058
|
|
@@ -990,4 +1101,143 @@ export var getReplaceWarnValues = function getReplaceWarnValues(templateDetail,
|
|
990
1101
|
});
|
991
1102
|
return prv;
|
992
1103
|
}, []);
|
1104
|
+
}; //淘宝商品组件信息处理
|
1105
|
+
|
1106
|
+
export var taobaoGoodHandle = function taobaoGoodHandle(arr, type, config) {
|
1107
|
+
var list = JSON.parse(JSON.stringify(arr));
|
1108
|
+
var changeSku = config.changeSku;
|
1109
|
+
return list.map(function (item) {
|
1110
|
+
var numIid = item.numIid,
|
1111
|
+
title = item.title,
|
1112
|
+
picUrl = item.picUrl,
|
1113
|
+
price = item.price,
|
1114
|
+
outerId = item.outerId,
|
1115
|
+
skuId = item.skuId,
|
1116
|
+
platform = item.platform,
|
1117
|
+
skuInfoDTO = item.skuInfoDTO;
|
1118
|
+
var params = {
|
1119
|
+
numIid: numIid,
|
1120
|
+
title: title,
|
1121
|
+
picUrl: picUrl,
|
1122
|
+
price: price,
|
1123
|
+
platform: platform
|
1124
|
+
};
|
1125
|
+
|
1126
|
+
if (skuInfoDTO) {
|
1127
|
+
params.picUrl = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.picUrl;
|
1128
|
+
params.price = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.price;
|
1129
|
+
params.skuId = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.skuId;
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
if (changeSku) {
|
1133
|
+
params.propertiesName = (skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.propertiesName) || '';
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
if (type === 'ITEM_ENCODE') {
|
1137
|
+
params.outerId = (skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.outerSkuId) || outerId;
|
1138
|
+
} else if (type === 'ITEM_SELECT_THIRD') {
|
1139
|
+
params.itemId = '';
|
1140
|
+
params.supplierName = '';
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
return params;
|
1144
|
+
});
|
1145
|
+
}; //聚水潭订单返填
|
1146
|
+
|
1147
|
+
export var HasJstHandle = function HasJstHandle(templateDetail) {
|
1148
|
+
return templateDetail.componentDtoList.some(function (item) {
|
1149
|
+
return ['JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD'].includes(item.workOrderComponentType);
|
1150
|
+
});
|
1151
|
+
}; //重组聚水潭商品数据
|
1152
|
+
|
1153
|
+
export var updateJSTItemListHandle = function updateJSTItemListHandle() {
|
1154
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
1155
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'logistics';
|
1156
|
+
var config = arguments.length > 2 ? arguments[2] : undefined;
|
1157
|
+
var newList = JSON.parse(JSON.stringify(list));
|
1158
|
+
var showField = config.showField,
|
1159
|
+
enableItemId = config.enableItemId,
|
1160
|
+
enableSupplierName = config.enableSupplierName;
|
1161
|
+
|
1162
|
+
if (type !== 'itemList') {
|
1163
|
+
var _list = newList.map(function (item) {
|
1164
|
+
var items = item.items.map(function (t) {
|
1165
|
+
return {
|
1166
|
+
title: t.skuName,
|
1167
|
+
picUrl: t.pic,
|
1168
|
+
platform: 'jst',
|
1169
|
+
skuId: t.skuId
|
1170
|
+
};
|
1171
|
+
});
|
1172
|
+
var params = {
|
1173
|
+
items: items
|
1174
|
+
};
|
1175
|
+
|
1176
|
+
if (type === 'logistics') {
|
1177
|
+
params.logisticsCompany = express.getExpressNameByName(item.logisticsCompany);
|
1178
|
+
params.logisticsCode = item.lId;
|
1179
|
+
} else if (type === 'supply') {
|
1180
|
+
params.supplyId = item.drpCoIdTo;
|
1181
|
+
} else if (type === 'send') {
|
1182
|
+
if (['sendId', 'all'].includes(showField)) {
|
1183
|
+
params.sendId = item.wmsCoId;
|
1184
|
+
}
|
1185
|
+
|
1186
|
+
if (['sendName', 'all'].includes(showField)) {
|
1187
|
+
params.sendName = item.wmsCoName;
|
1188
|
+
}
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
console.log(params);
|
1192
|
+
return params;
|
1193
|
+
});
|
1194
|
+
|
1195
|
+
if (!_list.length) {
|
1196
|
+
switch (type) {
|
1197
|
+
case 'logistics':
|
1198
|
+
_list = [{
|
1199
|
+
logisticsCompany: null,
|
1200
|
+
logisticsCode: ''
|
1201
|
+
}];
|
1202
|
+
break;
|
1203
|
+
|
1204
|
+
case 'supply':
|
1205
|
+
_list = [{
|
1206
|
+
supplyId: ''
|
1207
|
+
}];
|
1208
|
+
break;
|
1209
|
+
|
1210
|
+
case 'send':
|
1211
|
+
_list = [{
|
1212
|
+
sendId: '',
|
1213
|
+
sendName: ''
|
1214
|
+
}];
|
1215
|
+
break;
|
1216
|
+
}
|
1217
|
+
}
|
1218
|
+
|
1219
|
+
return _list;
|
1220
|
+
} else {
|
1221
|
+
return newList.reduce(function (prv, next) {
|
1222
|
+
var items = next.items.map(function (t) {
|
1223
|
+
var params = {
|
1224
|
+
title: t.skuName,
|
1225
|
+
picUrl: t.pic,
|
1226
|
+
platform: 'jst'
|
1227
|
+
};
|
1228
|
+
|
1229
|
+
if (enableItemId) {
|
1230
|
+
params.itemId = t.supplierId;
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
if (enableSupplierName) {
|
1234
|
+
params.supplierName = t.supplierName;
|
1235
|
+
}
|
1236
|
+
|
1237
|
+
return params;
|
1238
|
+
});
|
1239
|
+
prv.push.apply(prv, _toConsumableArray(items));
|
1240
|
+
return prv;
|
1241
|
+
}, []);
|
1242
|
+
}
|
993
1243
|
};
|