@kmkf-fe-packages/kmkf-utils 2.0.0-rc.1 → 2.0.0-rc.2

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.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/dist/esm/global.d.ts +2 -0
  3. package/dist/esm/index.d.ts +1 -2
  4. package/dist/esm/index.js +2 -4
  5. package/dist/esm/servers/BSE3/index.d.ts +2 -0
  6. package/dist/esm/servers/BSE3/index.js +2 -0
  7. package/dist/esm/servers/BSE3/logisticsData.d.ts +7 -0
  8. package/dist/esm/servers/BSE3/logisticsData.js +32 -0
  9. package/dist/esm/{wdt/warehouseData/index.d.ts → servers/BSE3/warehouseData.d.ts} +2 -1
  10. package/dist/esm/servers/BSE3/warehouseData.js +32 -0
  11. package/dist/esm/servers/WDT/index.d.ts +1 -0
  12. package/dist/esm/servers/WDT/index.js +1 -0
  13. package/dist/esm/servers/WDT/warehouseData.d.ts +7 -0
  14. package/dist/esm/servers/WDT/warehouseData.js +32 -0
  15. package/dist/esm/servers/index.d.ts +3 -1
  16. package/dist/esm/servers/index.js +5 -1
  17. package/dist/esm/utils/FetchAll.d.ts +9 -0
  18. package/dist/esm/utils/FetchAll.js +44 -0
  19. package/dist/esm/utils/SendData.d.ts +22 -0
  20. package/dist/esm/utils/SendData.js +84 -0
  21. package/dist/esm/utils/bsE3OrderBackFormValues.d.ts +1 -1
  22. package/dist/esm/utils/bsE3OrderBackFormValues.js +61 -55
  23. package/dist/esm/utils/bsOrderBackFormValues.js +5 -1
  24. package/dist/esm/utils/index.d.ts +2 -1
  25. package/dist/esm/utils/index.js +3 -2
  26. package/dist/esm/utils/orderBackFormValues.js +3 -0
  27. package/dist/esm/utils/transMultSelectOptions.d.ts +1 -1
  28. package/dist/esm/utils/transMultSelectOptions.js +18 -5
  29. package/dist/esm/utils/unTransField.js +1 -1
  30. package/package.json +2 -2
  31. package/dist/esm/wdt/index.d.ts +0 -2
  32. package/dist/esm/wdt/index.js +0 -2
  33. package/dist/esm/wdt/warehouseData/index.js +0 -41
  34. package/dist/esm/wdtSendData/index.d.ts +0 -14
  35. package/dist/esm/wdtSendData/index.js +0 -46
