@kmkf-fe-packages/kmkf-utils 1.1.0 → 1.1.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.
@@ -8,6 +8,7 @@ export declare const queryWdtWarehouseList: (pageNo: number, pageSize: number) =
8
8
  warehouses: {
9
9
  warehouseNo: string;
10
10
  name: string;
11
+ is_disabled: boolean;
11
12
  }[];
12
13
  totalCount?: number | undefined;
13
14
  }>>;
@@ -150,6 +150,35 @@ var updateWdtItemListByConfigHandle = function updateWdtItemListByConfigHandle(l
150
150
  return prv;
151
151
  }, []);
152
152
  };
153
+
154
+ // WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
155
+ var handleOrderNo = function handleOrderNo(detail, form) {
156
+ var _detail$componentList, _detail$componentList2;
157
+ var tradeIdComp = detail === null || detail === void 0 ? void 0 : (_detail$componentList = detail.componentList) === null || _detail$componentList === void 0 ? void 0 : (_detail$componentList2 = _detail$componentList.find) === null || _detail$componentList2 === void 0 ? void 0 : _detail$componentList2.call(_detail$componentList, function (item) {
158
+ return item.workOrderComponentType === 'TRADE_ID_INPUT';
159
+ });
160
+ var tradeIdValue = form.getFieldValue(tradeIdComp.uniqueKey) || form.getFieldValue("".concat(tradeIdComp.uniqueKey, "_tradeId"));
161
+ var currentTrades = ((detail === null || detail === void 0 ? void 0 : detail.trades) || []).filter(function (item) {
162
+ return (item.srcTid || '').split(',').includes(tradeIdValue);
163
+ }).map(function (item) {
164
+ if (Array.isArray(item.goodDetails)) {
165
+ item.goodDetails = item.goodDetails.filter(function (good) {
166
+ return good.srcTid === tradeIdValue;
167
+ });
168
+ }
169
+ return item;
170
+ });
171
+ if (currentTrades.length) {
172
+ return {
173
+ currentTrades: currentTrades,
174
+ orderNo: tradeIdValue
175
+ };
176
+ }
177
+ return {
178
+ currentTrades: [],
179
+ orderNo: ''
180
+ };
181
+ };
153
182
  export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
154
183
  var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
155
184
  var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -212,25 +241,26 @@ export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
212
241
  };
213
242
  //wdt订单信息转换
214
243
  export var wdtOrderTransform = function wdtOrderTransform(detail, form) {
215
- var _detail$trades, _detail$trades$find, _detail$trades2, _ref, _detail$trades3, _detail$trades3$find, _detail$trades3$find$;
244
+ var _detail$trades, _currentTrades$find, _currentTrades$find$c;
216
245
  // const advItem: any =
217
246
  // detail?.orders?.[0]?.advancedDistributionInfos?.[0] || {};
247
+ var _handleOrderNo = handleOrderNo(detail, form),
248
+ currentTrades = _handleOrderNo.currentTrades,
249
+ orderNo = _handleOrderNo.orderNo;
218
250
  return {
219
251
  wdtSystemOrder: {
220
- orderNo: (detail === null || detail === void 0 ? void 0 : (_detail$trades = detail.trades) === null || _detail$trades === void 0 ? void 0 : (_detail$trades$find = _detail$trades.find(function (item) {
221
- return item.srcTid;
222
- })) === null || _detail$trades$find === void 0 ? void 0 : _detail$trades$find.srcTid) || '',
223
- orders: ((detail === null || detail === void 0 ? void 0 : detail.trades) || []).map(function (item) {
252
+ orderNo: orderNo,
253
+ orders: currentTrades.map(function (item) {
224
254
  return _objectSpread(_objectSpread({}, item), {}, {
225
255
  billNo: item.tradeNo,
226
256
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
227
257
  billTag: item.tagName
228
258
  });
229
259
  }),
230
- selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$trades2 = detail.trades) === null || _detail$trades2 === void 0 ? void 0 : _detail$trades2.length) === 1 ? detail === null || detail === void 0 ? void 0 : detail.trades.map(function (item) {
260
+ selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$trades = detail.trades) === null || _detail$trades === void 0 ? void 0 : _detail$trades.length) === 1 ? currentTrades.map(function (item) {
231
261
  return item.tradeNo;
232
262
  }) : [],
233
- showOrderInfo: (_ref = (detail === null || detail === void 0 ? void 0 : detail.trades) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (item) {
263
+ showOrderInfo: currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.map(function (item) {
234
264
  return {
235
265
  billNo: item.tradeNo,
236
266
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
@@ -239,13 +269,13 @@ export var wdtOrderTransform = function wdtOrderTransform(detail, form) {
239
269
  })
240
270
  },
241
271
  wdtGoods: {
242
- shopCode: (detail === null || detail === void 0 ? void 0 : (_detail$trades3 = detail.trades) === null || _detail$trades3 === void 0 ? void 0 : (_detail$trades3$find = _detail$trades3.find) === null || _detail$trades3$find === void 0 ? void 0 : (_detail$trades3$find$ = _detail$trades3$find.call(_detail$trades3, function (item) {
272
+ 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) {
243
273
  return item.shopNo;
244
- })) === null || _detail$trades3$find$ === void 0 ? void 0 : _detail$trades3$find$.shopNo) || null,
245
- wdtGoods: updateWdtGoodsHandle(detail === null || detail === void 0 ? void 0 : detail.trades)
274
+ })) === null || _currentTrades$find$c === void 0 ? void 0 : _currentTrades$find$c.shopNo) || null,
275
+ wdtGoods: updateWdtGoodsHandle(currentTrades)
246
276
  },
247
- wdtLogistics: updateWdtItemListHandle(detail === null || detail === void 0 ? void 0 : detail.trades, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
248
- wdtSendGood: updateWdtItemListHandle(detail === null || detail === void 0 ? void 0 : detail.trades, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
277
+ wdtLogistics: updateWdtItemListHandle(currentTrades, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
278
+ wdtSendGood: updateWdtItemListHandle(currentTrades, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
249
279
  // wdtSingingTime: detail?.receiptDate,
250
280
  // wdtSendTime:
251
281
  // detail?.orders?.[0]?.advancedDistributionInfos?.[0]?.deliveryDate,
@@ -13,11 +13,14 @@ var getWarehouseDataAsync = function getWarehouseDataAsync() {
13
13
  var warehouses = (data === null || data === void 0 ? void 0 : data.warehouses) || [];
14
14
  warehouses.map(function (_ref) {
15
15
  var warehouseNo = _ref.warehouseNo,
16
- name = _ref.name;
17
- list.push({
18
- label: name,
19
- value: warehouseNo
20
- });
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
+ }
21
24
  });
22
25
  pageNo++;
23
26
  if (pageSize === warehouses.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -40,7 +40,7 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "7234f433e97adce6c27bbd7c087cb043a1627739",
43
+ "gitHead": "4561254272f4a9cc7e4adc47be66e2e8c77a49c7",
44
44
  "gitHooks": {
45
45
  "pre-commit": "lint-staged"
46
46
  }