kmkf-work-order-service-component 0.5.0-alpha.1 → 0.5.0-alpha.10
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 +59 -20
- 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 +25 -17
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/CustomizeWorkOrderCard/index.less +14 -2
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/RecordLog/index.js +2 -2
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/TemplateList/index.d.ts +11 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/TemplateList/index.js +23 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/components/TemplateList/index.less +17 -0
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.js +65 -47
- package/dist/esm/WorkOrder/components/CustomizeWorkOrderList/index.less +26 -17
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/PaymentWorkOrderCard/index.js +56 -29
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/components/PaymentWorkOrderCard/index.less +12 -5
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/index.js +20 -18
- package/dist/esm/WorkOrder/components/PaymentWorkOrderList/index.less +11 -16
- package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.d.ts +3 -1
- package/dist/esm/WorkOrder/components/Widget/common/formItemWrap.js +69 -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 +128 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstLogistics/index.d.ts +14 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstLogistics/index.js +120 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSendGood/index.d.ts +14 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSendGood/index.js +128 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSupply/index.d.ts +14 -0
- package/dist/esm/WorkOrder/components/Widget/jst/JstSupply/index.js +128 -0
- package/dist/esm/WorkOrder/index.js +26 -15
- package/dist/esm/WorkOrder/index.less +3 -2
- 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 +4 -1
- package/dist/esm/common/utils/tools.js +427 -181
- package/dist/esm/model/customizeWorkOrder/index.d.ts +1 -1
- package/dist/esm/model/servers/api.d.ts +1 -0
- package/dist/esm/model/servers/api.js +8 -0
- package/dist/esm/model/workOrder.js +1 -0
- 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,99 @@ 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), []);
|
478
|
+
contentVoList.push({
|
479
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
480
|
+
content: JSON.stringify(supplyList),
|
481
|
+
name: item.name
|
482
|
+
});
|
483
|
+
contentVoList.push({
|
484
|
+
uniqueKey: "".concat(item.uniqueKey, "_supplyId"),
|
485
|
+
content: supplyList.map(function (item) {
|
486
|
+
return item.supplyId;
|
487
|
+
}).join(),
|
488
|
+
name: item.name
|
489
|
+
});
|
490
|
+
contentVoList.push({
|
491
|
+
uniqueKey: "".concat(item.uniqueKey, "_supplyName"),
|
492
|
+
content: supplyList.map(function (item) {
|
493
|
+
return item.supplyName;
|
494
|
+
}).join(),
|
495
|
+
name: item.name
|
496
|
+
});
|
497
|
+
} else if (item.workOrderComponentType === 'JST_SEND_GOOD') {
|
498
|
+
var sendList = get(nowData, "".concat(item.uniqueKey), []);
|
499
|
+
contentVoList.push({
|
500
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
501
|
+
content: JSON.stringify(sendList),
|
502
|
+
name: item.name
|
503
|
+
});
|
504
|
+
contentVoList.push({
|
505
|
+
uniqueKey: "".concat(item.uniqueKey, "_sendId"),
|
506
|
+
content: sendList.map(function (item) {
|
507
|
+
return item.sendId;
|
508
|
+
}).join(),
|
509
|
+
name: item.name
|
510
|
+
});
|
511
|
+
contentVoList.push({
|
512
|
+
uniqueKey: "".concat(item.uniqueKey, "_sendName"),
|
513
|
+
content: sendList.map(function (item) {
|
514
|
+
return item.sendName;
|
515
|
+
}).join(),
|
516
|
+
name: item.name
|
517
|
+
});
|
518
|
+
} else if (item.workOrderComponentType === 'JST_ITEM_SELECT_THIRD') {
|
519
|
+
contentVoList.push({
|
520
|
+
uniqueKey: "".concat(item.uniqueKey, "_jstItemList"),
|
521
|
+
content: JSON.stringify(get(nowData, "".concat(item.uniqueKey), [])),
|
522
|
+
name: item.name
|
523
|
+
});
|
524
|
+
contentVoList.push({
|
525
|
+
uniqueKey: "".concat(item.uniqueKey, "_itemId"),
|
526
|
+
content: get(nowData, "".concat(item.uniqueKey), []).map(function (item) {
|
527
|
+
return item.itemId;
|
528
|
+
}).join(),
|
529
|
+
name: item.name
|
530
|
+
});
|
531
|
+
contentVoList.push({
|
532
|
+
uniqueKey: "".concat(item.uniqueKey, "_supplierName"),
|
533
|
+
content: get(nowData, "".concat(item.uniqueKey), []).map(function (item) {
|
534
|
+
return item.supplierName;
|
535
|
+
}).join(),
|
536
|
+
name: item.name
|
537
|
+
});
|
437
538
|
} else {
|
438
539
|
var _nowData$item$uniqueK;
|
439
540
|
|
@@ -642,6 +743,30 @@ var transDataSource = function transDataSource(templateColumns) {
|
|
642
743
|
}));
|
643
744
|
} else if (nex.workOrderComponentType === 'SYSTEM_ORDER_NO') {
|
644
745
|
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), item.jsonMap["".concat(nex.uniqueKey, "_systemOrderNo")]));
|
746
|
+
} else if (nex.workOrderComponentType === 'JST_LOGISTICS') {
|
747
|
+
var _itemList2 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
|
748
|
+
logisticsCompany: null,
|
749
|
+
logisticsCode: null
|
750
|
+
}]);
|
751
|
+
|
752
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList2));
|
753
|
+
} else if (nex.workOrderComponentType === 'JST_ITEM_SELECT_THIRD') {
|
754
|
+
var _itemList3 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], []);
|
755
|
+
|
756
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList3));
|
757
|
+
} else if (nex.workOrderComponentType === 'JST_SUPPLY') {
|
758
|
+
var _itemList4 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
|
759
|
+
supplyId: null
|
760
|
+
}]);
|
761
|
+
|
762
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList4));
|
763
|
+
} else if (nex.workOrderComponentType === 'JST_SEND_GOOD') {
|
764
|
+
var _itemList5 = jsonParseSecurity(item.jsonMap["".concat(nex.uniqueKey, "_jstItemList")], [{
|
765
|
+
sendName: '',
|
766
|
+
sendId: ''
|
767
|
+
}]);
|
768
|
+
|
769
|
+
return _objectSpread(_objectSpread({}, cur), {}, _defineProperty({}, "".concat(nex.uniqueKey), _itemList5));
|
645
770
|
}
|
646
771
|
|
647
772
|
return cur;
|
@@ -667,7 +792,7 @@ export var orderBack = /*#__PURE__*/function () {
|
|
667
792
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
668
793
|
var _shopList$find;
|
669
794
|
|
670
|
-
var order_no, form, shopId, shopList, templateDetail, _ref$type, type, callback, JOIN_SHOP, shopSourceStr,
|
795
|
+
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;
|
671
796
|
|
672
797
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
673
798
|
while (1) {
|
@@ -691,24 +816,22 @@ export var orderBack = /*#__PURE__*/function () {
|
|
691
816
|
return item.shopId == shopId;
|
692
817
|
})) === null || _shopList$find === void 0 ? void 0 : _shopList$find.shopSourceStr;
|
693
818
|
_context.prev = 5;
|
694
|
-
taobaoId = (_shopList$find2 = shopList.find(function (item) {
|
695
|
-
return item.shopSourceStr === 'TAOBAO' && item.shopId == shopId;
|
696
|
-
})) === null || _shopList$find2 === void 0 ? void 0 : _shopList$find2.taobaoId;
|
697
819
|
promise = [orderDetail({
|
698
820
|
shopId: shopId,
|
699
821
|
//店铺id
|
700
822
|
orderNo: order_no,
|
701
823
|
//订单id
|
702
824
|
templateId: templateDetail.uniqueKey
|
703
|
-
})];
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
710
|
-
|
711
|
-
}
|
825
|
+
})]; //判断是否有聚水潭组件 有就请求jst订单接口
|
826
|
+
|
827
|
+
hasJst = HasJstHandle(templateDetail);
|
828
|
+
|
829
|
+
if (hasJst) {
|
830
|
+
promise.push(jstOrderDetail({
|
831
|
+
soId: order_no
|
832
|
+
}));
|
833
|
+
}
|
834
|
+
|
712
835
|
_context.next = 11;
|
713
836
|
return Promise.allSettled(promise);
|
714
837
|
|
@@ -716,115 +839,138 @@ export var orderBack = /*#__PURE__*/function () {
|
|
716
839
|
_yield$Promise$allSet = _context.sent;
|
717
840
|
_yield$Promise$allSet2 = _slicedToArray(_yield$Promise$allSet, 2);
|
718
841
|
data = _yield$Promise$allSet2[0];
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
buyerInfo = buyer === null || buyer === void 0 ? void 0 : (_buyer$value = buyer.value) === null || _buyer$value === void 0 ? void 0 : _buyer$value.data;
|
723
|
-
_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;
|
724
|
-
transField = orderInfo ? {
|
725
|
-
tradeId: orderNo,
|
726
|
-
province: provinceCode,
|
727
|
-
city: cityCode,
|
728
|
-
district: townCode,
|
729
|
-
tradeCreateDateTime: orderCreateDateTime,
|
730
|
-
tradePaymentDateTime: orderPaymentDateTime,
|
731
|
-
tradeDeliveryDateTime: orderDeliveryDateTime,
|
732
|
-
tradeClosingDateTime: orderClosingDateTime,
|
733
|
-
goodId: itemList,
|
734
|
-
goodSerial: itemList
|
735
|
-
} : {};
|
736
|
-
finalResponse = {};
|
737
|
-
|
738
|
-
if (orderInfo) {
|
739
|
-
finalResponse = _objectSpread(_objectSpread({}, orderInfo || {}), transField);
|
740
|
-
}
|
741
|
-
|
742
|
-
if (buyerInfo) {
|
743
|
-
finalResponse = _objectSpread(_objectSpread({}, finalResponse), {}, {
|
744
|
-
buyer: buyerInfo || {},
|
745
|
-
payBuyer: buyerInfo || {}
|
746
|
-
});
|
747
|
-
} //获取当前表单字段
|
748
|
-
|
842
|
+
jstOrder = _yield$Promise$allSet2[1];
|
843
|
+
orderInfo = (data === null || data === void 0 ? void 0 : (_data$value = data.value) === null || _data$value === void 0 ? void 0 : _data$value.data) || {};
|
844
|
+
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) || []; //获取当前表单字段
|
749
845
|
|
750
846
|
formValue = form.getFieldsValue();
|
751
|
-
detail =
|
847
|
+
detail = _objectSpread(_objectSpread({}, orderInfo), {}, {
|
848
|
+
jstItemList: jstInfo
|
849
|
+
});
|
850
|
+
console.log(detail); //抖音数据特殊处理
|
752
851
|
|
753
852
|
if (shopSourceStr === 'FXG') {
|
754
|
-
detail = updateDYDetails(
|
755
|
-
}
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
var
|
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
|
-
|
823
|
-
|
853
|
+
detail = updateDYDetails(detail);
|
854
|
+
} //整合返回值
|
855
|
+
|
856
|
+
|
857
|
+
values = ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
|
858
|
+
var uniqueKey = next.uniqueKey;
|
859
|
+
var config = next.componentConfig;
|
860
|
+
|
861
|
+
switch (next.workOrderComponentType) {
|
862
|
+
case 'TRADE_ID_INPUT':
|
863
|
+
prv[uniqueKey] = order_no || detail['orderNo'];
|
864
|
+
break;
|
865
|
+
|
866
|
+
case 'BUYER_NICK_INPUT':
|
867
|
+
prv[uniqueKey] = {
|
868
|
+
buyerNick: detail['buyerNick'],
|
869
|
+
buyerOpenUid: detail['buyerOpenUid']
|
870
|
+
};
|
871
|
+
break;
|
872
|
+
|
873
|
+
case 'RECEIVER_NAME_INPUT':
|
874
|
+
prv[uniqueKey] = detail['receiveName'];
|
875
|
+
break;
|
876
|
+
|
877
|
+
case 'RECEIVER_MOBILE_INPUT':
|
878
|
+
prv[uniqueKey] = detail['receiveMobile'];
|
879
|
+
break;
|
880
|
+
|
881
|
+
case 'RECEIVER_ADDRESS_INPUT':
|
882
|
+
prv[uniqueKey] = {
|
883
|
+
address: [+detail['provinceCode'], +detail['cityCode'], +detail['townCode']],
|
884
|
+
detail: detail['address'] || ''
|
885
|
+
};
|
886
|
+
break;
|
887
|
+
|
888
|
+
case 'TRADE_CREATE_DATETIME':
|
889
|
+
prv[uniqueKey] = detail['orderCreateDateTime'] ? moment(detail['orderCreateDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
890
|
+
break;
|
891
|
+
|
892
|
+
case 'TRADE_PAYMENT_DATETIME':
|
893
|
+
prv[uniqueKey] = detail['orderPaymentDateTime'] ? moment(detail['orderPaymentDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
894
|
+
break;
|
895
|
+
|
896
|
+
case 'TRADE_DELIVERY_DATETIME':
|
897
|
+
prv[uniqueKey] = detail['orderDeliveryDateTime'] ? moment(detail['orderDeliveryDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
898
|
+
break;
|
899
|
+
|
900
|
+
case 'TRADE_CLOSING_DATETIME':
|
901
|
+
prv[uniqueKey] = detail['orderClosingDateTime'] ? moment(detail['orderClosingDateTime']).format('YYYY-MM-DD HH:mm:ss') : '';
|
902
|
+
break;
|
903
|
+
|
904
|
+
case 'ACTUAL_PAYMENT':
|
905
|
+
prv[uniqueKey] = detail['actualPayment'];
|
906
|
+
break;
|
907
|
+
|
908
|
+
case 'EXPRESS_LOGISTICS_SELECT':
|
909
|
+
prv[uniqueKey] = {
|
910
|
+
company: detail['expressLogisticsCompany'],
|
911
|
+
order: detail['expressLogisticsCode']
|
912
|
+
};
|
913
|
+
break;
|
914
|
+
|
915
|
+
case 'RETURN_LOGISTICS_SELECT':
|
916
|
+
prv[uniqueKey] = {
|
917
|
+
company: detail['returnLogisticsCompany'],
|
918
|
+
order: detail['returnLogisticsCode']
|
919
|
+
};
|
920
|
+
break;
|
921
|
+
|
922
|
+
case 'ALI_PAY_INPUT':
|
923
|
+
prv[uniqueKey] = {
|
924
|
+
name: detail['alipayName'],
|
925
|
+
user: detail['alipayAccount']
|
926
|
+
};
|
927
|
+
break;
|
928
|
+
|
929
|
+
case 'ITEM_SELECT':
|
930
|
+
case 'ITEM_ID':
|
931
|
+
case 'ITEM_ENCODE':
|
932
|
+
prv[uniqueKey] = taobaoGoodHandle(detail['itemList'], next.workOrderComponentType, next.componentConfig);
|
933
|
+
break;
|
934
|
+
|
935
|
+
case 'REMARK_INPUT':
|
936
|
+
prv[uniqueKey] = {
|
937
|
+
remark: detail['remark'] || '',
|
938
|
+
flag: !!detail['flag'] ? Number(detail['flag']) : detail['flag']
|
939
|
+
};
|
940
|
+
break;
|
941
|
+
|
942
|
+
case 'ENTERPRISE_PAYMENT':
|
943
|
+
//编辑的时候不能修改打款信息
|
944
|
+
if (type === 'edit') break;
|
945
|
+
prv[uniqueKey] = {
|
946
|
+
enterprisePaymentTid: '',
|
947
|
+
enterprisePaymentRefundFee: '',
|
948
|
+
enterprisePaymentBuyerNick: detail['buyerNick'],
|
949
|
+
enterprisePaymentBuyerOpenUid: detail['buyerOpenUid'],
|
950
|
+
enterprisePaymentAlipayNick: '',
|
951
|
+
enterprisePaymentAlipayNo: ''
|
952
|
+
};
|
953
|
+
break;
|
954
|
+
|
955
|
+
case 'JST_ITEM_SELECT_THIRD':
|
956
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'itemList', config);
|
957
|
+
break;
|
958
|
+
|
959
|
+
case 'JST_SUPPLY':
|
960
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'supply', config);
|
961
|
+
break;
|
962
|
+
|
963
|
+
case 'JST_SEND_GOOD':
|
964
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'send', config);
|
965
|
+
break;
|
966
|
+
|
967
|
+
case 'JST_LOGISTICS':
|
968
|
+
prv[uniqueKey] = updateJSTItemListHandle(detail['jstItemList'], 'logistics', config);
|
969
|
+
break;
|
824
970
|
}
|
825
971
|
|
826
972
|
return prv;
|
827
|
-
}, {});
|
973
|
+
}, {}); //新建的情况下订单返填不能清空打款信息
|
828
974
|
|
829
975
|
if (type !== 'edit') {
|
830
976
|
paymentUniqueKey = templateDetail === null || templateDetail === void 0 ? void 0 : (_templateDetail$compo = templateDetail.componentDtoList.find(function (item) {
|
@@ -832,29 +978,28 @@ export var orderBack = /*#__PURE__*/function () {
|
|
832
978
|
})) === null || _templateDetail$compo === void 0 ? void 0 : _templateDetail$compo.uniqueKey;
|
833
979
|
|
834
980
|
if (paymentUniqueKey && orderInfo) {
|
835
|
-
|
981
|
+
values[paymentUniqueKey] = _objectSpread(_objectSpread(_objectSpread({}, formValue[paymentUniqueKey]), values[paymentUniqueKey]), {}, {
|
836
982
|
enterprisePaymentTid: order_no
|
837
983
|
});
|
838
984
|
}
|
839
985
|
}
|
840
986
|
|
841
|
-
console.
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
_context.next = 35;
|
987
|
+
console.log(values);
|
988
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, formValue), values));
|
989
|
+
callback === null || callback === void 0 ? void 0 : callback(detail, templateDetail);
|
990
|
+
_context.next = 30;
|
846
991
|
break;
|
847
992
|
|
848
|
-
case
|
849
|
-
_context.prev =
|
993
|
+
case 28:
|
994
|
+
_context.prev = 28;
|
850
995
|
_context.t0 = _context["catch"](5);
|
851
996
|
|
852
|
-
case
|
997
|
+
case 30:
|
853
998
|
case "end":
|
854
999
|
return _context.stop();
|
855
1000
|
}
|
856
1001
|
}
|
857
|
-
}, _callee, null, [[5,
|
1002
|
+
}, _callee, null, [[5, 28]]);
|
858
1003
|
}));
|
859
1004
|
|
860
1005
|
return function orderBack(_x) {
|
@@ -863,33 +1008,23 @@ export var orderBack = /*#__PURE__*/function () {
|
|
863
1008
|
}(); //抖音平台数据处理
|
864
1009
|
|
865
1010
|
var updateDYDetails = function updateDYDetails(value) {
|
866
|
-
var details = _objectSpread({}, value);
|
1011
|
+
var details = _objectSpread({}, value); //处理地址
|
867
1012
|
|
868
|
-
var address = ['province', 'city', 'district']; //处理地址
|
869
1013
|
|
870
|
-
if (details['
|
871
|
-
// let cityData: string[] = [],
|
872
|
-
// areaData: string[] = [];
|
1014
|
+
if (details['provinceCode']) {
|
873
1015
|
//直辖市区特殊处理
|
874
1016
|
var addList = ['110000', '120000', '310000', '500000'];
|
875
1017
|
|
876
|
-
if (addList.includes(details.
|
877
|
-
var
|
878
|
-
var newCity =
|
1018
|
+
if (addList.includes(details.provinceCode)) {
|
1019
|
+
var cityCode = details['cityCode'];
|
1020
|
+
var newCity = cityCode.split('');
|
879
1021
|
newCity[3] = '1';
|
880
|
-
details['
|
881
|
-
}
|
882
|
-
// if (item === 'city') {
|
883
|
-
// cityData = details['province'] ? formatAddrData.getCityByProCode(details['province']) : []
|
884
|
-
// } else if (item === 'district') {
|
885
|
-
// areaData = details['city'] ? formatAddrData.getAreaByCityCode(details['city']) : []
|
886
|
-
// }
|
887
|
-
// })
|
888
|
-
|
1022
|
+
details['cityCode'] = newCity.join('');
|
1023
|
+
}
|
889
1024
|
} //处理时间
|
890
1025
|
|
891
1026
|
|
892
|
-
var times = ['
|
1027
|
+
var times = ['orderClosingDateTime', 'orderCreateDateTime', 'orderDeliveryDateTime', 'orderPaymentDateTime'];
|
893
1028
|
times.forEach(function (item) {
|
894
1029
|
if (details[item]) {
|
895
1030
|
details[item] = moment(details[item]).format('YYYY-MM-DD HH:mm:ss');
|
@@ -907,42 +1042,6 @@ var updateDYDetails = function updateDYDetails(value) {
|
|
907
1042
|
}
|
908
1043
|
});
|
909
1044
|
return details;
|
910
|
-
}; //获取模版组件
|
911
|
-
|
912
|
-
|
913
|
-
var getComponentsValue = function getComponentsValue() {
|
914
|
-
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
915
|
-
//订单详情映射字段
|
916
|
-
var mapList = {
|
917
|
-
TRADE_ID_INPUT: 'tradeId',
|
918
|
-
RECEIVER_NAME_INPUT: 'receiveName',
|
919
|
-
RECEIVER_MOBILE_INPUT: 'receiveMobile',
|
920
|
-
RECEIVER_ADDRESS_INPUT: 'province',
|
921
|
-
TRADE_CREATE_DATETIME: 'tradeCreateDateTime',
|
922
|
-
TRADE_PAYMENT_DATETIME: 'tradePaymentDateTime',
|
923
|
-
TRADE_DELIVERY_DATETIME: 'tradeDeliveryDateTime',
|
924
|
-
TRADE_CLOSING_DATETIME: 'tradeClosingDateTime',
|
925
|
-
ACTUAL_PAYMENT: 'actualPayment',
|
926
|
-
EXPRESS_LOGISTICS_SELECT: 'expressLogisticsCompany',
|
927
|
-
RETURN_LOGISTICS_SELECT: 'returnLogisticsCompany',
|
928
|
-
ALI_PAY_INPUT: 'alipayName',
|
929
|
-
ITEM_SELECT: 'itemList',
|
930
|
-
REMARK_INPUT: 'remark',
|
931
|
-
ITEM_ID: 'goodId',
|
932
|
-
ITEM_ENCODE: 'goodSerial',
|
933
|
-
BUYER_NICK_INPUT: 'buyer',
|
934
|
-
ENTERPRISE_PAYMENT: 'payBuyer'
|
935
|
-
};
|
936
|
-
return list.reduce(function (prv, next) {
|
937
|
-
if (mapList[next.workOrderComponentType]) {
|
938
|
-
prv[mapList[next.workOrderComponentType]] = {
|
939
|
-
uniqueKey: next.uniqueKey,
|
940
|
-
key: mapList[next.workOrderComponentType]
|
941
|
-
};
|
942
|
-
}
|
943
|
-
|
944
|
-
return prv;
|
945
|
-
}, {});
|
946
1045
|
}; //图片压缩
|
947
1046
|
|
948
1047
|
|
@@ -974,7 +1073,7 @@ export var COMPONENT_MAP_NAME = {
|
|
974
1073
|
}; //数据唯一性校验提交数据组装
|
975
1074
|
|
976
1075
|
export var getReplaceWarnValues = function getReplaceWarnValues(templateDetail, keyValues) {
|
977
|
-
return templateDetail.componentDtoList.reduce(function (prv, next) {
|
1076
|
+
return templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList.reduce(function (prv, next) {
|
978
1077
|
Object.keys(keyValues).forEach(function (key) {
|
979
1078
|
if (COMPONENT_MAP[key] === next.workOrderComponentType) {
|
980
1079
|
var componentConfig = next.componentConfig;
|
@@ -991,4 +1090,151 @@ export var getReplaceWarnValues = function getReplaceWarnValues(templateDetail,
|
|
991
1090
|
});
|
992
1091
|
return prv;
|
993
1092
|
}, []);
|
1093
|
+
}; //淘宝商品组件信息处理
|
1094
|
+
|
1095
|
+
export var taobaoGoodHandle = function taobaoGoodHandle(arr, type, config) {
|
1096
|
+
var list = JSON.parse(JSON.stringify(arr));
|
1097
|
+
var changeSku = config.changeSku;
|
1098
|
+
return list.map(function (item) {
|
1099
|
+
var numIid = item.numIid,
|
1100
|
+
title = item.title,
|
1101
|
+
picUrl = item.picUrl,
|
1102
|
+
price = item.price,
|
1103
|
+
outerId = item.outerId,
|
1104
|
+
skuId = item.skuId,
|
1105
|
+
platform = item.platform,
|
1106
|
+
skuInfoDTO = item.skuInfoDTO;
|
1107
|
+
var params = {
|
1108
|
+
numIid: numIid,
|
1109
|
+
title: title,
|
1110
|
+
picUrl: picUrl,
|
1111
|
+
price: price,
|
1112
|
+
platform: platform
|
1113
|
+
};
|
1114
|
+
|
1115
|
+
if (skuInfoDTO) {
|
1116
|
+
params.picUrl = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.picUrl;
|
1117
|
+
params.price = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.price;
|
1118
|
+
params.skuId = skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.skuId;
|
1119
|
+
}
|
1120
|
+
|
1121
|
+
if (changeSku) {
|
1122
|
+
params.propertiesName = (skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.propertiesName) || '';
|
1123
|
+
}
|
1124
|
+
|
1125
|
+
if (type === 'ITEM_ENCODE') {
|
1126
|
+
params.outerId = (skuInfoDTO === null || skuInfoDTO === void 0 ? void 0 : skuInfoDTO.outerSkuId) || outerId;
|
1127
|
+
} else if (type === 'ITEM_SELECT_THIRD') {
|
1128
|
+
params.itemId = '';
|
1129
|
+
params.supplierName = '';
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
return params;
|
1133
|
+
});
|
1134
|
+
}; //聚水潭订单返填
|
1135
|
+
|
1136
|
+
export var HasJstHandle = function HasJstHandle(templateDetail) {
|
1137
|
+
return templateDetail.componentDtoList.some(function (item) {
|
1138
|
+
return ['JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD'].includes(item.workOrderComponentType);
|
1139
|
+
});
|
1140
|
+
}; //重组聚水潭商品数据
|
1141
|
+
|
1142
|
+
export var updateJSTItemListHandle = function updateJSTItemListHandle() {
|
1143
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
1144
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'logistics';
|
1145
|
+
var config = arguments.length > 2 ? arguments[2] : undefined;
|
1146
|
+
var newList = JSON.parse(JSON.stringify(list));
|
1147
|
+
var showField = config.showField,
|
1148
|
+
enableItemId = config.enableItemId,
|
1149
|
+
enableSupplierName = config.enableSupplierName;
|
1150
|
+
|
1151
|
+
if (type !== 'itemList') {
|
1152
|
+
var _list = newList.map(function (item) {
|
1153
|
+
var items = item.items.map(function (t) {
|
1154
|
+
return {
|
1155
|
+
title: t.skuName,
|
1156
|
+
picUrl: t.pic,
|
1157
|
+
platform: 'jst',
|
1158
|
+
skuId: t.skuId
|
1159
|
+
};
|
1160
|
+
});
|
1161
|
+
var params = {
|
1162
|
+
items: items
|
1163
|
+
};
|
1164
|
+
|
1165
|
+
if (type === 'logistics') {
|
1166
|
+
params.logisticsCompany = express.getExpressNameByName(item.logisticsCompany);
|
1167
|
+
params.logisticsCode = item.lId;
|
1168
|
+
} else if (type === 'supply') {
|
1169
|
+
console.log(showField, item);
|
1170
|
+
|
1171
|
+
if (['supplyId', 'all'].includes(showField)) {
|
1172
|
+
params.supplyId = item.drpCoIdTo;
|
1173
|
+
}
|
1174
|
+
|
1175
|
+
if (['supplyName', 'all'].includes(showField)) {
|
1176
|
+
params.supplyName = item.drpCoName;
|
1177
|
+
}
|
1178
|
+
} else if (type === 'send') {
|
1179
|
+
if (['sendId', 'all'].includes(showField)) {
|
1180
|
+
params.sendId = item.wmsCoId;
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
if (['sendName', 'all'].includes(showField)) {
|
1184
|
+
params.sendName = item.wmsCoName;
|
1185
|
+
}
|
1186
|
+
}
|
1187
|
+
|
1188
|
+
console.log(params);
|
1189
|
+
return params;
|
1190
|
+
});
|
1191
|
+
|
1192
|
+
if (!_list.length) {
|
1193
|
+
switch (type) {
|
1194
|
+
case 'logistics':
|
1195
|
+
_list = [{
|
1196
|
+
logisticsCompany: null,
|
1197
|
+
logisticsCode: ''
|
1198
|
+
}];
|
1199
|
+
break;
|
1200
|
+
|
1201
|
+
case 'supply':
|
1202
|
+
_list = [{
|
1203
|
+
supplyId: ''
|
1204
|
+
}];
|
1205
|
+
break;
|
1206
|
+
|
1207
|
+
case 'send':
|
1208
|
+
_list = [{
|
1209
|
+
sendId: '',
|
1210
|
+
sendName: ''
|
1211
|
+
}];
|
1212
|
+
break;
|
1213
|
+
}
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
return _list;
|
1217
|
+
} else {
|
1218
|
+
return newList.reduce(function (prv, next) {
|
1219
|
+
var items = next.items.map(function (t) {
|
1220
|
+
var params = {
|
1221
|
+
title: t.skuName,
|
1222
|
+
picUrl: t.pic,
|
1223
|
+
platform: 'jst'
|
1224
|
+
};
|
1225
|
+
|
1226
|
+
if (enableItemId) {
|
1227
|
+
params.itemId = t.supplierId;
|
1228
|
+
}
|
1229
|
+
|
1230
|
+
if (enableSupplierName) {
|
1231
|
+
params.supplierName = t.supplierName;
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
return params;
|
1235
|
+
});
|
1236
|
+
prv.push.apply(prv, _toConsumableArray(items));
|
1237
|
+
return prv;
|
1238
|
+
}, []);
|
1239
|
+
}
|
994
1240
|
};
|