package/README.md CHANGED
@@ -1 +1 @@
1
- 1112234
1
+ 111226
@@ -69,6 +69,8 @@ declare enum TComponentType {
69
69
  BS_TRADE_PAYMENT_TIME = "BS_TRADE_PAYMENT_TIME",
70
70
  BS_NET_RECEIPTS = "BS_NET_RECEIPTS",
71
71
  BS_PACKAGE_WEIGHT = "BS_PACKAGE_WEIGHT",
72
+ BS_E3_LOGISTICS = "BS_E3_LOGISTICS",
73
+ BS_E3_SEND_GOOD = "BS_E3_SEND_GOOD",
72
74
  BUYER_MESSAGE_NOTICE = "BUYER_MESSAGE_NOTICE",
73
75
  WLN_SYSTEM_ORDER = "WLN_SYSTEM_ORDER",
74
76
  WLN_GOODS = "WLN_GOODS",
@@ -6,8 +6,7 @@ export { default as WdtAddressData } from "./wdtAddressData";
6
6
  export { default as PlatData } from "./platData";
7
7
  export { default as LogisticsAddressData } from "./logisticsAddressData";
8
8
  export { default as LabelData } from "./labelData";
9
- export { default as WdtSendData } from "./wdtSendData";
10
9
  export { default as request } from "./request";
11
- export * as WDT from "./wdt";
12
10
  export * as servers from "./servers";
13
11
  export * from "./utils";
12
+ export { SendDataCenter } from "./utils/SendData";
package/dist/esm/index.js CHANGED
@@ -6,10 +6,8 @@ export { default as WdtAddressData } from "./wdtAddressData";
6
6
  export { default as PlatData } from "./platData";
7
7
  export { default as LogisticsAddressData } from "./logisticsAddressData";
8
8
  export { default as LabelData } from "./labelData";
9
- export { default as WdtSendData } from "./wdtSendData";
10
9
  export { default as request } from "./request";
11
- import * as _WDT from "./wdt";
12
- export { _WDT as WDT };
13
10
  import * as _servers from "./servers";
14
11
  export { _servers as servers };
15
- export * from "./utils";
12
+ export * from "./utils";
13
+ export { SendDataCenter } from "./utils/SendData";
@@ -0,0 +1,2 @@
1
+ export * from './warehouseData';
2
+ export * from './logisticsData';
@@ -0,0 +1,2 @@
1
+ export * from "./warehouseData";
2
+ export * from "./logisticsData";
@@ -0,0 +1,7 @@
1
+ declare type LogisticsType = {
2
+ disabled: boolean;
3
+ label: string;
4
+ value: string;
5
+ };
6
+ export declare const getLogisticsDataAsync: () => Promise<LogisticsType[]>;
7
+ export default getLogisticsDataAsync;
@@ -0,0 +1,32 @@
1
+ import { fetchAll } from "../../utils";
2
+ import request from "../../request";
3
+ var queryBsE3LogisticsList = function queryBsE3LogisticsList(_ref) {
4
+ var pageNo = _ref.pageNo,
5
+ pageSize = _ref.pageSize;
6
+ return request({
7
+ url: "/qy/gdfw/bse3/erp/logistics/list",
8
+ method: "post",
9
+ data: {
10
+ pageNo: pageNo,
11
+ pageSize: pageSize
12
+ }
13
+ });
14
+ };
15
+ export var getLogisticsDataAsync = function getLogisticsDataAsync() {
16
+ return fetchAll("BS_E3_LOGISTICS_DATA", queryBsE3LogisticsList, function (data) {
17
+ var list = [];
18
+ var logisticsList = (data === null || data === void 0 ? void 0 : data.logisticsList) || [];
19
+ logisticsList.map(function (item) {
20
+ list.push({
21
+ label: item.logisticsName,
22
+ value: item.logisticsNo,
23
+ disabled: false
24
+ });
25
+ });
26
+ return list;
27
+ }, {
28
+ pageNo: 1,
29
+ pageSize: 100
30
+ });
31
+ };
32
+ export default getLogisticsDataAsync;
@@ -1,6 +1,7 @@
1
1
  declare type WarehouseType = {
2
+ disabled: boolean;
2
3
  label: string;
3
4
  value: string;
4
5
  };
5
- declare const getWarehouseDataAsync: () => Promise<WarehouseType[]>;
6
+ export declare const getWarehouseDataAsync: () => Promise<WarehouseType[]>;
6
7
  export default getWarehouseDataAsync;
@@ -0,0 +1,32 @@
1
+ import { fetchAll } from "../../utils";
2
+ import request from "../../request";
3
+ var queryWarehouseList = function queryWarehouseList(_ref) {
4
+ var pageNo = _ref.pageNo,
5
+ pageSize = _ref.pageSize;
6
+ return request({
7
+ url: "/qy/gdfw/bse3/erp/warehouse/list",
8
+ method: "post",
9
+ data: {
10
+ pageNo: pageNo,
11
+ pageSize: pageSize
12
+ }
13
+ });
14
+ };
15
+ export var getWarehouseDataAsync = function getWarehouseDataAsync() {
16
+ return fetchAll("BS_E3_WAREHOUSE_DATA", queryWarehouseList, function (data) {
17
+ var list = [];
18
+ var warehouses = (data === null || data === void 0 ? void 0 : data.warehouseList) || [];
19
+ warehouses.map(function (item) {
20
+ list.push({
21
+ label: item.warehouseName,
22
+ value: item.warehouseNo,
23
+ disabled: !!(item.isDisabled || item.isDelete)
24
+ });
25
+ });
26
+ return list;
27
+ }, {
28
+ pageNo: 1,
29
+ pageSize: 100
30
+ });
31
+ };
32
+ export default getWarehouseDataAsync;
@@ -0,0 +1 @@
1
+ export * from './warehouseData';
@@ -0,0 +1 @@
1
+ export * from "./warehouseData";
@@ -0,0 +1,7 @@
1
+ declare type WarehouseType = {
2
+ disabled: boolean;
3
+ label: string;
4
+ value: string;
5
+ };
6
+ export declare const getWarehouseDataAsync: () => Promise<WarehouseType[]>;
7
+ export default getWarehouseDataAsync;
@@ -0,0 +1,32 @@
1
+ import { fetchAll } from "../../utils";
2
+ import request from "../../request";
3
+ var queryWarehouseList = function queryWarehouseList(_ref) {
4
+ var pageNo = _ref.pageNo,
5
+ pageSize = _ref.pageSize;
6
+ return request({
7
+ url: "/qy/gdfw/wdt/erp/warehouse/list",
8
+ method: "post",
9
+ data: {
10
+ pageNo: pageNo,
11
+ pageSize: pageSize
12
+ }
13
+ });
14
+ };
15
+ export var getWarehouseDataAsync = function getWarehouseDataAsync() {
16
+ return fetchAll("WDT_WAREHOUSE_DATA", queryWarehouseList, function (data) {
17
+ var list = [];
18
+ var warehouses = (data === null || data === void 0 ? void 0 : data.warehouses) || [];
19
+ warehouses.map(function (_ref2) {
20
+ var warehouseNo = _ref2.warehouseNo,
21
+ name = _ref2.name,
22
+ isDisabled = _ref2.isDisabled;
23
+ list.push({
24
+ label: name,
25
+ value: warehouseNo,
26
+ disabled: isDisabled
27
+ });
28
+ });
29
+ return list;
30
+ });
31
+ };
32
+ export default getWarehouseDataAsync;
@@ -1,6 +1,8 @@
1
1
  import WdtAddressData from "../wdtAddressData";
2
2
  import AddressData from "../addressData";
3
3
  import BsAddressData from "../bsAddressData";
4
+ export * as BSE3 from './BSE3';
5
+ export * as WDT from './WDT';
4
6
  export declare const queryWdtAddressData: (instance?: WdtAddressData) => Promise<void>;
5
7
  export declare const queryAddressData: (instance?: AddressData) => Promise<void>;
6
8
  export declare const queryBsAddressData: (instance?: BsAddressData) => Promise<void>;
@@ -15,5 +17,5 @@ export declare const queryWdtWarehouseList: (pageNo: number, pageSize: number) =
15
17
  export declare const getWdtSellerLogisticsCompanyRelation: () => Promise<{
16
18
  label: string;
17
19
  value: string;
18
- disabled: any;
20
+ disabled: boolean;
19
21
  }[]>;
@@ -4,6 +4,10 @@ import AddressData from "../addressData";
4
4
  import BsAddressData from "../bsAddressData";
5
5
  import toTree from "../utils/toTree";
6
6
  import request from "../request/index";
7
+ import * as _BSE from "./BSE3";
8
+ export { _BSE as BSE3 };
9
+ import * as _WDT from "./WDT";
10
+ export { _WDT as WDT };
7
11
  var transformData = function transformData(list) {
8
12
  var map = {};
9
13
  var res = {};
@@ -86,7 +90,7 @@ export var getWdtSellerLogisticsCompanyRelation = function getWdtSellerLogistics
86
90
  return {
87
91
  label: item.logisticsName,
88
92
  value: item.logisticsNo,
89
- disabled: item.isDelete
93
+ disabled: item.isDisabled
90
94
  };
91
95
  }).filter(function (item) {
92
96
  return item.value;
@@ -0,0 +1,9 @@
1
+ export declare function fetchAll<T = any, D = any>(key: string, fetchAction: (params: {
2
+ pageNo: number;
3
+ pageSize: number;
4
+ }) => Promise<{
5
+ data?: D;
6
+ }>, getList: (data: D) => T[], { pageNo, pageSize }?: {
7
+ pageNo?: number | undefined;
8
+ pageSize?: number | undefined;
9
+ }): Promise<T[]>;
@@ -0,0 +1,44 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ 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."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ var singletonPromiseMap = new Map();
8
+ export function fetchAll(key, fetchAction, getList) {
9
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
10
+ _ref$pageNo = _ref.pageNo,
11
+ pageNo = _ref$pageNo === void 0 ? 0 : _ref$pageNo,
12
+ _ref$pageSize = _ref.pageSize,
13
+ pageSize = _ref$pageSize === void 0 ? 100 : _ref$pageSize;
14
+ if (!singletonPromiseMap.has(key)) {
15
+ singletonPromiseMap.set(key, new Promise(function (resolve, reject) {
16
+ var list = [];
17
+ var pagePointer = pageNo;
18
+ function fetchList() {
19
+ fetchAction({
20
+ pageNo: pagePointer,
21
+ pageSize: pageSize
22
+ }).then(function (res) {
23
+ if (res.data) {
24
+ var newList = getList(res.data);
25
+ list.push.apply(list, _toConsumableArray(newList));
26
+ if (pageSize === newList.length) {
27
+ pagePointer++;
28
+ fetchList();
29
+ } else {
30
+ resolve(list);
31
+ }
32
+ } else {
33
+ resolve([]);
34
+ }
35
+ }).catch(function (e) {
36
+ singletonPromiseMap.delete(key);
37
+ reject(e);
38
+ });
39
+ }
40
+ fetchList();
41
+ }));
42
+ }
43
+ return singletonPromiseMap.get(key);
44
+ }
@@ -0,0 +1,22 @@
1
+ interface OptionsItem {
2
+ label: string;
3
+ value: string;
4
+ }
5
+ declare type SendGoodPlatform = string;
6
+ declare class SendData {
7
+ private platform;
8
+ private sendData;
9
+ private service?;
10
+ constructor(platform: SendGoodPlatform);
11
+ fetchData: () => Promise<void>;
12
+ getSendData: () => OptionsItem[];
13
+ setSendData: (val: OptionsItem[]) => OptionsItem[];
14
+ getSendNameByCode: (code: string | number, returnCurrentValue?: boolean) => string | number;
15
+ getSendCodeByName: (name: string | number, returnCurrentValue?: boolean) => string | number;
16
+ }
17
+ export declare class SendDataCenter {
18
+ static instanceMap: Map<SendGoodPlatform, SendData>;
19
+ static getInstance(platform: SendGoodPlatform): SendData;
20
+ static fetchData(): Promise<[void]>;
21
+ }
22
+ export {};
@@ -0,0 +1,84 @@
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
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
+ import { BSE3, WDT } from "../servers/index";
12
+ var SendData = /*#__PURE__*/_createClass(function SendData(platform) {
13
+ var _this = this;
14
+ _classCallCheck(this, SendData);
15
+ _defineProperty(this, "platform", void 0);
16
+ _defineProperty(this, "sendData", []);
17
+ _defineProperty(this, "service", void 0);
18
+ _defineProperty(this, "fetchData", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
19
+ var _this$service;
20
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
21
+ while (1) switch (_context.prev = _context.next) {
22
+ case 0:
23
+ _context.next = 2;
24
+ return (_this$service = _this.service) === null || _this$service === void 0 ? void 0 : _this$service.getWarehouseDataAsync().then(function (list) {
25
+ _this.sendData = list;
26
+ });
27
+ case 2:
28
+ case "end":
29
+ return _context.stop();
30
+ }
31
+ }, _callee);
32
+ })));
33
+ _defineProperty(this, "getSendData", function () {
34
+ return _this.sendData;
35
+ });
36
+ _defineProperty(this, "setSendData", function (val) {
37
+ return _this.sendData = val;
38
+ });
39
+ _defineProperty(this, "getSendNameByCode", function (code) {
40
+ var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
41
+ var item = (_this.sendData || []).filter(function (item) {
42
+ return item.value === code;
43
+ });
44
+ return item.length ? item[0].label : returnCurrentValue ? code : "";
45
+ });
46
+ _defineProperty(this, "getSendCodeByName", function (name) {
47
+ var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
48
+ var item = (_this.sendData || []).filter(function (item) {
49
+ return item.label === name;
50
+ });
51
+ return item.length ? item[0].value : returnCurrentValue ? name : "";
52
+ });
53
+ this.platform = platform;
54
+ this.service = {
55
+ bsE3: BSE3,
56
+ wdt: WDT
57
+ }[this.platform];
58
+ });
59
+ export var SendDataCenter = /*#__PURE__*/function () {
60
+ function SendDataCenter() {
61
+ _classCallCheck(this, SendDataCenter);
62
+ }
63
+ _createClass(SendDataCenter, null, [{
64
+ key: "getInstance",
65
+ value: function getInstance(platform) {
66
+ if (!platform) throw new Error("获取实例需要传入平台类型");
67
+ if (platform === "WDT_SEND_GOOD") platform = "wdt";
68
+ if (platform === "BS_E3_SEND_GOOD") platform = "bsE3";
69
+ if (!this.instanceMap.has(platform)) {
70
+ this.instanceMap.set(platform, new SendData(platform));
71
+ }
72
+ return this.instanceMap.get(platform);
73
+ }
74
+ }, {
75
+ key: "fetchData",
76
+ value: function fetchData() {
77
+ return Promise.all([this.getInstance("wdt").fetchData()
78
+ // this.getInstance("bsE3").fetchData()
79
+ ]);
80
+ }
81
+ }]);
82
+ return SendDataCenter;
83
+ }();
84
+ _defineProperty(SendDataCenter, "instanceMap", new Map());
@@ -1,6 +1,5 @@
1
1
  export declare const BS_E3_BOOLEAN_STATUS_MAP: Record<number, string>;
