@kmkf-fe-packages/basic-components 2.2.39-beta.25 → 2.2.39-beta.26

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/dist/index.esm.js CHANGED
@@ -27033,124 +27033,100 @@ var CommonGoods = function CommonGoods(props) {
27033
27033
  return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp = componentMap$2[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.goodDetailOrderNo]) === orderNo;
27034
27034
  }) : goodDetails;
27035
27035
  };
27036
- var getKmSupplier = /*#__PURE__*/function () {
27037
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(list) {
27038
- var systemItemIds, supplierMap;
27039
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
27040
- while (1) switch (_context3.prev = _context3.next) {
27041
- case 0:
27042
- systemItemIds = list === null || list === void 0 ? void 0 : list.map(function (item) {
27043
- return item.sysItemId;
27044
- });
27045
- _context3.next = 3;
27046
- return servers.KM.getSupplierSingleton(systemItemIds);
27047
- case 3:
27048
- supplierMap = _context3.sent;
27049
- list === null || list === void 0 ? void 0 : list.forEach(function (item) {
27050
- var supplierInfo = supplierMap.get(item.sysItemId);
27051
- item.supplierCode = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierCode;
27052
- item.supplierName = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierName;
27053
- });
27054
- case 5:
27055
- case "end":
27056
- return _context3.stop();
27057
- }
27058
- }, _callee3);
27059
- }));
27060
- return function getKmSupplier(_x3) {
27061
- return _ref4.apply(this, arguments);
27062
- };
27063
- }();
27036
+ // const getKmSupplier = async (list: any[]) => {
27037
+ // const systemItemIds = list?.map((item) => item.sysItemId);
27038
+ // const supplierMap = await servers.KM.getSupplierSingleton(systemItemIds);
27039
+ // list?.forEach((item) => {
27040
+ // const supplierInfo = supplierMap.get(item.sysItemId);
27041
+ // item.supplierCode = supplierInfo?.supplierCode;
27042
+ // item.supplierName = supplierInfo?.supplierName;
27043
+ // });
27044
+ // };
27064
27045
  // 找到该订单号下所有商品
27065
27046
  var getAllTradeGoodsDetails = /*#__PURE__*/function () {
27066
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref5) {
27047
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
27067
27048
  var mode, updateHandle, goodDetails, orderNo;
27068
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
27069
- while (1) switch (_context4.prev = _context4.next) {
27049
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
27050
+ while (1) switch (_context3.prev = _context3.next) {
27070
27051
  case 0:
27071
- mode = _ref5.mode;
27052
+ mode = _ref4.mode;
27072
27053
  updateHandle = componentMap$2[compType].eventNameMap['updateGoodsHandle'];
27073
27054
  if (updateHandle) {
27074
- _context4.next = 4;
27055
+ _context3.next = 4;
27075
27056
  break;
27076
27057
  }
27077
- return _context4.abrupt("return", []);
27058
+ return _context3.abrupt("return", []);
27078
27059
  case 4:
27079
27060
  goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
27080
27061
  orderBackGoodsLevel: props.orderBackGoodsLevel
27081
27062
  });
27082
- orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
27083
- if (!['KM_GOODS', 'KM_REISSUE_GOODS'].includes(compType)) {
27084
- _context4.next = 9;
27085
- break;
27086
- }
27087
- _context4.next = 9;
27088
- return getKmSupplier(goodDetails);
27089
- case 9:
27090
- return _context4.abrupt("return", mode ? goodDetails.filter(function (goodItem) {
27063
+ orderNo = value === null || value === void 0 ? void 0 : value.orderNo; // if (['KM_GOODS', 'KM_REISSUE_GOODS'].includes(compType)) {
27064
+ // await getKmSupplier(goodDetails);
27065
+ // }
27066
+ return _context3.abrupt("return", mode ? goodDetails.filter(function (goodItem) {
27091
27067
  var _componentMap$compTyp2;
27092
27068
  return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp2 = componentMap$2[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.goodDetailOrderNo]) === orderNo;
27093
27069
  }) : goodDetails);
27094
- case 10:
27070
+ case 7:
27095
27071
  case "end":
27096
- return _context4.stop();
27072
+ return _context3.stop();
27097
27073
  }
27098
- }, _callee4);
27074
+ }, _callee3);
27099
27075
  }));
