@kmkf-fe-packages/kmkf-utils 2.0.0-rc.0 → 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.
- package/README.md +1 -1
- package/dist/esm/global.d.ts +2 -0
- package/dist/esm/index.d.ts +1 -2
- package/dist/esm/index.js +2 -4
- package/dist/esm/servers/BSE3/index.d.ts +2 -0
- package/dist/esm/servers/BSE3/index.js +2 -0
- package/dist/esm/servers/BSE3/logisticsData.d.ts +7 -0
- package/dist/esm/servers/BSE3/logisticsData.js +32 -0
- package/dist/esm/{wdt/warehouseData/index.d.ts → servers/BSE3/warehouseData.d.ts} +2 -1
- package/dist/esm/servers/BSE3/warehouseData.js +32 -0
- package/dist/esm/servers/WDT/index.d.ts +1 -0
- package/dist/esm/servers/WDT/index.js +1 -0
- package/dist/esm/servers/WDT/warehouseData.d.ts +7 -0
- package/dist/esm/servers/WDT/warehouseData.js +32 -0
- package/dist/esm/servers/index.d.ts +3 -1
- package/dist/esm/servers/index.js +5 -1
- package/dist/esm/utils/FetchAll.d.ts +9 -0
- package/dist/esm/utils/FetchAll.js +44 -0
- package/dist/esm/utils/SendData.d.ts +22 -0
- package/dist/esm/utils/SendData.js +84 -0
- package/dist/esm/utils/bsE3OrderBackFormValues.d.ts +22 -0
- package/dist/esm/utils/bsE3OrderBackFormValues.js +327 -0
- package/dist/esm/utils/bsOrderBackFormValues.js +5 -1
- package/dist/esm/utils/index.d.ts +3 -1
- package/dist/esm/utils/index.js +4 -2
- package/dist/esm/utils/orderBackFormValues.js +7 -1
- package/dist/esm/utils/transMultSelectOptions.d.ts +1 -1
- package/dist/esm/utils/transMultSelectOptions.js +18 -5
- package/dist/esm/utils/unTransField.js +1 -1
- package/dist/esm/utils/wdtOrderBackFormValues.d.ts +6 -3
- package/dist/esm/utils/wdtOrderBackFormValues.js +28 -16
- package/package.json +2 -2
- package/dist/esm/wdt/index.d.ts +0 -2
- package/dist/esm/wdt/index.js +0 -2
- package/dist/esm/wdt/warehouseData/index.js +0 -41
- package/dist/esm/wdtSendData/index.d.ts +0 -14
- package/dist/esm/wdtSendData/index.js +0 -46
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
111226
|
package/dist/esm/global.d.ts
CHANGED
|
@@ -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",
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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,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,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:
|
|
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.
|
|
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());
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const BS_E3_BOOLEAN_STATUS_MAP: Record<number, string>;
|
|
2
|
+
export declare const BS_E3_ORDER_STATUS_MAP: Record<number, string>;
|
|
3
|
+
export declare const updateBsE3GoodsHandle: (orders?: any[]) => any;
|
|
4
|
+
export declare const bsE3OrderBackFormValues: (detail?: any, templateDetail?: any) => any;
|
|
5
|
+
export declare const bsE3OrderTransform: (detail: any, form: any) => {
|
|
6
|
+
bsE3SystemOrder: {
|
|
7
|
+
orderNo: any;
|
|
8
|
+
orders: any;
|
|
9
|
+
selectIds: any;
|
|
10
|
+
showOrderInfo: any;
|
|
11
|
+
};
|
|
12
|
+
bsE3SystemOrderNo: any;
|
|
13
|
+
bsE3Goods: {
|
|
14
|
+
orders: any;
|
|
15
|
+
orderNo: any;
|
|
16
|
+
shopCode: any;
|
|
17
|
+
bsE3Goods: any;
|
|
18
|
+
};
|
|
19
|
+
bsE3Logistics: any;
|
|
20
|
+
bsE3SendGood: any;
|
|
21
|
+
};
|
|
22
|
+
export declare const filterBsE3Orders: (detail: any, order_no: string) => any;
|
|
@@ -0,0 +1,327 @@
|
|
|
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
8
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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 uuid from "./getUUid";
|
|
14
|
+
export var BS_E3_BOOLEAN_STATUS_MAP = {
|
|
15
|
+
0: "否",
|
|
16
|
+
1: "是"
|
|
17
|
+
};
|
|
18
|
+
export var BS_E3_ORDER_STATUS_MAP = {
|
|
19
|
+
0: "未确认",
|
|
20
|
+
1: "已确认",
|
|
21
|
+
3: "已作废",
|
|
22
|
+
5: "已完成"
|
|
23
|
+
};
|
|
24
|
+
export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
|
|
25
|
+
var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
26
|
+
var list = orders.reduce(function (prv, next) {
|
|
27
|
+
var _next$orderDetailGets;
|
|
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) {
|
|
29
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
30
|
+
mark: "是",
|
|
31
|
+
canDelete: true,
|
|
32
|
+
uuid: uuid()
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
prv.push.apply(prv, _toConsumableArray(goods));
|
|
36
|
+
return prv;
|
|
37
|
+
}, []);
|
|
38
|
+
//如果数量大于1 商品标记为否
|
|
39
|
+
if (list.length > 1) {
|
|
40
|
+
list = list.map(function (item) {
|
|
41
|
+
item.mark = "否";
|
|
42
|
+
return item;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return list;
|
|
46
|
+
};
|
|
47
|
+
var updateBsE3ItemListHandle = function updateBsE3ItemListHandle(list, type, comList, form) {
|
|
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
|
+
}
|
|
80
|
+
var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
|
|
81
|
+
var items = ((next === null || next === void 0 ? void 0 : next.orderDetailGets) || []).map(function (t) {
|
|
82
|
+
return {
|
|
83
|
+
title: (t === null || t === void 0 ? void 0 : t.goodsName) || "",
|
|
84
|
+
picUrl: (t === null || t === void 0 ? void 0 : t.picPath) || "",
|
|
85
|
+
platform: "bse3",
|
|
86
|
+
skuId: (t === null || t === void 0 ? void 0 : t.goodsSn) || ""
|
|
87
|
+
};
|
|
88
|
+
});
|
|
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);
|
|
100
|
+
return prv;
|
|
101
|
+
}, []);
|
|
102
|
+
if (!((_newList = newList) !== null && _newList !== void 0 && _newList.length)) {
|
|
103
|
+
switch (type) {
|
|
104
|
+
case "logistics":
|
|
105
|
+
newList = [{
|
|
106
|
+
logisticsCode: ""
|
|
107
|
+
}];
|
|
108
|
+
break;
|
|
109
|
+
case "supply":
|
|
110
|
+
newList = [{
|
|
111
|
+
supplyId: ""
|
|
112
|
+
}];
|
|
113
|
+
break;
|
|
114
|
+
case "send":
|
|
115
|
+
newList = [{
|
|
116
|
+
sendId: "",
|
|
117
|
+
sendName: ""
|
|
118
|
+
}];
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return newList;
|
|
123
|
+
};
|
|
124
|
+
var updateBsE3SystemItemListHandle = function updateBsE3SystemItemListHandle(list, type) {
|
|
125
|
+
var _newList2;
|
|
126
|
+
var newList = list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
|
|
127
|
+
prv.push({
|
|
128
|
+
deliveryNo: next.wmsStockOutBillNo,
|
|
129
|
+
systemOrderId: next.orderSn
|
|
130
|
+
});
|
|
131
|
+
return prv;
|
|
132
|
+
}, []);
|
|
133
|
+
if (!((_newList2 = newList) !== null && _newList2 !== void 0 && _newList2.length)) {
|
|
134
|
+
switch (type) {
|
|
135
|
+
case "delivery":
|
|
136
|
+
newList = [{
|
|
137
|
+
deliveryNo: "",
|
|
138
|
+
systemOrderId: ""
|
|
139
|
+
}];
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return newList;
|
|
144
|
+
};
|
|
145
|
+
var updateBsE3ItemListByConfigHandle = function updateBsE3ItemListByConfigHandle(list, type) {
|
|
146
|
+
var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
147
|
+
var showField = config.showField;
|
|
148
|
+
return list === null || list === void 0 ? void 0 : list.reduce(function (prv, next) {
|
|
149
|
+
if (type === "logistics") {
|
|
150
|
+
if (!["logisticsCompany", ""].includes(showField || "")) {
|
|
151
|
+
next.logisticsCompany = undefined;
|
|
152
|
+
}
|
|
153
|
+
if (!["logisticsCode", ""].includes(showField || "")) {
|
|
154
|
+
next.logisticsCode = undefined;
|
|
155
|
+
}
|
|
156
|
+
} else if (type === "send") {
|
|
157
|
+
if (!["sendId", "all"].includes(showField || "")) {
|
|
158
|
+
next.sendId = undefined;
|
|
159
|
+
}
|
|
160
|
+
if (!["sendName", "all"].includes(showField || "")) {
|
|
161
|
+
next.sendName = undefined;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
prv.push(next);
|
|
165
|
+
return prv;
|
|
166
|
+
}, []);
|
|
167
|
+
};
|
|
168
|
+
export var bsE3OrderBackFormValues = function bsE3OrderBackFormValues() {
|
|
169
|
+
var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
170
|
+
var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
171
|
+
return ((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []).reduce(function (prv, next) {
|
|
172
|
+
var uniqueKey = next.uniqueKey;
|
|
173
|
+
var config = next.componentConfig;
|
|
174
|
+
switch (next.workOrderComponentType) {
|
|
175
|
+
case "BS_E3_SYSTEM_ORDER":
|
|
176
|
+
prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsE3SystemOrder;
|
|
177
|
+
break;
|
|
178
|
+
// case "BS_SIGNING_TIME":
|
|
179
|
+
// prv[uniqueKey] = detail?.bsSingingTime;
|
|
180
|
+
// break;
|
|
181
|
+
// case "BS_SEND_TIME":
|
|
182
|
+
// prv[uniqueKey] = detail?.bsSendTime;
|
|
183
|
+
// break;
|
|
184
|
+
// case "BS_TRADE_PAYMENT_TIME":
|
|
185
|
+
// prv[uniqueKey] = detail?.bsTradePaymentTime;
|
|
186
|
+
// break;
|
|
187
|
+
// case "BS_DEPOSIT":
|
|
188
|
+
// prv[uniqueKey] = detail?.bsDeposit;
|
|
189
|
+
// break;
|
|
190
|
+
// case "BS_NET_RECEIPTS":
|
|
191
|
+
// prv[uniqueKey] = detail?.bsNetReceipts;
|
|
192
|
+
// break;
|
|
193
|
+
// case "BS_PACKAGE_WEIGHT":
|
|
194
|
+
// prv[uniqueKey] = detail?.bsPackageWeight;
|
|
195
|
+
// break;
|
|
196
|
+
case "BS_E3_GOODS":
|
|
197
|
+
prv[uniqueKey] = detail === null || detail === void 0 ? void 0 : detail.bsE3Goods;
|
|
198
|
+
break;
|
|
199
|
+
// case "BS_EXCHANGE_GOODS":
|
|
200
|
+
// prv[uniqueKey] = detail?.bsExchangeGoods;
|
|
201
|
+
// break;
|
|
202
|
+
case "BS_E3_REISSUE_GOODS":
|
|
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
|
+
};
|
|
208
|
+
break;
|
|
209
|
+
// case "BS_RETURN_GOODS":
|
|
210
|
+
// prv[uniqueKey] = detail?.bsReturnGoods;
|
|
211
|
+
// 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;
|
|
218
|
+
// case "BS_DELIVERY_NO":
|
|
219
|
+
// prv[uniqueKey] = detail?.bsDeliveryNo;
|
|
220
|
+
// break;
|
|
221
|
+
// case "BS_POSTING":
|
|
222
|
+
// prv[uniqueKey] = detail?.bsPosting;
|
|
223
|
+
// break;
|
|
224
|
+
// case "LOGISTICS_TRAJECTORY_MORE":
|
|
225
|
+
// if (config.isOpen) {
|
|
226
|
+
// if (config.logisticsMapping.companyType === "BS_LOGISTICS") {
|
|
227
|
+
// prv[uniqueKey] = detail?.bsLogistics.reduce((p: any, n: any) => {
|
|
228
|
+
// p.push({
|
|
229
|
+
// trajectoryCompany: n.logisticsCompany,
|
|
230
|
+
// trajectoryCode: n.logisticsCode,
|
|
231
|
+
// trajectoryPhone: "",
|
|
232
|
+
// trajectorySnapshot: "",
|
|
233
|
+
// });
|
|
234
|
+
// return p;
|
|
235
|
+
// }, []);
|
|
236
|
+
// }
|
|
237
|
+
// }
|
|
238
|
+
// break;
|
|
239
|
+
// case "LOGISTICS_INTERCEPTION_MORE":
|
|
240
|
+
// if (config.isOpen) {
|
|
241
|
+
// if (config.logisticsMapping.companyType === "BS_LOGISTICS") {
|
|
242
|
+
// prv[uniqueKey] = detail?.bsLogistics.reduce((p: any, n: any) => {
|
|
243
|
+
// const expressInterceptData: any =
|
|
244
|
+
// ExpressInterceptData.getInstance().getExpressData();
|
|
245
|
+
// const interceptCompany = expressInterceptData.find((t: any) => {
|
|
246
|
+
// return t.value === n.logisticsCompany;
|
|
247
|
+
// });
|
|
248
|
+
// const returnValue = (
|
|
249
|
+
// interceptCompany?.interceptionTypeList || []
|
|
250
|
+
// ).find((item: { config?: any }) => {
|
|
251
|
+
// return item?.config?.isDefault;
|
|
252
|
+
// });
|
|
253
|
+
// p.push({
|
|
254
|
+
// interceptCompany: n.logisticsCompany,
|
|
255
|
+
// interceptCode: n.logisticsCode,
|
|
256
|
+
// interceptType: returnValue?.value,
|
|
257
|
+
// interceptSenderMobile: undefined,
|
|
258
|
+
// interceptAddress: [],
|
|
259
|
+
// interceptDetail: undefined,
|
|
260
|
+
// interceptReceiverName: undefined,
|
|
261
|
+
// interceptReceiverMobile: undefined,
|
|
262
|
+
// interceptStatus: undefined,
|
|
263
|
+
// interceptOther: undefined,
|
|
264
|
+
// interceptLogisticsSnapshot: undefined,
|
|
265
|
+
// });
|
|
266
|
+
// return p;
|
|
267
|
+
// }, []);
|
|
268
|
+
// }
|
|
269
|
+
// }
|
|
270
|
+
// break;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
return prv;
|
|
274
|
+
}, {});
|
|
275
|
+
};
|
|
276
|
+
//bsE3订单信息转换
|
|
277
|
+
export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
|
|
278
|
+
var _form$getFieldValue, _newOrderList$, _orderList$find, _orderList$find$call;
|
|
279
|
+
var orderNo = detail.orderNo,
|
|
280
|
+
_detail$orderList = detail.orderList,
|
|
281
|
+
orderList = _detail$orderList === void 0 ? [] : _detail$orderList,
|
|
282
|
+
componentList = detail.componentList;
|
|
283
|
+
var bsE3GoodsCom = (componentList || []).find(function (com) {
|
|
284
|
+
return com.workOrderComponentType === "BS_E3_GOODS";
|
|
285
|
+
});
|
|
286
|
+
var isStrict = bsE3GoodsCom ? (_form$getFieldValue = form.getFieldValue(bsE3GoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
|
|
287
|
+
var newOrderList = orderList === null || orderList === void 0 ? void 0 : orderList.map(function (item) {
|
|
288
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
289
|
+
billNo: item.orderSn
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
return {
|
|
293
|
+
bsE3SystemOrder: {
|
|
294
|
+
orderNo: orderNo,
|
|
295
|
+
orders: newOrderList,
|
|
296
|
+
selectIds: (newOrderList === null || newOrderList === void 0 ? void 0 : newOrderList.length) === 1 ? orderList.map(function (item) {
|
|
297
|
+
return item.orderSn;
|
|
298
|
+
}) : [],
|
|
299
|
+
showOrderInfo: newOrderList
|
|
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,
|
|
303
|
+
bsE3Goods: {
|
|
304
|
+
// 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
|
|
305
|
+
orders: orderList || [],
|
|
306
|
+
orderNo: orderNo,
|
|
307
|
+
shopCode: (orderList === null || orderList === void 0 ? void 0 : (_orderList$find = orderList.find) === null || _orderList$find === void 0 ? void 0 : (_orderList$find$call = _orderList$find.call(orderList, function (item) {
|
|
308
|
+
return item.sdCode;
|
|
309
|
+
})) === null || _orderList$find$call === void 0 ? void 0 : _orderList$find$call.sdCode) || null,
|
|
310
|
+
bsE3Goods: updateBsE3GoodsHandle(orderList).filter(function (good) {
|
|
311
|
+
return !isStrict || !orderNo || good.originalDealCode === orderNo;
|
|
312
|
+
})
|
|
313
|
+
},
|
|
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)
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
// WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
|
|
319
|
+
export var filterBsE3Orders = function filterBsE3Orders(detail, order_no) {
|
|
320
|
+
var currentTrades = ((detail === null || detail === void 0 ? void 0 : detail.orderList) || []).filter(function (item) {
|
|
321
|
+
return (item === null || item === void 0 ? void 0 : item.dealCode) === order_no;
|
|
322
|
+
});
|
|
323
|
+
if (currentTrades.length) {
|
|
324
|
+
return currentTrades;
|
|
325
|
+
}
|
|
326
|
+
return [];
|
|
327
|
+
};
|
|
@@ -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,11 +7,13 @@ 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, } from './bsE3OrderBackFormValues';
|
|
10
11
|
export { wlnOrderBackFormValues, wlnOrderTransform, } from "./wlnOrderBackFormValues";
|
|
11
|
-
export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders } from "./wdtOrderBackFormValues";
|
|
12
|
+
export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle, } from "./wdtOrderBackFormValues";
|
|
12
13
|
export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
|
|
13
14
|
export { default as uuid } from "./getUUid";
|
|
14
15
|
export * as filterFn from "./filterFn";
|
|
15
16
|
export * as templateFn from "./template";
|
|
16
17
|
export * as tree from "./multidimensionalFindChild";
|
|
17
18
|
export { default as unTransField } from "./unTransField";
|
|
19
|
+
export { fetchAll } from "./FetchAll";
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -7,8 +7,9 @@ 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 } from "./bsE3OrderBackFormValues";
|
|
10
11
|
export { wlnOrderBackFormValues, wlnOrderTransform } from "./wlnOrderBackFormValues";
|
|
11
|
-
export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders } from "./wdtOrderBackFormValues";
|
|
12
|
+
export { wdtOrderBackFormValues, wdtOrderTransform, WDT_ORDER_TYPE_MAP, filterWdtOrders, updateWdtGoodsHandle } from "./wdtOrderBackFormValues";
|
|
12
13
|
export { default as jstOrderBackFormValues } from "./jstOrderBackFormValues";
|
|
13
14
|
export { default as uuid } from "./getUUid";
|
|
14
15
|
import * as _filterFn from "./filterFn";
|
|
@@ -17,4 +18,5 @@ import * as _templateFn from "./template";
|
|
|
17
18
|
export { _templateFn as templateFn };
|
|
18
19
|
import * as _tree from "./multidimensionalFindChild";
|
|
19
20
|
export { _tree as tree };
|
|
20
|
-
export { default as unTransField } from "./unTransField";
|
|
21
|
+
export { default as unTransField } from "./unTransField";
|
|
22
|
+
export { fetchAll } from "./FetchAll";
|
|
@@ -13,6 +13,7 @@ import { bsOrderBackFormValues } from "./bsOrderBackFormValues";
|
|
|
13
13
|
import { wlnOrderBackFormValues } from "./wlnOrderBackFormValues";
|
|
14
14
|
import jstOrderBackFormValues from "./jstOrderBackFormValues";
|
|
15
15
|
import { wdtOrderBackFormValues } from "./wdtOrderBackFormValues";
|
|
16
|
+
import { bsE3OrderBackFormValues } from "./bsE3OrderBackFormValues";
|
|
16
17
|
|
|
17
18
|
// 淘宝商品组件信息处理
|
|
18
19
|
|
|
@@ -117,6 +118,9 @@ export default (function (_ref) {
|
|
|
117
118
|
case "ACTUAL_PAYMENT":
|
|
118
119
|
prv[uniqueKey] = detail["actualPayment"];
|
|
119
120
|
break;
|
|
121
|
+
case "ACTUAL_RECEIPT_PAYMENT":
|
|
122
|
+
prv[uniqueKey] = detail["actualReceiptPayment"];
|
|
123
|
+
break;
|
|
120
124
|
case "EXPRESS_LOGISTICS_SELECT":
|
|
121
125
|
prv[uniqueKey] = {
|
|
122
126
|
company: config.isSingle && config.showField === "EXPRESS_COMPANY" || !config.isSingle ? ExpressData.getInstance().getExpressCodeByName(detail["expressLogisticsCompany"]) : "",
|
|
@@ -222,5 +226,7 @@ export default (function (_ref) {
|
|
|
222
226
|
var bsValues = bsOrderBackFormValues(detail["bsOrder"], templateDetail);
|
|
223
227
|
var wlnValues = wlnOrderBackFormValues(detail["wlnOrder"], templateDetail);
|
|
224
228
|
var wdtValues = wdtOrderBackFormValues(detail["wdtOrder"], templateDetail);
|
|
225
|
-
|
|
229
|
+
var bsE3Values = bsE3OrderBackFormValues(detail["bsE3Order"], templateDetail);
|
|
230
|
+
console.log('bsE3Values', bsE3Values);
|
|
231
|
+
return _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, orderValues), jstValues), bsValues), wlnValues), wdtValues), bsE3Values);
|
|
226
232
|
});
|
|
@@ -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
|
|
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
|
-
|
|
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", "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
|
});
|
|
@@ -16,16 +16,19 @@ export declare const WDT_ORDER_TYPE_MAP: {
|
|
|
16
16
|
107: string;
|
|
17
17
|
108: string;
|
|
18
18
|
};
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const updateWdtGoodsHandle: (orders?: any[]) => any;
|
|
20
|
+
export declare const filterWdtOrders: (detail: any, order_no: string) => any;
|
|
20
21
|
export declare const wdtOrderBackFormValues: (detail?: any, templateDetail?: any) => any;
|
|
21
|
-
export declare const wdtOrderTransform: (detail: any, form: any
|
|
22
|
+
export declare const wdtOrderTransform: (detail: any, form: any) => {
|
|
22
23
|
wdtSystemOrder: {
|
|
23
|
-
orderNo:
|
|
24
|
+
orderNo: any;
|
|
24
25
|
orders: any;
|
|
25
26
|
selectIds: any;
|
|
26
27
|
showOrderInfo: any;
|
|
27
28
|
};
|
|
28
29
|
wdtGoods: {
|
|
30
|
+
orders: any;
|
|
31
|
+
orderNo: any;
|
|
29
32
|
shopCode: any;
|
|
30
33
|
wdtGoods: any;
|
|
31
34
|
};
|
|
@@ -29,7 +29,7 @@ export var WDT_ORDER_TYPE_MAP = {
|
|
|
29
29
|
107: '自定义属性7',
|
|
30
30
|
108: '自定义属性8'
|
|
31
31
|
};
|
|
32
|
-
var updateWdtGoodsHandle = function updateWdtGoodsHandle() {
|
|
32
|
+
export var updateWdtGoodsHandle = function updateWdtGoodsHandle() {
|
|
33
33
|
var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
34
34
|
return orders === null || orders === void 0 ? void 0 : orders.reduce(function (acc, cur) {
|
|
35
35
|
if (Array.isArray(cur.goodDetails)) {
|
|
@@ -155,15 +155,14 @@ var updateWdtItemListByConfigHandle = function updateWdtItemListByConfigHandle(l
|
|
|
155
155
|
// WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
|
|
156
156
|
export var filterWdtOrders = function filterWdtOrders(detail, order_no) {
|
|
157
157
|
var currentTrades = ((detail === null || detail === void 0 ? void 0 : detail.trades) || []).filter(function (item) {
|
|
158
|
-
return (item.srcTid ||
|
|
159
|
-
}).map(function (item) {
|
|
160
|
-
if (Array.isArray(item.goodDetails)) {
|
|
161
|
-
item.goodDetails = item.goodDetails.filter(function (good) {
|
|
162
|
-
return good.srcTid === order_no;
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
return item;
|
|
158
|
+
return (item.srcTid || "").split(",").includes(order_no);
|
|
166
159
|
});
|
|
160
|
+
// .map((item: Record<string, any>) => {
|
|
161
|
+
// if (Array.isArray(item.goodDetails)) {
|
|
162
|
+
// item.goodDetails = item.goodDetails.filter((good: Record<string, any>) => good.srcTid === order_no);
|
|
163
|
+
// }
|
|
164
|
+
// return item;
|
|
165
|
+
// });
|
|
167
166
|
if (currentTrades.length) {
|
|
168
167
|
return currentTrades;
|
|
169
168
|
}
|
|
@@ -185,7 +184,8 @@ export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
|
|
|
185
184
|
case "WDT_REISSUE_GOODS":
|
|
186
185
|
prv[uniqueKey] = {
|
|
187
186
|
wdtSystemOrder: detail === null || detail === void 0 ? void 0 : detail.wdtSystemOrder,
|
|
188
|
-
wdtReissueGoods: detail === null || detail === void 0 ? void 0 : detail.wdtReissueGoods
|
|
187
|
+
wdtReissueGoods: detail === null || detail === void 0 ? void 0 : detail.wdtReissueGoods,
|
|
188
|
+
wdtSystemOrderNo: null
|
|
189
189
|
};
|
|
190
190
|
break;
|
|
191
191
|
case "WDT_LOGISTICS":
|
|
@@ -230,12 +230,19 @@ export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
|
|
|
230
230
|
}, {});
|
|
231
231
|
};
|
|
232
232
|
//wdt订单信息转换
|
|
233
|
-
export var wdtOrderTransform = function wdtOrderTransform(detail, form
|
|
234
|
-
var _detail$
|
|
235
|
-
var
|
|
233
|
+
export var wdtOrderTransform = function wdtOrderTransform(detail, form) {
|
|
234
|
+
var _form$getFieldValue, _detail$trades2, _currentTrades$find, _currentTrades$find$c;
|
|
235
|
+
var orderNo = detail.orderNo,
|
|
236
|
+
_detail$trades = detail.trades,
|
|
237
|
+
currentTrades = _detail$trades === void 0 ? [] : _detail$trades,
|
|
238
|
+
componentList = detail.componentList;
|
|
239
|
+
var wdtGoodsCom = (componentList || []).find(function (com) {
|
|
240
|
+
return com.workOrderComponentType === 'WDT_GOODS';
|
|
241
|
+
});
|
|
242
|
+
var isStrict = wdtGoodsCom ? (_form$getFieldValue = form.getFieldValue(wdtGoodsCom.uniqueKey)) === null || _form$getFieldValue === void 0 ? void 0 : _form$getFieldValue.isStrict : false;
|
|
236
243
|
return {
|
|
237
244
|
wdtSystemOrder: {
|
|
238
|
-
orderNo:
|
|
245
|
+
orderNo: orderNo,
|
|
239
246
|
orders: currentTrades.map(function (item) {
|
|
240
247
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
241
248
|
billNo: item.tradeNo,
|
|
@@ -243,7 +250,7 @@ export var wdtOrderTransform = function wdtOrderTransform(detail, form, order_no
|
|
|
243
250
|
billTag: item.tagName
|
|
244
251
|
});
|
|
245
252
|
}),
|
|
246
|
-
selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$
|
|
253
|
+
selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$trades2 = detail.trades) === null || _detail$trades2 === void 0 ? void 0 : _detail$trades2.length) === 1 ? currentTrades.map(function (item) {
|
|
247
254
|
return item.tradeNo;
|
|
248
255
|
}) : [],
|
|
249
256
|
showOrderInfo: currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.map(function (item) {
|
|
@@ -255,10 +262,15 @@ export var wdtOrderTransform = function wdtOrderTransform(detail, form, order_no
|
|
|
255
262
|
})
|
|
256
263
|
},
|
|
257
264
|
wdtGoods: {
|
|
265
|
+
// 订单反填,要清空orders,存的是当前系统订单号勾选上的 订单
|
|
266
|
+
orders: currentTrades,
|
|
267
|
+
orderNo: orderNo,
|
|
258
268
|
shopCode: (currentTrades === null || currentTrades === void 0 ? void 0 : (_currentTrades$find = currentTrades.find) === null || _currentTrades$find === void 0 ? void 0 : (_currentTrades$find$c = _currentTrades$find.call(currentTrades, function (item) {
|
|
259
269
|
return item.shopNo;
|
|
260
270
|
})) === null || _currentTrades$find$c === void 0 ? void 0 : _currentTrades$find$c.shopNo) || null,
|
|
261
|
-
wdtGoods: updateWdtGoodsHandle(currentTrades)
|
|
271
|
+
wdtGoods: updateWdtGoodsHandle(currentTrades).filter(function (good) {
|
|
272
|
+
return !isStrict || !orderNo || good.srcTid === orderNo;
|
|
273
|
+
})
|
|
262
274
|
},
|
|
263
275
|
wdtLogistics: updateWdtItemListHandle(currentTrades, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
|
|
264
276
|
wdtSendGood: updateWdtItemListHandle(currentTrades, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
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": "
|
|
44
|
+
"gitHead": "368b8207c54e58488484df65546139325df9df68",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|
package/dist/esm/wdt/index.d.ts
DELETED
package/dist/esm/wdt/index.js
DELETED
|
@@ -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 };
|