2
2
  export declare const BS_E3_ORDER_STATUS_MAP: Record<number, string>;
3
- export declare const BS_E3_IS_GIFT_STATUS_MAP: Record<number, string>;
4
3
  export declare const updateBsE3GoodsHandle: (orders?: any[]) => any;
5
4
  export declare const bsE3OrderBackFormValues: (detail?: any, templateDetail?: any) => any;
6
5
  export declare const bsE3OrderTransform: (detail: any, form: any) => {
@@ -10,6 +9,7 @@ export declare const bsE3OrderTransform: (detail: any, form: any) => {
10
9
  selectIds: any;
11
10
  showOrderInfo: any;
12
11
  };
12
+ bsE3SystemOrderNo: any;
13
13
  bsE3Goods: {
14
14
  orders: any;
15
15
  orderNo: any;
@@ -10,7 +10,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
10
10
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
11
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
12
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
- import ExpressData from "../expressData";
14
13
  import uuid from "./getUUid";
15
14
  export var BS_E3_BOOLEAN_STATUS_MAP = {
16
15
  0: "否",
@@ -22,10 +21,6 @@ export var BS_E3_ORDER_STATUS_MAP = {
22
21
  3: "已作废",
23
22
  5: "已完成"
24
23
  };
25
- export var BS_E3_IS_GIFT_STATUS_MAP = {
26
- 0: "非赠品",
27
- 1: "赠品"
28
- };
29
24
  export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
30
25
  var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
31
26
  var list = orders.reduce(function (prv, next) {
@@ -33,7 +28,6 @@ export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
33
28
  var goods = next === null || next === void 0 ? void 0 : (_next$orderDetailGets = next.orderDetailGets) === null || _next$orderDetailGets === void 0 ? void 0 : _next$orderDetailGets.map(function (item) {
34
29
  return _objectSpread(_objectSpread({}, item), {}, {
35
30
  mark: "是",
36
- isGift: BS_E3_IS_GIFT_STATUS_MAP === null || BS_E3_IS_GIFT_STATUS_MAP === void 0 ? void 0 : BS_E3_IS_GIFT_STATUS_MAP[item.isGift],
37
31
  canDelete: true,
38
32
  uuid: uuid()
39
33
  });
@@ -50,8 +44,39 @@ export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
50
44
  }
51
45
  return list;
52
46
  };
53
- var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type) {
47
+ var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type, comList, form) {
54
48
  var _newList;
49
+ if (type === "logistics") {
50
+ var _comList$find, _currentCom$component;
51
+ var currentCom = comList === null || comList === void 0 ? void 0 : (_comList$find = comList.find) === null || _comList$find === void 0 ? void 0 : _comList$find.call(comList, function (item) {
52
+ return item.workOrderComponentType === 'BS_E3_LOGISTICS';
53
+ });
54
+ var notOrderBack = (currentCom === null || currentCom === void 0 ? void 0 : (_currentCom$component = currentCom.componentConfig) === null || _currentCom$component === void 0 ? void 0 : _currentCom$component.notOrderBack) || false;
55
+ if (notOrderBack) {
56
+ var _currentValue;
57
+ var currentValue = form.getFieldValue(currentCom.uniqueKey);
58
+ currentValue = (_currentValue = currentValue) !== null && _currentValue !== void 0 && _currentValue.length ? currentValue : [{
59
+ logisticsCode: "",
60
+ logisticsCompany: ""
61
+ }];
62
+ return currentValue;
63
+ }
64
+ } else if (type === "send") {
65
+ var _comList$find2, _currentCom$component2;
66
+ var _currentCom = comList === null || comList === void 0 ? void 0 : (_comList$find2 = comList.find) === null || _comList$find2 === void 0 ? void 0 : _comList$find2.call(comList, function (item) {
67
+ return item.workOrderComponentType === 'BS_E3_SEND_GOOD';
68
+ });
69
+ var _notOrderBack = (_currentCom === null || _currentCom === void 0 ? void 0 : (_currentCom$component2 = _currentCom.componentConfig) === null || _currentCom$component2 === void 0 ? void 0 : _currentCom$component2.notOrderBack) || false;
70
+ if (_notOrderBack) {
71
+ var _currentValue3;
72
+ var _currentValue2 = form.getFieldValue(_currentCom.uniqueKey);
73
+ _currentValue2 = (_currentValue3 = _currentValue2) !== null && _currentValue3 !== void 0 && _currentValue3.length ? _currentValue2 : [{
74
+ sendId: "",
75
+ sendName: ""
76
+ }];
77
+ return _currentValue2;
78
+ }
79
+ }
55
80
  var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
56
81
  var items = ((next === null || next === void 0 ? void 0 : next.orderDetailGets) || []).map(function (t) {
57
82
  return {
@@ -61,20 +86,17 @@ var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type) {
61
86
  skuId: (t === null || t === void 0 ? void 0 : t.goodsSn) || ""
62
87
  };
63
88
  });
64
- var advList = (next.advancedDistributionInfos || []).map(function (item) {
65
- var params = {
66
- items: items
67
- };
68
- if (type === "logistics") {
69
- params.logisticsCompany = ExpressData.getInstance().getExpressCodeByName(item.logisticCompany);
70
- params.logisticsCode = item === null || item === void 0 ? void 0 : item.deliveryNo;
71
- } else if (type === "send") {
72
- params.sendId = item.wareHouseRealCode;
73
- params.sendName = item.wareHouseRealName;
74
- }
75
- return params;
76
- });
77
- prv.push.apply(prv, _toConsumableArray(advList));
89
+ var params = {
90
+ items: items
91
+ };
92
+ if (type === "logistics") {
93
+ params.logisticsCompany = next === null || next === void 0 ? void 0 : next.shippingCode;
94
+ params.logisticsCode = next === null || next === void 0 ? void 0 : next.shippingSn;
95
+ } else if (type === "send") {
96
+ params.sendId = next === null || next === void 0 ? void 0 : next.fhck;
97
+ params.sendName = next === null || next === void 0 ? void 0 : next.fhck;
98
+ }
99
+ prv.push(params);
78
100
  return prv;
79
101
  }, []);
80
102
  if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
@@ -178,26 +200,21 @@ export var bsE3OrderBackFormValues = function bsE3OrderBackFormValues() {
178
200
  // prv[uniqueKey] = detail?.bsExchangeGoods;
179
201
  // break;
180
202
  case "BS_E3_REISSUE_GOODS":
181
- prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsE3ReissueGoods;
203
+ prv[uniqueKey] = {
204
+ bsE3SystemOrder: detail === null || detail === void 0 ? void 0 : detail.bsE3SystemOrder,
205
+ bsE3SystemOrderNo: detail === null || detail === void 0 ? void 0 : detail.bsE3SystemOrderNo,
206
+ bsE3ReissueGoods: []
207
+ };
182
208
  break;
183
209
  // case "BS_RETURN_GOODS":
184
210
  // prv[uniqueKey] = detail?.bsReturnGoods;
185
211
  // break;
186
- // case "BS_LOGISTICS":
187
- // prv[uniqueKey] = updateBsE3ItemListByConfigHandle(
188
- // detail?.bsLogistics,
189
- // "logistics",
190
- // config
191
- // );
192
- // break;
193
- // case "BS_SEND_GOOD":
194
- // prv[uniqueKey] = updateBsE3ItemListByConfigHandle(
195
- // detail?.bsSendGood,
196
- // "send",
197
- // config
198
- // );
199
-
200
- // break;
212
+ case "BS_E3_LOGISTICS":
213
+ prv[uniqueKey] = updateBsE3ItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.bsE3Logistics, "logistics", config);
214
+ break;
215
+ case "BS_E3_SEND_GOOD":
216
+ prv[uniqueKey] = updateBsE3ItemListByConfigHandle(detail === null || detail === void 0 ? void 0 : detail.bsE3SendGood, "send", config);
217
+ break;
201
218
  // case "BS_DELIVERY_NO":
202
219
  // prv[uniqueKey] = detail?.bsDeliveryNo;
203
220
  // break;
@@ -258,7 +275,7 @@ export var bsE3OrderBackFormValues = function bsE3OrderBackFormValues() {
258
275
  };
259
276
  //bsE3订单信息转换
260
277
  export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
261
- var _form$getFieldValue, _orderList$find, _orderList$find$call;
278
+ var _form$getFieldValue, _newOrderList$, _orderList$find, _orderList$find$call;
262
279
  var orderNo = detail.orderNo,
263
280
  _detail$orderList = detail.orderList,
264
281
  orderList = _detail$orderList === void 0 ? [] : _detail$orderList,
@@ -268,32 +285,21 @@ export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
268
285
  });
269
286
  var isStrict = bsE3GoodsCom ? (_form$getFieldValue = form.getFieldValue(bsE3GoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
270
287
  var newOrderList = orderList === null || orderList === void 0 ? void 0 : orderList.map(function (item) {
271
- var isSplit = item.isSplit,
272
- isSplitNew = item.isSplitNew,
273
- isCopy = item.isCopy,
274
- isExchangeOrder = item.isExchangeOrder,
275
- isCombineNew = item.isCombineNew,
276
- isCombine = item.isCombine,
277
- orderStatus = item.orderStatus;
278
288
  return _objectSpread(_objectSpread({}, item), {}, {
279
- orderStatus: BS_E3_ORDER_STATUS_MAP[orderStatus],
280
- isSplit: BS_E3_BOOLEAN_STATUS_MAP[isSplit],
281
- isSplitNew: BS_E3_BOOLEAN_STATUS_MAP[isSplitNew],
282
- isExchangeOrder: BS_E3_BOOLEAN_STATUS_MAP[isExchangeOrder],
283
- isCopy: BS_E3_BOOLEAN_STATUS_MAP[isCopy],
284
- isCombineNew: BS_E3_BOOLEAN_STATUS_MAP[isCombineNew],
285
- isCombine: BS_E3_BOOLEAN_STATUS_MAP[isCombine]
289
+ billNo: item.orderSn
286
290
  });
287
291
  });
288
292
  return {
289
293
  bsE3SystemOrder: {
290
294
  orderNo: orderNo,
291
295
  orders: newOrderList,
292
- selectIds: (orderList === null || orderList === void 0 ? void 0 : orderList.length) === 1 ? orderList.map(function (item) {
296
+ selectIds: (newOrderList === null || newOrderList === void 0 ? void 0 : newOrderList.length) === 1 ? orderList.map(function (item) {
293
297
  return item.orderSn;
294
298
  }) : [],
295
299
  showOrderInfo: newOrderList
296
300
  },
301
+ // TODO: 当只有一条系统单时默认选中该系统单
302
+ bsE3SystemOrderNo: (newOrderList === null || newOrderList === void 0 ? void 0 : newOrderList.length) === 1 ? (_newOrderList$ = newOrderList[0]) === null || _newOrderList$ === void 0 ? void 0 : _newOrderList$.billNo : undefined,
297
303
  bsE3Goods: {
298
304
  // 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
299
305
  orders: orderList || [],
@@ -305,8 +311,8 @@ export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
305
311
  return !isStrict || !orderNo || good.originalDealCode === orderNo;
306
312
  })
307
313
  },
308
- bsE3Logistics: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "logistics"),
309
- bsE3SendGood: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "send")
314
+ bsE3Logistics: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
315
+ bsE3SendGood: updateBsE3ItemListHandle(detail === null || detail === void 0 ? void 0 : detail.orderList, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
310
316
  };
311
317
  };
312
318
  // WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
@@ -260,10 +260,14 @@ export var bsOrderTransform = function bsOrderTransform(detail) {
260
260
  return {
261
261
  billNo: item.billNo,
262
262
  billType: item.billType,
263
- billTag: item.billTag
263
+ billTag: item.billTag,
264
+ authorName: item.authorName,
265
+ authorId: item.authorId
266
+ // liveActivites: item.liveActivites,
264
267
  };
265
268
  })