27100
- return function getAllTradeGoodsDetails(_x4) {
27101
- return _ref6.apply(this, arguments);
27076
+ return function getAllTradeGoodsDetails(_x3) {
27077
+ return _ref5.apply(this, arguments);
27102
27078
  };
27103
27079
  }();
27104
27080
  // 异步获取 originDataSource
27105
27081
  useEffect(function () {
27106
27082
  var fetchOriginDataSource = /*#__PURE__*/function () {
27107
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
27083
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
27108
27084
  var data;
27109
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
27110
- while (1) switch (_context5.prev = _context5.next) {
27085
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
27086
+ while (1) switch (_context4.prev = _context4.next) {
27111
27087
  case 0:
27112
- _context5.next = 2;
27088
+ _context4.next = 2;
27113
27089
  return getAllTradeGoodsDetails({
27114
27090
  mode: value === null || value === void 0 ? void 0 : value.isStrict
27115
27091
  });
27116
27092
  case 2:
27117
- data = _context5.sent;
27093
+ data = _context4.sent;
27118
27094
  console.log('fetchOriginDataSource', data);
27119
27095
  setOriginDataSource(Array.isArray(data) ? data : []);
27120
27096
  case 5:
27121
27097
  case "end":
27122
- return _context5.stop();
27098
+ return _context4.stop();
27123
27099
  }
27124
- }, _callee5);
27100
+ }, _callee4);
27125
27101
  }));
27126
27102
  return function fetchOriginDataSource() {
27127
- return _ref7.apply(this, arguments);
27103
+ return _ref6.apply(this, arguments);
27128
27104
  };
27129
27105
  }();
27130
27106
  fetchOriginDataSource();
27131
27107
  }, [value === null || value === void 0 ? void 0 : value.allOrders, value === null || value === void 0 ? void 0 : value.isStrict, value === null || value === void 0 ? void 0 : value.orderNo, compType]);
27132
27108
  var selectedGoodsChange = /*#__PURE__*/function () {
27133
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(skuList) {
27109
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(skuList) {
27134
27110
  var _valueRef$current9, _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
27135
27111
  var newValue, isStrict, originTradeGoodList, currentSelectGoodList;
27136
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
27137
- while (1) switch (_context6.prev = _context6.next) {
27112
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
27113
+ while (1) switch (_context5.prev = _context5.next) {
27138
27114
  case 0:
27139
27115
  newValue = _objectSpread2({}, valueRef.current);
27140
27116
  isStrict = valueRef.current.isStrict; // 原订单商品
27141
- _context6.next = 4;
27117
+ _context5.next = 4;
27142
27118
  return getAllTradeGoodsDetails({
27143
27119
  mode: isStrict
27144
27120
  });
27145
27121
  case 4:
27146
- _context6.t0 = _context6.sent;
27147
- if (_context6.t0) {
27148
- _context6.next = 7;
27122
+ _context5.t0 = _context5.sent;
27123
+ if (_context5.t0) {
27124
+ _context5.next = 7;
27149
27125
  break;
27150
27126
  }
27151
- _context6.t0 = [];
27127
+ _context5.t0 = [];
27152
27128
  case 7:
27153
- originTradeGoodList = _context6.t0;
27129
+ originTradeGoodList = _context5.t0;
27154
27130
  // 当前选中的所有商品【包含了原订单+商品库】
27155
27131
  currentSelectGoodList = ((_valueRef$current9 = valueRef.current) === null || _valueRef$current9 === void 0 ? void 0 : _valueRef$current9["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$2[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.key)]) || [];
27156
27132
  newValue["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$2[compType]) === null || _componentMap$compTyp4 === void 0 ? void 0 : _componentMap$compTyp4.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
@@ -27159,12 +27135,12 @@ var CommonGoods = function CommonGoods(props) {
27159
27135
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
27160
27136
  case 11:
27161
27137
  case "end":
27162
- return _context6.stop();
27138
+ return _context5.stop();
27163
27139
  }
27164
- }, _callee6);
27140
+ }, _callee5);
27165
27141
  }));
27166
- return function selectedGoodsChange(_x5) {
27167
- return _ref8.apply(this, arguments);
27142
+ return function selectedGoodsChange(_x4) {
27143
+ return _ref7.apply(this, arguments);
27168
27144
  };
27169
27145
  }();
27170
27146
  // 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
package/dist/index.js CHANGED
@@ -27048,124 +27048,100 @@ var CommonGoods = function CommonGoods(props) {
27048
27048
  return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp = componentMap$2[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.goodDetailOrderNo]) === orderNo;
27049
27049
  }) : goodDetails;
