@kmkf-fe-packages/kmkf-utils 2.2.10 → 2.2.13-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/esm/constants/constant.d.ts +143 -0
- package/dist/esm/constants/constant.js +215 -0
- package/dist/esm/constants/index.d.ts +2 -1
- package/dist/esm/constants/index.js +3 -2
- package/dist/esm/hooks/index.d.ts +1 -0
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/useStatus.d.ts +1 -0
- package/dist/esm/hooks/useStatus.js +32 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/request/index.js +1 -1
- package/dist/esm/servers/JY/index.d.ts +2 -0
- package/dist/esm/servers/JY/index.js +2 -0
- package/dist/esm/servers/JY/logisticsData.d.ts +6 -0
- package/dist/esm/servers/JY/logisticsData.js +42 -0
- package/dist/esm/servers/JY/warehouseData.d.ts +7 -0
- package/dist/esm/servers/JY/warehouseData.js +38 -0
- package/dist/esm/servers/index.d.ts +8 -0
- package/dist/esm/servers/index.js +35 -0
- package/dist/esm/servers/workOrder/index.d.ts +58 -0
- package/dist/esm/servers/workOrder/index.js +106 -0
- package/dist/esm/utils/SendData.js +4 -2
- package/dist/esm/utils/finalFormData.d.ts +8 -0
- package/dist/esm/utils/finalFormData.js +164 -0
- package/dist/esm/utils/getExpression.js +6 -6
- package/dist/esm/utils/index.d.ts +4 -1
- package/dist/esm/utils/index.js +4 -1
- package/dist/esm/utils/jyOrderBackFormValues.d.ts +36 -0
- package/dist/esm/utils/jyOrderBackFormValues.js +307 -0
- package/dist/esm/utils/kmOrderBackFormValues.js +6 -9
- package/dist/esm/utils/orderBackFormValues.js +3 -1
- package/dist/esm/utils/transformList.d.ts +3 -0
- package/dist/esm/utils/transformList.js +347 -0
- package/dist/esm/utils/unTransField.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,347 @@
|
|
|
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 _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 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; }
|
|
7
|
+
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; }
|
|
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
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
import { cloneDeep } from 'lodash';
|
|
18
|
+
import { WORK_ORDER_STATUS } from "../constants/constant";
|
|
19
|
+
import get from 'lodash/get';
|
|
20
|
+
import { BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP } from '@kmkf-fe-packages/kmkf-utils';
|
|
21
|
+
import ExpressInterceptData from "../expressInterceptData";
|
|
22
|
+
var interceptExpress = ExpressInterceptData.getInstance();
|
|
23
|
+
export var unTransField = function unTransField(key) {
|
|
24
|
+
return ['itemList', 'jstItemList', 'dateTime', 'basicMultSelect', 'memberLevel', 'erpOrderType', 'orderRefundType', 'checkbox', 'multSelect', 'rate', 'picture', 'file', 'bsSendGood', 'bsGoods', 'bsExchangeType', 'bsExchangeReturnGoods', 'bsExchangeSwapOutGoods', 'bsExchangeGiftGoods', 'bsReissueType', 'bsReissueGoods', 'bsReturnGoods', 'bsReturnType', 'bsLogisticsList', 'bsSystemShowOrder', 'bsSystemSelectIds', 'reissueLogisticsList', 'deliveryNoList', 'returnGoodsStatusList', 'returnGoodsTradeIdList', 'returnGoodsTradeItemList', 'tradeIdList', 'tradeItemList', 'erpAfterSaleTradeItemList', 'erpAfterSaleTradeIdList', 'wlnLogisticsList', 'wlnSystemShowOrder', 'wlnSystemSelectIds', 'wlnGoods', 'wlnSendGood', 'flowTags', 'exchangeReason', 'exchangeStatusValue', 'inStockStatusItemList', 'inStockStatusList', 'bsE3InStockStatusItemList', 'bsE3InStockStatusList', 'msgStatusValues', 'msgStatus4Search', 'trajectoryList', 'trajectoryMoreCompany', 'trajectoryMoreCode', 'trajectoryMoreSnapshot', 'trajectoryMoreStatus', 'trajectoryMoreLastLogisticsInfo', 'trajectoryMoreLastUpdateTime', 'trajectoryApiStatus', 'wdtGoods', 'wdtSendGood', 'wdtReissueType', 'wdtReissueGoods', 'wdtSystemOrderNo', 'wdtLogisticsList', 'wdtSystemShowOrder', 'kmSystemShowOrder', 'wdtSystemSelectIds', 'wdtReturnGoods', 'wdtReturnType', 'wdtExchangeGoods', 'bsE3Goods', 'bsE3SystemShowOrder', 'bsE3SystemSelectIds', 'logisticsInterceptList', 'logisticsInterceptCompanyList', 'logisticsInterceptCodeList', 'logisticsInterceptApiStatusList', 'logisticsInterceptTypeList', 'logisticsInterceptStatusList', 'logisticsInterceptSnapshotList', 'interceptLogisticsApiStatus', 'productList', 'label', 'kmSendGood', 'kmGoods', 'bsE3ReissueType', 'bsE3ReissueGoods', 'gyGoods', 'gySendGood', 'gyReissueType', 'gyReissueGoods', 'gySystemOrderNo', 'gyLogisticsList', 'gySystemShowOrder', 'gySystemSelectIds', 'gyReturnGoods', 'gyReturnType', 'gyExchangeGoods', 'kmLogisticsList', 'jstGoods', 'jstSendGood', 'jstReissueType', 'jstReissueGoods', 'jstSystemOrderNo', 'jstLogisticsList', 'jstSystemShowOrder', 'jstSystemSelectIds', 'jstReturnGoods', 'jstReturnType', 'jstExchangeGoods', 'kmReissueGoods', 'kmReissueType', 'kmReturnGoods', 'kmReturnType', 'wdtTags', 'kmVideo'].reduce(function (cur, nxt) {
|
|
25
|
+
return cur || (key === null || key === void 0 ? void 0 : key.includes(nxt));
|
|
26
|
+
}, false);
|
|
27
|
+
};
|
|
28
|
+
export var transformList = function transformList(fields, uniqueKeys) {
|
|
29
|
+
return function () {
|
|
30
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
31
|
+
var rowIndex = 0;
|
|
32
|
+
var newList = cloneDeep(list);
|
|
33
|
+
return newList.reduce(function (prv, next, i) {
|
|
34
|
+
delete next.startIndex;
|
|
35
|
+
delete next.rowSpan;
|
|
36
|
+
var goodsParams = [];
|
|
37
|
+
var maxLength = Object.keys(next).reduce(function (p, k) {
|
|
38
|
+
var _k$split = k.split('_'),
|
|
39
|
+
_k$split2 = _slicedToArray(_k$split, 3),
|
|
40
|
+
key = _k$split2[0],
|
|
41
|
+
field = _k$split2[1],
|
|
42
|
+
child = _k$split2[2];
|
|
43
|
+
if (!child && fields.includes(field) && uniqueKeys.includes(key)) {
|
|
44
|
+
var _next$k, _next$k2;
|
|
45
|
+
//如果是bs商品数据 要特殊处理 合并一些固定商品数量信息
|
|
46
|
+
if (['bsGoods', 'bsExchangeGiftGoods', 'bsExchangeReturnGoods', 'bsExchangeSwapOutGoods', 'bsReissueGoods', 'bsReturnGoods'].includes(field)) {
|
|
47
|
+
next[k] = mergeFixedGoods(next[k]);
|
|
48
|
+
}
|
|
49
|
+
//系统订单号只展示选中的
|
|
50
|
+
if (field === 'bsSystemShowOrder') {
|
|
51
|
+
var selectIds = next["".concat(key, "_bsSystemSelectIds")] || [];
|
|
52
|
+
next[k] = next[k].filter(function (item) {
|
|
53
|
+
return selectIds.includes(item === null || item === void 0 ? void 0 : item.billNo);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (field === 'wlnSystemShowOrder') {
|
|
57
|
+
var _selectIds = next["".concat(key, "_wlnSystemSelectIds")] || [];
|
|
58
|
+
next[k] = next[k].filter(function (item) {
|
|
59
|
+
return _selectIds.includes(item === null || item === void 0 ? void 0 : item.billNo);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (field === 'wdtSystemShowOrder') {
|
|
63
|
+
var _selectIds2 = next["".concat(key, "_wdtSystemSelectIds")] || [];
|
|
64
|
+
next[k] = next[k].filter(function (item) {
|
|
65
|
+
return _selectIds2.includes(item === null || item === void 0 ? void 0 : item.billNo);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (field === 'kmSystemShowOrder') {
|
|
69
|
+
var _selectIds3 = next["".concat(key, "_kmSystemSelectIds")] || [];
|
|
70
|
+
next[k] = next[k].filter(function (item) {
|
|
71
|
+
return _selectIds3.includes(item === null || item === void 0 ? void 0 : item.billNo);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (field === 'bsE3SystemShowOrder') {
|
|
75
|
+
var _next$k$filter;
|
|
76
|
+
var _selectIds4 = next["".concat(key, "_bsE3SystemSelectIds")] || [];
|
|
77
|
+
next[k] = (_next$k$filter = next[k].filter(function (item) {
|
|
78
|
+
return _selectIds4.includes(item === null || item === void 0 ? void 0 : item.orderSn);
|
|
79
|
+
})) === null || _next$k$filter === void 0 ? void 0 : _next$k$filter.map(function (item) {
|
|
80
|
+
var isSplit = item.isSplit,
|
|
81
|
+
isSplitNew = item.isSplitNew,
|
|
82
|
+
isCopy = item.isCopy,
|
|
83
|
+
isExchangeOrder = item.isExchangeOrder,
|
|
84
|
+
isCombineNew = item.isCombineNew,
|
|
85
|
+
isCombine = item.isCombine,
|
|
86
|
+
orderStatus = item.orderStatus;
|
|
87
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
88
|
+
orderStatus: BS_E3_ORDER_STATUS_MAP[orderStatus] || orderStatus,
|
|
89
|
+
isSplit: BS_E3_BOOLEAN_STATUS_MAP[isSplit] || isSplit,
|
|
90
|
+
isSplitNew: BS_E3_BOOLEAN_STATUS_MAP[isSplitNew] || isSplitNew,
|
|
91
|
+
isExchangeOrder: BS_E3_BOOLEAN_STATUS_MAP[isExchangeOrder] || isExchangeOrder,
|
|
92
|
+
isCopy: BS_E3_BOOLEAN_STATUS_MAP[isCopy] || isCopy,
|
|
93
|
+
isCombineNew: BS_E3_BOOLEAN_STATUS_MAP[isCombineNew] || isCombineNew,
|
|
94
|
+
isCombine: BS_E3_BOOLEAN_STATUS_MAP[isCombine] || isCombine
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (field === 'gySystemShowOrder') {
|
|
99
|
+
var _selectIds5 = next["".concat(key, "_gySystemSelectIds")] || [];
|
|
100
|
+
next[k] = next[k].filter(function (item) {
|
|
101
|
+
return _selectIds5.includes(item === null || item === void 0 ? void 0 : item.billNo);
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
(_next$k = next[k]) === null || _next$k === void 0 ? void 0 : _next$k.forEach(function (item, index) {
|
|
105
|
+
if (['wdtGoods', 'wdtReissueGoods', 'wdtExchangeGoods', 'wdtReturnGoods'].includes(field)) {
|
|
106
|
+
var giftTypeMap = {
|
|
107
|
+
0: '非赠品',
|
|
108
|
+
1: '自动赠送',
|
|
109
|
+
2: '手工赠送',
|
|
110
|
+
3: '回购自动送赠品',
|
|
111
|
+
4: '前N有礼送赠品',
|
|
112
|
+
6: '天猫优仓赠品',
|
|
113
|
+
7: '淘宝CRM会员送赠'
|
|
114
|
+
};
|
|
115
|
+
if (goodsParams[index]) {
|
|
116
|
+
goodsParams[index] = Object.entries(item).reduce(function (acc, cur) {
|
|
117
|
+
var _cur = _slicedToArray(cur, 2),
|
|
118
|
+
key = _cur[0],
|
|
119
|
+
value = _cur[1];
|
|
120
|
+
if (key === 'giftType') {
|
|
121
|
+
acc["".concat(k, "_").concat(key)] = (giftTypeMap === null || giftTypeMap === void 0 ? void 0 : giftTypeMap[value]) || '';
|
|
122
|
+
} else {
|
|
123
|
+
acc["".concat(k, "_").concat(key)] = value;
|
|
124
|
+
}
|
|
125
|
+
return acc;
|
|
126
|
+
}, goodsParams[index]);
|
|
127
|
+
} else {
|
|
128
|
+
goodsParams[index] = Object.entries(item).reduce(function (acc, cur) {
|
|
129
|
+
var _cur2 = _slicedToArray(cur, 2),
|
|
130
|
+
key = _cur2[0],
|
|
131
|
+
value = _cur2[1];
|
|
132
|
+
if (key === 'giftType') {
|
|
133
|
+
acc["".concat(k, "_").concat(key)] = (giftTypeMap === null || giftTypeMap === void 0 ? void 0 : giftTypeMap[value]) || '';
|
|
134
|
+
} else {
|
|
135
|
+
acc["".concat(k, "_").concat(key)] = value;
|
|
136
|
+
}
|
|
137
|
+
return acc;
|
|
138
|
+
}, {});
|
|
139
|
+
}
|
|
140
|
+
} else if (['bsE3Goods'].includes(field)) {
|
|
141
|
+
if (goodsParams[index]) {
|
|
142
|
+
goodsParams[index] = Object.entries(item).reduce(function (acc, cur) {
|
|
143
|
+
var _cur3 = _slicedToArray(cur, 2),
|
|
144
|
+
key = _cur3[0],
|
|
145
|
+
value = _cur3[1];
|
|
146
|
+
if (key === 'isGift') {
|
|
147
|
+
acc["".concat(k, "_").concat(key)] = BS_E3_BOOLEAN_STATUS_MAP[value] || value;
|
|
148
|
+
} else {
|
|
149
|
+
acc["".concat(k, "_").concat(key)] = value;
|
|
150
|
+
}
|
|
151
|
+
return acc;
|
|
152
|
+
}, goodsParams[index]);
|
|
153
|
+
} else {
|
|
154
|
+
goodsParams[index] = Object.entries(item).reduce(function (acc, cur) {
|
|
155
|
+
var _cur4 = _slicedToArray(cur, 2),
|
|
156
|
+
key = _cur4[0],
|
|
157
|
+
value = _cur4[1];
|
|
158
|
+
if (key === 'isGift') {
|
|
159
|
+
acc["".concat(k, "_").concat(key)] = BS_E3_BOOLEAN_STATUS_MAP[value] || value;
|
|
160
|
+
} else {
|
|
161
|
+
acc["".concat(k, "_").concat(key)] = value;
|
|
162
|
+
}
|
|
163
|
+
return acc;
|
|
164
|
+
}, {});
|
|
165
|
+
}
|
|
166
|
+
} else if (['bsLogisticsList', 'wlnLogisticsList', 'wdtLogisticsList', 'jstItemList', 'kmLogisticsList', 'gyLogisticsList'].includes(field)) {
|
|
167
|
+
var logisticsMap = {
|
|
168
|
+
bsLogisticsList: {
|
|
169
|
+
company: 'bsLogisticsCompany',
|
|
170
|
+
code: 'bsLogisticsCode',
|
|
171
|
+
item: 'bsLogisticsItem'
|
|
172
|
+
},
|
|
173
|
+
wlnLogisticsList: {
|
|
174
|
+
company: 'wlnLogisticsCompany',
|
|
175
|
+
code: 'wlnLogisticsCode',
|
|
176
|
+
item: 'wlnLogisticsItem'
|
|
177
|
+
},
|
|
178
|
+
wdtLogisticsList: {
|
|
179
|
+
company: 'wdtLogisticsCompany',
|
|
180
|
+
code: 'wdtLogisticsCode',
|
|
181
|
+
item: 'wdtLogisticsItem'
|
|
182
|
+
},
|
|
183
|
+
jstItemList: {
|
|
184
|
+
company: 'logisticsCompany',
|
|
185
|
+
code: 'logisticsCode',
|
|
186
|
+
item: 'jstLogisticsItem'
|
|
187
|
+
},
|
|
188
|
+
kmLogisticsList: {
|
|
189
|
+
company: 'kmLogisticsCompany',
|
|
190
|
+
code: 'kmLogisticsCode',
|
|
191
|
+
item: 'kmLogisticsItem'
|
|
192
|
+
},
|
|
193
|
+
gyLogisticsList: {
|
|
194
|
+
company: 'gyLogisticsCompany',
|
|
195
|
+
code: 'gyLogisticsCode',
|
|
196
|
+
item: 'gyLogisticsItem'
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
if (goodsParams[index]) {
|
|
200
|
+
var _objectSpread2;
|
|
201
|
+
goodsParams[index] = _objectSpread(_objectSpread({}, goodsParams[index]), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, "".concat(k, "_").concat(logisticsMap[field].company), item.logisticsCompany), _defineProperty(_objectSpread2, "".concat(k, "_").concat(logisticsMap[field].code), item.logisticsCode), _defineProperty(_objectSpread2, "".concat(k, "_").concat(logisticsMap[field].item), [item]), _objectSpread2));
|
|
202
|
+
} else {
|
|
203
|
+
var _goodsParams$index;
|
|
204
|
+
goodsParams[index] = (_goodsParams$index = {}, _defineProperty(_goodsParams$index, "".concat(k, "_").concat(logisticsMap[field].company), item.logisticsCompany), _defineProperty(_goodsParams$index, "".concat(k, "_").concat(logisticsMap[field].code), item.logisticsCode), _defineProperty(_goodsParams$index, "".concat(k, "_").concat(logisticsMap[field].item), [item]), _goodsParams$index);
|
|
205
|
+
}
|
|
206
|
+
} else {
|
|
207
|
+
goodsParams[index] = Object.entries(item).reduce(function (acc, cur) {
|
|
208
|
+
var _cur5 = _slicedToArray(cur, 2),
|
|
209
|
+
key = _cur5[0],
|
|
210
|
+
value = _cur5[1];
|
|
211
|
+
acc["".concat(k, "_").concat(key)] = value;
|
|
212
|
+
return acc;
|
|
213
|
+
}, goodsParams[index] || {});
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
var len = (_next$k2 = next[k]) === null || _next$k2 === void 0 ? void 0 : _next$k2.length;
|
|
217
|
+
p = p < len ? len : p;
|
|
218
|
+
}
|
|
219
|
+
return p;
|
|
220
|
+
}, 1);
|
|
221
|
+
var arr = Array(maxLength).fill('').map(function (item, index) {
|
|
222
|
+
var params = _objectSpread(_objectSpread(_objectSpread({}, next), goodsParams[index]), {}, {
|
|
223
|
+
exportIndex: i
|
|
224
|
+
});
|
|
225
|
+
if (index === 0) {
|
|
226
|
+
params.startIndex = rowIndex;
|
|
227
|
+
params.rowSpan = maxLength;
|
|
228
|
+
params.rowKey = params.id;
|
|
229
|
+
} else {
|
|
230
|
+
params.rowKey = "".concat(params.id, "-").concat(index);
|
|
231
|
+
}
|
|
232
|
+
return params;
|
|
233
|
+
});
|
|
234
|
+
rowIndex += maxLength;
|
|
235
|
+
prv.push.apply(prv, _toConsumableArray(arr));
|
|
236
|
+
// console.log('prv', prv);
|
|
237
|
+
return prv;
|
|
238
|
+
}, []);
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
//合并固定sku商品数量
|
|
243
|
+
var mergeFixedGoods = function mergeFixedGoods() {
|
|
244
|
+
var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
245
|
+
// Q0000002 积分商品
|
|
246
|
+
// 600123001 1元邮费链接
|
|
247
|
+
// 10103003 1元邮费链接
|
|
248
|
+
// Q0000003 花西子拆单发货专用
|
|
249
|
+
// Q0000004 OGP拆单发货专用
|
|
250
|
+
var FIXED_FIELD = ['Q0000002', '600123001', '10103003', 'Q0000003', 'Q0000004'];
|
|
251
|
+
var numParams = {};
|
|
252
|
+
var newList = cloneDeep(list).reduce(function (prv, next) {
|
|
253
|
+
if (FIXED_FIELD.includes(next.sku)) {
|
|
254
|
+
var hasItem = prv.some(function (item) {
|
|
255
|
+
return item.sku === next.sku;
|
|
256
|
+
});
|
|
257
|
+
numParams[next.sku] = ((numParams === null || numParams === void 0 ? void 0 : numParams[next.sku]) || 0) + next.number;
|
|
258
|
+
if (!hasItem) {
|
|
259
|
+
prv.push(next);
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
prv.push(next);
|
|
263
|
+
}
|
|
264
|
+
return prv;
|
|
265
|
+
}, []);
|
|
266
|
+
return newList.map(function (item) {
|
|
267
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
268
|
+
number: FIXED_FIELD.includes(item.sku) ? numParams[item.sku] : item.number
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
// 数据处理
|
|
274
|
+
export var dataSourceTrans = function dataSourceTrans(list) {
|
|
275
|
+
var newList = list === null || list === void 0 ? void 0 : list.map(function (item) {
|
|
276
|
+
var jsonMap = item.jsonMap;
|
|
277
|
+
var newJsonMap = Object.keys(jsonMap).reduce(function (cur, next) {
|
|
278
|
+
try {
|
|
279
|
+
// 先获取打款状态和打款金额
|
|
280
|
+
if (next !== null && next !== void 0 && next.includes('enterprisePaymentRefundFee')) {
|
|
281
|
+
cur.enterprisePaymentRefundFee = jsonMap[next];
|
|
282
|
+
}
|
|
283
|
+
if (next !== null && next !== void 0 && next.includes('enterprisePaymentStatus')) {
|
|
284
|
+
cur.enterprisePaymentStatus = jsonMap[next];
|
|
285
|
+
}
|
|
286
|
+
if (next !== null && next !== void 0 && next.includes('interceptCompany')) {
|
|
287
|
+
cur.interceptCompany = jsonMap[next];
|
|
288
|
+
}
|
|
289
|
+
if (next !== null && next !== void 0 && next.includes('interceptLogisticsStatus')) {
|
|
290
|
+
cur.interceptLogisticsStatus = jsonMap[next];
|
|
291
|
+
}
|
|
292
|
+
// if (next?.includes('basicMultSelect')) {
|
|
293
|
+
// debugger;
|
|
294
|
+
// }
|
|
295
|
+
if (!unTransField(next)) {
|
|
296
|
+
cur[next] = jsonMap[next];
|
|
297
|
+
} else {
|
|
298
|
+
cur[next] = JSON.parse(jsonMap[next]);
|
|
299
|
+
}
|
|
300
|
+
} catch (e) {
|
|
301
|
+
cur[next] = jsonMap[next];
|
|
302
|
+
}
|
|
303
|
+
return cur;
|
|
304
|
+
}, {});
|
|
305
|
+
// TODO: 未打款并且打款金额非空是显示审核按钮/审核通过展示取消审核按钮
|
|
306
|
+
var showCheckButton = (newJsonMap === null || newJsonMap === void 0 ? void 0 : newJsonMap.enterprisePaymentStatus) === '未打款' && !!newJsonMap.enterprisePaymentRefundFee;
|
|
307
|
+
var showUnCheckButton = (newJsonMap === null || newJsonMap === void 0 ? void 0 : newJsonMap.enterprisePaymentStatus) === '审核通过';
|
|
308
|
+
var isInterfaceCompany = interceptExpress.isInterfaceCompany(newJsonMap === null || newJsonMap === void 0 ? void 0 : newJsonMap.interceptCompany);
|
|
309
|
+
var hasPayWorkOrder = !!newJsonMap.enterprisePaymentRefundFee;
|
|
310
|
+
delete newJsonMap.enterprisePaymentStatus;
|
|
311
|
+
delete newJsonMap.enterprisePaymentRefundFee;
|
|
312
|
+
return _objectSpread(_objectSpread({}, newJsonMap), {}, {
|
|
313
|
+
shopId: item.shopId,
|
|
314
|
+
shopName: item.shopName,
|
|
315
|
+
id: item.id,
|
|
316
|
+
platform: item.platform,
|
|
317
|
+
workOrderCode: item.id,
|
|
318
|
+
flowStatus: item.flowStatus,
|
|
319
|
+
flowStatusZh: get(WORK_ORDER_STATUS, "".concat(item.flowStatus, ".label")),
|
|
320
|
+
platformTypeZh: item.platformTypeName,
|
|
321
|
+
showCheckButton: showCheckButton,
|
|
322
|
+
showUnCheckButton: showUnCheckButton,
|
|
323
|
+
hasPayWorkOrder: hasPayWorkOrder,
|
|
324
|
+
isInterfaceCompany: isInterfaceCompany,
|
|
325
|
+
repeatValueList: item.repeatValueList,
|
|
326
|
+
// TODO: 新增重复提醒
|
|
327
|
+
flowTemplateId: item.flowTemplateId,
|
|
328
|
+
flowWorkOrderUpdateTime: item.flowWorkOrderUpdateTime,
|
|
329
|
+
workOrderUpdateTime: item.update,
|
|
330
|
+
flowWorkOrderId: item === null || item === void 0 ? void 0 : item.flowWorkOrderId,
|
|
331
|
+
nodeId: item === null || item === void 0 ? void 0 : item.nodeId,
|
|
332
|
+
currentNodeId: item === null || item === void 0 ? void 0 : item.currentNodeId,
|
|
333
|
+
operateParams: {
|
|
334
|
+
flowWorkOrderUpdateTime: item === null || item === void 0 ? void 0 : item.flowWorkOrderUpdateTime,
|
|
335
|
+
workOrderUpdateTime: item === null || item === void 0 ? void 0 : item.update
|
|
336
|
+
},
|
|
337
|
+
handlerDeadLine: item === null || item === void 0 ? void 0 : item.handlerDeadLine,
|
|
338
|
+
nodeDeadLine: item === null || item === void 0 ? void 0 : item.nodeDeadLine,
|
|
339
|
+
nodeStayDuration: item === null || item === void 0 ? void 0 : item.nodeStayDuration,
|
|
340
|
+
repeatValueKeys: ((item === null || item === void 0 ? void 0 : item.repeatValueInfo) || []).map(function (t) {
|
|
341
|
+
return t.componentKey;
|
|
342
|
+
})
|
|
343
|
+
});
|
|
344
|
+
});
|
|
345
|
+
return newList;
|
|
346
|
+
// return transformList(newList);
|
|
347
|
+
};
|
|
@@ -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", "memberLevel", "erpOrderType", "erpOrderStatus", "orderRefundType", "executeActionType", "checkbox", "multSelect", "rate", "picture", "pictureProList", "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", "kmSystemShowOrder", "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", "bsE3InStockStatusItemList", "bsE3InStockStatusList", "wdtInStockStatusItemList", "wdtInStockStatusList", "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", "subOrderList", "label", "kmSendGood", "kmSendId", "kmSendName", "kmGoods", "gyGoods", "gyReissueType", "gySystemOrderNo", "gyReissueGoods", "gySendGood", "gySendId", "gySendName", "gyLogisticsCode", "gySystemShowOrder", "gySystemSelectIds", "gyLogisticsCompany", "gyLogisticsList", "gyReturnGoods", "gyReturnType", "gyExchangeGoods", "kmLogisticsList", "jstGoods", "jstSendGood", "jstReissueType", "jstReissueGoods", "jstSystemOrderNo", "jstLogisticsList", "jstSystemShowOrder", "jstSystemSelectIds", "jstReturnGoods", "jstReturnType", "jstExchangeGoods", "trajectoryApiStatus", "kmReissueGoods", "kmReissueType", "kmReturnGoods", "kmReturnType", "kmVideo", "wdtTags", "skxGoods", "skxReturnGoods", "skxLogisticsList", "skxReturnLogistics"].reduce(function (cur, nxt) {
|
|
2
|
+
return ["itemList", "itemId", "supplierName", "numIid", "aloneItemId", "aloneItemEncode", "jstItemList", "logisticsCompany", "logisticsCode", "supplyId", "supplyName", "sendId", "sendName", "dateTime", "basicMultSelect", "memberLevel", "erpOrderType", "erpOrderStatus", "orderRefundType", "executeActionType", "checkbox", "multSelect", "rate", "picture", "pictureProList", "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", "kmSystemShowOrder", "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", "bsE3InStockStatusItemList", "bsE3InStockStatusList", "wdtInStockStatusItemList", "wdtInStockStatusList", "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", "subOrderList", "label", "kmSendGood", "kmSendId", "kmSendName", "kmGoods", "gyGoods", "gyReissueType", "gySystemOrderNo", "gyReissueGoods", "gySendGood", "gySendId", "gySendName", "gyLogisticsCode", "gySystemShowOrder", "gySystemSelectIds", "gyLogisticsCompany", "gyLogisticsList", "gyReturnGoods", "gyReturnType", "gyExchangeGoods", "jyGoods", "jySystemOrderNo", "jySystemShowOrder", "jySystemSelectIds", "jySendGood", "jySendId", "jySendName", "jyLogisticsList", "jyLogisticsCompany", "jyLogisticsCode", "kmLogisticsList", "jstGoods", "jstSendGood", "jstReissueType", "jstReissueGoods", "jstSystemOrderNo", "jstLogisticsList", "jstSystemShowOrder", "jstSystemSelectIds", "jstReturnGoods", "jstReturnType", "jstExchangeGoods", "trajectoryApiStatus", "kmReissueGoods", "kmReissueType", "kmReturnGoods", "kmReturnType", "kmVideo", "wdtTags", "skxGoods", "skxReturnGoods", "skxLogisticsList", "skxReturnLogistics"].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.2.
|
|
3
|
+
"version": "2.2.13-rc.1",
|
|
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": "3228d67043fa6985210250b064a0011220ad4a40",
|
|
45
45
|
"gitHooks": {
|
|
46
46
|
"pre-commit": "lint-staged"
|
|
47
47
|
}
|