266
269
  },
270
+
267
271
  bsSingingTime: detail === null || detail === void 0 ? void 0 : detail.receiptDate,
268
272
  bsSendTime: detail === null || detail === void 0 ? void 0 : (_detail$orders3 = detail.orders) === null || _detail$orders3 === void 0 ? void 0 : (_detail$orders3$ = _detail$orders3[0]) === null || _detail$orders3$ === void 0 ? void 0 : (_detail$orders3$$adva = _detail$orders3$.advancedDistributionInfos) === null || _detail$orders3$$adva === void 0 ? void 0 : (_detail$orders3$$adva2 = _detail$orders3$$adva[0]) === null || _detail$orders3$$adva2 === void 0 ? void 0 : _detail$orders3$$adva2.deliveryDate,
269
273
  bsTradePaymentTime: detail === null || detail === void 0 ? void 0 : detail.payDate,
@@ -7,7 +7,7 @@ export { default as getExpression } from "./getExpression";
7
7
  export { default as formatDisplayConfig } from "./formatDisplayConfig";
8
8
  export { default as orderBackFormValues } from "./orderBackFormValues";
9
9
  export { bsOrderBackFormValues, bsOrderTransform, } from "./bsOrderBackFormValues";
10
- export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, BS_E3_IS_GIFT_STATUS_MAP } from './bsE3OrderBackFormValues';
10
+ export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, } from './bsE3OrderBackFormValues';
11
11
  export { wlnOrderBackFormValues, wlnOrderTransform, } from "./wlnOrderBackFormValues";