27050
27050
  };
27051
- var getKmSupplier = /*#__PURE__*/function () {
27052
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(list) {
27053
- var systemItemIds, supplierMap;
27054
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
27055
- while (1) switch (_context3.prev = _context3.next) {
27056
- case 0:
27057
- systemItemIds = list === null || list === void 0 ? void 0 : list.map(function (item) {
27058
- return item.sysItemId;
27059
- });
27060
- _context3.next = 3;
27061
- return kmkfUtils.servers.KM.getSupplierSingleton(systemItemIds);
27062
- case 3:
27063
- supplierMap = _context3.sent;
27064
- list === null || list === void 0 ? void 0 : list.forEach(function (item) {
27065
- var supplierInfo = supplierMap.get(item.sysItemId);
27066
- item.supplierCode = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierCode;
27067
- item.supplierName = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierName;
27068
- });
27069
- case 5:
27070
- case "end":
27071
- return _context3.stop();
27072
- }
27073
- }, _callee3);
27074
- }));
27075
- return function getKmSupplier(_x3) {
27076
- return _ref4.apply(this, arguments);
27077
- };
27078
- }();
27051
+ // const getKmSupplier = async (list: any[]) => {
27052
+ // const systemItemIds = list?.map((item) => item.sysItemId);
27053
+ // const supplierMap = await servers.KM.getSupplierSingleton(systemItemIds);
27054
+ // list?.forEach((item) => {
27055
+ // const supplierInfo = supplierMap.get(item.sysItemId);
27056
+ // item.supplierCode = supplierInfo?.supplierCode;
27057
+ // item.supplierName = supplierInfo?.supplierName;
27058
+ // });
27059
+ // };
27079
27060
  // 找到该订单号下所有商品
27080
27061
  var getAllTradeGoodsDetails = /*#__PURE__*/function () {
27081
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref5) {
27062
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
27082
27063
  var mode, updateHandle, goodDetails, orderNo;
27083
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
27084
- while (1) switch (_context4.prev = _context4.next) {
27064
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
27065
+ while (1) switch (_context3.prev = _context3.next) {
27085
27066
  case 0:
27086
- mode = _ref5.mode;
27067
+ mode = _ref4.mode;
27087
27068
  updateHandle = componentMap$2[compType].eventNameMap['updateGoodsHandle'];
27088
27069
  if (updateHandle) {
27089
- _context4.next = 4;
27070
+ _context3.next = 4;
27090
27071
  break;
27091
27072
  }
27092
- return _context4.abrupt("return", []);
27073
+ return _context3.abrupt("return", []);
27093
27074
  case 4:
27094
27075
  goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
27095
27076
  orderBackGoodsLevel: props.orderBackGoodsLevel
27096
27077
  });
27097
- orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
27098
- if (!['KM_GOODS', 'KM_REISSUE_GOODS'].includes(compType)) {
27099
- _context4.next = 9;
27100
- break;
27101
- }
27102
- _context4.next = 9;
27103
- return getKmSupplier(goodDetails);
27104
- case 9:
27105
- return _context4.abrupt("return", mode ? goodDetails.filter(function (goodItem) {
27078
+ orderNo = value === null || value === void 0 ? void 0 : value.orderNo; // if (['KM_GOODS', 'KM_REISSUE_GOODS'].includes(compType)) {
27079
+ // await getKmSupplier(goodDetails);
27080
+ // }
27081
+ return _context3.abrupt("return", mode ? goodDetails.filter(function (goodItem) {
27106
27082
  var _componentMap$compTyp2;
27107
27083
  return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp2 = componentMap$2[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.goodDetailOrderNo]) === orderNo;
27108
27084
  }) : goodDetails);
27109
- case 10:
27085
+ case 7:
27110
27086
  case "end":
27111
- return _context4.stop();
27087
+ return _context3.stop();
27112
27088
  }
27113
- }, _callee4);
27089
+ }, _callee3);
27114
27090
  }));
27115
- return function getAllTradeGoodsDetails(_x4) {
27116
- return _ref6.apply(this, arguments);
27091
+ return function getAllTradeGoodsDetails(_x3) {
27092
+ return _ref5.apply(this, arguments);
27117
27093
  };
27118
27094
  }();
