@kmkf-fe-packages/kmkf-utils 2.0.2 → 2.0.4
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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
111226333
|
|
1
|
+
111226333
|
|
@@ -20,7 +20,7 @@ export declare const BS_E3_SYSTEM_ORDER_CONFIG: {
|
|
|
20
20
|
};
|
|
21
21
|
export declare const BS_E3_BOOLEAN_STATUS_MAP: Record<number, string>;
|
|
22
22
|
export declare const BS_E3_ORDER_STATUS_MAP: Record<number, string>;
|
|
23
|
-
export declare const updateBsE3GoodsHandle: (orders?: any[]) => any;
|
|
23
|
+
export declare const updateBsE3GoodsHandle: (orders?: any[], goodsPriceKey?: string) => any;
|
|
24
24
|
export declare const bsE3OrderBackFormValues: (detail?: any, templateDetail?: any) => any;
|
|
25
25
|
export declare const bsE3OrderTransform: (detail: any, form: any) => {
|
|
26
26
|
bsE3SystemOrder: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
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 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; }
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
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); }
|
|
7
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
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."); }
|
|
9
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); }
|
|
10
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
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
13
|
import uuid from "./getUUid";
|
|
14
14
|
export var BS_E3_SYSTEM_ORDER_CONFIG = {
|
|
15
15
|
key: "bsE3SystemShowOrder",
|
|
@@ -116,6 +116,7 @@ export var BS_E3_ORDER_STATUS_MAP = {
|
|
|
116
116
|
};
|
|
117
117
|
export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
|
|
118
118
|
var orders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
119
|
+
var goodsPriceKey = arguments.length > 1 ? arguments[1] : undefined;
|
|
119
120
|
var list = orders.reduce(function (prv, next) {
|
|
120
121
|
var _next$orderDetailGets;
|
|
121
122
|
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) {
|
|
@@ -123,7 +124,9 @@ export var updateBsE3GoodsHandle = function updateBsE3GoodsHandle() {
|
|
|
123
124
|
item.mark = "是";
|
|
124
125
|
item.canDelete = true;
|
|
125
126
|
item.uuid = (_item$uuid = item.uuid) !== null && _item$uuid !== void 0 ? _item$uuid : uuid();
|
|
126
|
-
return item
|
|
127
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
128
|
+
goodsPrice: goodsPriceKey ? item[goodsPriceKey] : item.goodsPrice
|
|
129
|
+
});
|
|
127
130
|
});
|
|
128
131
|
prv.push.apply(prv, _toConsumableArray(goods));
|
|
129
132
|
return prv;
|
|
@@ -395,7 +398,7 @@ export var bsE3OrderTransform = function bsE3OrderTransform(detail, form) {
|
|
|
395
398
|
},
|
|
396
399
|
// TODO: 当只有一条系统单时默认选中该系统单
|
|
397
400
|
bsE3SystemOrderNo: onlyOneSystemOrder ? (_newOrderList$ = newOrderList[0]) === null || _newOrderList$ === void 0 ? void 0 : _newOrderList$.billNo : undefined,
|
|
398
|
-
bsE3ReissueGoods: onlyOneSystemOrder ? updateBsE3GoodsHandle([newOrderList[0]]).filter(function (good) {
|
|
401
|
+
bsE3ReissueGoods: onlyOneSystemOrder ? updateBsE3GoodsHandle([newOrderList[0]], 'sharePrice').filter(function (good) {
|
|
399
402
|
return !isStrict || !orderNo || good.originalDealCode === orderNo;
|
|
400
403
|
}) : [],
|
|
401
404
|
bsE3Goods: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
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": "aadc3f4d645351ebbe34f1b6275cad7d7e5129e3",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|