12
12
  export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle, } from "./wdtOrderBackFormValues";
13
13
  export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
@@ -16,3 +16,4 @@ export * as filterFn from "./filterFn";
16
16
  export * as templateFn from "./template";
17
17
  export * as tree from "./multidimensionalFindChild";
18
18
  export { default as unTransField } from "./unTransField";
19
+ export { fetchAll } from "./FetchAll";
@@ -7,7 +7,7 @@ export { default as getExpression } from "./getExpression";
7
7
  export { default as formatDisplayConfig } from "./formatDisplayConfig";
8
8
  export { default as orderBackFormValues } from "./orderBackFormValues";
9
9
  export { bsOrderBackFormValues, bsOrderTransform } from "./bsOrderBackFormValues";
10
- export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, BS_E3_IS_GIFT_STATUS_MAP } from "./bsE3OrderBackFormValues";
10
+ export { bsE3OrderBackFormValues, bsE3OrderTransform, updateBsE3GoodsHandle, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP } from "./bsE3OrderBackFormValues";
11
11
  export { wlnOrderBackFormValues, wlnOrderTransform } from "./wlnOrderBackFormValues";
12
12
  export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle } from "./wdtOrderBackFormValues";
13
13
  export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
@@ -18,4 +18,5 @@ import * as _templateFn from "./template";
18
18
  export { _templateFn as templateFn };