27119
27095
  // 异步获取 originDataSource
27120
27096
  React.useEffect(function () {
27121
27097
  var fetchOriginDataSource = /*#__PURE__*/function () {
27122
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
27098
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
27123
27099
  var data;
27124
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
27125
- while (1) switch (_context5.prev = _context5.next) {
27100
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
27101
+ while (1) switch (_context4.prev = _context4.next) {
27126
27102
  case 0:
27127
- _context5.next = 2;
27103
+ _context4.next = 2;
27128
27104
  return getAllTradeGoodsDetails({
27129
27105
  mode: value === null || value === void 0 ? void 0 : value.isStrict
27130
27106
  });
27131
27107
  case 2:
27132
- data = _context5.sent;
27108
+ data = _context4.sent;
27133
27109
  console.log('fetchOriginDataSource', data);
27134
27110
  setOriginDataSource(Array.isArray(data) ? data : []);
27135
27111
  case 5:
27136
27112
  case "end":
27137
- return _context5.stop();
27113
+ return _context4.stop();
27138
27114
  }
27139
- }, _callee5);
27115
+ }, _callee4);
27140
27116
  }));
27141
27117
  return function fetchOriginDataSource() {
27142
- return _ref7.apply(this, arguments);
27118
+ return _ref6.apply(this, arguments);
27143
27119
  };
27144
27120
  }();
27145
27121
  fetchOriginDataSource();
27146
27122
  }, [value === null || value === void 0 ? void 0 : value.allOrders, value === null || value === void 0 ? void 0 : value.isStrict, value === null || value === void 0 ? void 0 : value.orderNo, compType]);
27147
27123
  var selectedGoodsChange = /*#__PURE__*/function () {
27148
- var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(skuList) {
27124
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(skuList) {
27149
27125
  var _valueRef$current9, _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
27150
27126
  var newValue, isStrict, originTradeGoodList, currentSelectGoodList;
27151
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
27152
- while (1) switch (_context6.prev = _context6.next) {
27127
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
27128
+ while (1) switch (_context5.prev = _context5.next) {
27153
27129
  case 0:
27154
27130
  newValue = _objectSpread2({}, valueRef.current);
27155
27131
  isStrict = valueRef.current.isStrict; // 原订单商品
27156
- _context6.next = 4;
27132
+ _context5.next = 4;
27157
27133
  return getAllTradeGoodsDetails({
27158
27134
  mode: isStrict
27159
27135
  });
27160
27136
  case 4:
27161
- _context6.t0 = _context6.sent;
27162
- if (_context6.t0) {
27163
- _context6.next = 7;
27137
+ _context5.t0 = _context5.sent;
27138
+ if (_context5.t0) {
27139
+ _context5.next = 7;
27164
27140
  break;
27165
27141
  }
27166
- _context6.t0 = [];
27142
+ _context5.t0 = [];
27167
27143
  case 7:
27168
- originTradeGoodList = _context6.t0;
27144
+ originTradeGoodList = _context5.t0;
27169
27145
  // 当前选中的所有商品【包含了原订单+商品库】
27170
27146
  currentSelectGoodList = ((_valueRef$current9 = valueRef.current) === null || _valueRef$current9 === void 0 ? void 0 : _valueRef$current9["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$2[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.key)]) || [];
27171
27147
  newValue["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$2[compType]) === null || _componentMap$compTyp4 === void 0 ? void 0 : _componentMap$compTyp4.key)] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
@@ -27174,12 +27150,12 @@ var CommonGoods = function CommonGoods(props) {
27174
27150
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
27175
27151
  case 11:
27176
27152
  case "end":
27177
- return _context6.stop();
27153
+ return _context5.stop();
27178
27154
  }
27179
- }, _callee6);
27155
+ }, _callee5);
27180
27156
  }));
27181
- return function selectedGoodsChange(_x5) {
27182
- return _ref8.apply(this, arguments);
27157
+ return function selectedGoodsChange(_x4) {
27158
+ return _ref7.apply(this, arguments);
27183
27159
  };
27184
27160
  }();
27185
27161
  // 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.2.39-beta.25",
3
+ "version": "2.2.39-beta.26",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -66,5 +66,5 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  },
69
- "gitHead": "0e114e7d44d95ca335cef155e45a9da066253b1f"
69
+ "gitHead": "00f8091914491ce979d84162aed8002be14f3cc8"
70
70
  }