19
19
  import * as _tree from "./multidimensionalFindChild";
20
20
  export { _tree as tree };
21
- export { default as unTransField } from "./unTransField";
21
+ export { default as unTransField } from "./unTransField";
22
+ export { fetchAll } from "./FetchAll";
@@ -118,6 +118,9 @@ export default (function (_ref) {
118
118
  case "ACTUAL_PAYMENT":
119
119
  prv[uniqueKey] = detail["actualPayment"];
120
120
  break;
121
+ case "ACTUAL_RECEIPT_PAYMENT":
122
+ prv[uniqueKey] = detail["actualReceiptPayment"];
123
+ break;
121
124
  case "EXPRESS_LOGISTICS_SELECT":
122
125
  prv[uniqueKey] = {
123
126
  company: config.isSingle && config.showField === "EXPRESS_COMPANY" || !config.isSingle ? ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]) : "",
@@ -1,2 +1,2 @@
1
- declare const _default: (sourceOptions: any[]) => any;
1
+ declare const _default: (sourceOptions: any[], isFilterHide?: boolean) => any;
2
2
  export default _default;
@@ -1,12 +1,16 @@
1
1
  import get from "lodash/get";
2
2
  var findNodeById = function findNodeById(tree) {
3
3
  var actived = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
4
+ var isFilterHide = arguments.length > 2 ? arguments[2] : undefined;
4
5
  for (var i = 0; i < tree.length; i++) {
5
6
  if (tree[i].actived == actived) {
6
- return tree[i];
7
+ return isFilterHide ? tree[i].hide ? null : tree[i] : tree[i];
7
8
  }
8
9
  if (tree[i].children) {
9
- var result = findNodeById(tree[i].children, actived);
10
+ var newTree = isFilterHide ? tree[i].children.filter(function (t) {
11
+ return !t.hide;
12
+ }) : tree[i].children;
13
+ var result = findNodeById(newTree, actived, isFilterHide);
10
14
  if (result) {
11
15
  return result;
12
16
  }
@@ -14,16 +18,25 @@ var findNodeById = function findNodeById(tree) {
14
18
  }
15
19
  };
16
20
  export default (function (sourceOptions) {
21
+ var isFilterHide = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
17
22
  var tree = [];
18
23
  var newOptions = JSON.parse(JSON.stringify(sourceOptions));
19
24
  newOptions.map(function (item) {
20
25
  if (tree.length === 0) {
21
- return tree = tree.concat(get(item, "list.1", []));
26
+ var list = get(item, "list.1", []);
27
+ if (isFilterHide) {
28
+ list = list.filter(function (t) {
29
+ return !t.hide;
30
+ });
31
+ }
32
+ return tree = tree.concat(list);
22
33
  }
23
34
  Object.keys(item.list).map(function (l) {
24
35
  // 在树中找到l对应的节点,将当前数组放到children里面
25
- var result = findNodeById(tree, l);
26
- result && (result.children = item.list[l]);
36
+ var result = findNodeById(tree, l, isFilterHide);
37
+ result && (result.children = isFilterHide ? item.list[l].filter(function (t) {
38
+ return !t.hide;
39
+ }) : item.list[l]);
27
40
  });
28
41
  });
29
42
  return tree;
@@ -1,5 +1,5 @@
1
1
  export default (function (key) {
2
- return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "checkbox", "multSelect", "rate", "picture", "file", "wdtGoods", "wdtReissueType", "wdtSystemOrderNo", "wdtReissueGoods", "wdtSendGood", "wdtSendId", "wdtSendName", "wdtLogisticsCode", "wdtSystemShowOrder", "wdtSystemSelectIds", "wdtLogisticsCompany", "wdtLogisticsList", "wdtReturnGoods", "wdtReturnType", "wdtExchangeGoods", "bsSendGood", "bsSendId", "bsSendName", "bsGoods", "bsExchangeType", "bsExchangeReturnGoods", "bsExchangeSwapOutGoods", "bsExchangeGiftGoods", "bsReissueType", "bsReissueGoods", "bsReturnGoods", "bsReturnType", "bsLogisticsList", "bsLogisticsCompany", "bsLogisticsCode", "bsSystemShowOrder", "bsSystemSelectIds", "bsE3SystemOrderNo", "bsE3SystemShowOrder", "bsE3SystemSelectIds", "bsE3Goods", "reissueLogisticsList", "reissueLogisticsCompany", "reissueLogisticsCode", "deliveryNoList", "deliveryNoIds", "returnGoodsStatusList", "returnGoodsTradeIdList", "returnGoodsTradeItemList", "tradeIdList", "tradeItemList", "wlnLogisticsList", "wlnLogisticsCompany", "wlnLogisticsCode", "wlnSystemShowOrder", "wlnSystemSelectIds", "wlnGoods", "wlnSendGood", "wlnSendId", "wlnSendName", "exchangeReason", "flowTag", "returnGoodsStatusList", "returnGoodsStatusValue", "exchangeReason", "exchangeStatusValue", "inStockStatusItemList", "inStockStatusList", "reissueStatusValue", "reissueReason", "adjustWorkOrderStatusValue", "adjustWorkOrderReason", "msgStatusValues", "msgStatus4Search", "createStatusValue", "createReason", "invoiceStatusValue", "invoiceReason", "invoicingStatusValue", "invoicingReason", "trajectoryList", "trajectoryMoreCompany", "trajectoryMoreCode", "trajectoryMoreSnapshot", "logisticsInterceptList", "logisticsInterceptCompanyList", "logisticsInterceptCodeList", "logisticsInterceptTypeList", "logisticsInterceptStatusList", "logisticsInterceptApiStatusList", "interceptLogisticsApiStatus", "logisticsInterceptSnapshotList", "productList", "label", "kmSendGood", "kmSendId", "kmSendName"].reduce(function (cur, nxt) {
2
+ return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "checkbox", "multSelect", "rate", "picture", "file", "wdtGoods", "wdtReissueType", "wdtSystemOrderNo", "wdtReissueGoods", "wdtSendGood", "wdtSendId", "wdtSendName", "wdtLogisticsCode", "wdtSystemShowOrder", "wdtSystemSelectIds", "wdtLogisticsCompany", "wdtLogisticsList", "wdtReturnGoods", "wdtReturnType", "wdtExchangeGoods", "bsSendGood", "bsSendId", "bsSendName", "bsGoods", "bsExchangeType", "bsExchangeReturnGoods", "bsExchangeSwapOutGoods", "bsExchangeGiftGoods", "bsReissueType", "bsReissueGoods", "bsReturnGoods", "bsReturnType", "bsLogisticsList", "bsLogisticsCompany", "bsLogisticsCode", "bsSystemShowOrder", "bsSystemSelectIds", "bsE3SystemOrderNo", "bsE3SystemShowOrder", "bsE3SystemSelectIds", "bsE3Goods", "bsE3ReissueGoods", "bsE3ReissueType", "reissueLogisticsList", "reissueLogisticsCompany", "reissueLogisticsCode", "deliveryNoList", "deliveryNoIds", "returnGoodsStatusList", "returnGoodsTradeIdList", "returnGoodsTradeItemList", "tradeIdList", "tradeItemList", "wlnLogisticsList", "wlnLogisticsCompany", "wlnLogisticsCode", "wlnSystemShowOrder", "wlnSystemSelectIds", "wlnGoods", "wlnSendGood", "wlnSendId", "wlnSendName", "exchangeReason", "flowTag", "returnGoodsStatusList", "returnGoodsStatusValue", "exchangeReason", "exchangeStatusValue", "inStockStatusItemList", "inStockStatusList", "reissueStatusValue", "reissueReason", "adjustWorkOrderStatusValue", "adjustWorkOrderReason", "msgStatusValues", "msgStatus4Search", "createStatusValue", "createReason", "invoiceStatusValue", "invoiceReason", "invoicingStatusValue", "invoicingReason", "trajectoryList", "trajectoryMoreCompany", "trajectoryMoreCode", "trajectoryMoreSnapshot", "logisticsInterceptList", "logisticsInterceptCompanyList", "logisticsInterceptCodeList", "logisticsInterceptTypeList", "logisticsInterceptStatusList", "logisticsInterceptApiStatusList", "interceptLogisticsApiStatus", "logisticsInterceptSnapshotList", "productList", "label", "kmSendGood", "kmSendId", "kmSendName"].reduce(function (cur, nxt) {
3
3
  return cur || (key === null || key === void 0 ? void 0 : key.includes(nxt));
4
4
  }, false);
5
5
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "2.0.0-rc.1",
3
+ "version": "2.0.0-rc.2",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "2d999c6e66d347c6a33cbe92d69fd9f9511445a7",
44
+ "gitHead": "368b8207c54e58488484df65546139325df9df68",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }
@@ -1,2 +0,0 @@
1
- import getWarehouseDataAsync from './warehouseData';
2
- export { getWarehouseDataAsync };
@@ -1,2 +0,0 @@
1
- import getWarehouseDataAsync from "./warehouseData";
2
- export { getWarehouseDataAsync };
@@ -1,41 +0,0 @@
1
- import { queryWdtWarehouseList } from "../../servers/index";
2
- var singletonPromise;
3
- var getWarehouseDataAsync = function getWarehouseDataAsync() {
4
- if (!singletonPromise) {
5
- singletonPromise = new Promise(function (resolve, reject) {
6
- var list = [];
7
- // PS: 接口最大支持100
8
- var pageSize = 100;
9
- var pageNo = 0;
10
- function fetchList() {
11
- queryWdtWarehouseList(pageNo, pageSize).then(function (res) {
12
- var data = res.data;
13
- var warehouses = (data === null || data === void 0 ? void 0 : data.warehouses) || [];
14
- warehouses.map(function (_ref) {
15
- var warehouseNo = _ref.warehouseNo,
16
- name = _ref.name,
17
- is_disabled = _ref.is_disabled;
18
- if (!is_disabled) {
19
- list.push({
20
- label: name,
21
- value: warehouseNo
22
- });
23
- }
24
- });
25
- pageNo++;
26
- if (pageSize === warehouses.length) {
27
- fetchList();
28
- } else {
29
- resolve(list);
30
- }
31
- }).catch(function (e) {
32
- singletonPromise = null;
33
- reject(e);
34
- });
35
- }
36
- fetchList();
37
- });
38
- }
39
- return singletonPromise;
40
- };
41
- export default getWarehouseDataAsync;
@@ -1,14 +0,0 @@
1
- interface OptionsItem {
2
- label: string;
3
- value: string;
4
- }
5
- export default class WdtSendData {
6
- private static instance;
7
- wdtSendData: OptionsItem[];
8
- getWdtSendData: () => OptionsItem[];
9
- setWdtSendData: (val: OptionsItem[]) => OptionsItem[];
10
- getWdtSendNameByCode: (code: string | number, returnCurrentValue?: boolean) => string | number;
11
- getWdtSendCodeByName: (name: string | number, returnCurrentValue?: boolean) => string | number;
12
- static getInstance(): WdtSendData;
13
- }
14
- export {};
@@ -1,46 +0,0 @@
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
4
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
- var WdtSendData = /*#__PURE__*/function () {
9
- function WdtSendData() {
10
- var _this = this;
11
- _classCallCheck(this, WdtSendData);
12
- _defineProperty(this, "wdtSendData", []);
13
- _defineProperty(this, "getWdtSendData", function () {
14
- return _this.wdtSendData;
15
- });
16
- _defineProperty(this, "setWdtSendData", function (val) {
17
- return _this.wdtSendData = val;
18
- });
19
- _defineProperty(this, "getWdtSendNameByCode", function (code) {
20
- var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
21
- var item = (_this.wdtSendData || []).filter(function (item) {
22
- return item.value === code;
23
- });
24
- return item.length ? item[0].label : returnCurrentValue ? code : "";
25
- });
26
- _defineProperty(this, "getWdtSendCodeByName", function (name) {
27
- var returnCurrentValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
28
- var item = (_this.wdtSendData || []).filter(function (item) {
29
- return item.label === name;
30
- });
31
- return item.length ? item[0].value : returnCurrentValue ? name : "";
32
- });
33
- }
34
- _createClass(WdtSendData, null, [{
35
- key: "getInstance",
36
- value: function getInstance() {
37
- if (!WdtSendData.instance) {
38
- WdtSendData.instance = new WdtSendData();
39
- }
40
- return WdtSendData.instance;
41
- }
42
- }]);
43
- return WdtSendData;
44
- }();
45
- _defineProperty(WdtSendData, "instance", void 0);
46
- export { WdtSendData as default };