@kmkf-fe-packages/basic-components 2.0.54-beta.36 → 2.0.54-beta.39

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
@@ -16064,6 +16064,15 @@ var getColumns$5 = function getColumns() {
16064
16064
  };
16065
16065
  };
16066
16066
 
16067
+ function toNum$2(value) {
16068
+ if (typeof value === 'string') {
16069
+ return value ? +value : void 0;
16070
+ }
16071
+ if (typeof value === 'number') {
16072
+ return value;
16073
+ }
16074
+ return void 0;
16075
+ }
16067
16076
  var getColumns$6 = function getColumns(_ref) {
16068
16077
  var _ref$text = _ref.text,
16069
16078
  disabled = _ref.disabled,
@@ -16158,6 +16167,126 @@ var getColumns$6 = function getColumns(_ref) {
16158
16167
  align: 'center',
16159
16168
  ellipsis: true
16160
16169
  });
16170
+ }),
16171
+ KM_REISSUE_GOODS: [{
16172
+ dataIndex: 'sysSkuPropertiesName',
16173
+ title: "\u89C4\u683C\u540D\u79F0",
16174
+ width: 250
16175
+ }, {
16176
+ dataIndex: 'sysTitle',
16177
+ title: "\u7CFB\u7EDF\u5546\u54C1\u540D\u79F0",
16178
+ width: 150
16179
+ }, {
16180
+ dataIndex: 'shortTitle',
16181
+ title: "\u5546\u54C1\u7B80\u79F0",
16182
+ width: 150
16183
+ }, {
16184
+ dataIndex: 'title',
16185
+ title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
16186
+ width: 150
16187
+ }, {
16188
+ dataIndex: 'outerId',
16189
+ title: "\u5546\u5BB6\u7F16\u7801",
16190
+ width: 150
16191
+ }, {
16192
+ dataIndex: 'sysOuterId',
16193
+ title: "\u7CFB\u7EDF\u5546\u5BB6\u7F16\u7801",
16194
+ width: 150
16195
+ }, {
16196
+ dataIndex: 'itemSysId',
16197
+ title: "\u7CFB\u7EDF\u5546\u54C1ID",
16198
+ width: 150
16199
+ }, {
16200
+ dataIndex: 'skuSysId',
16201
+ title: "\u7CFB\u7EDF\u89C4\u683CID",
16202
+ width: 150
16203
+ }, {
16204
+ dataIndex: 'realNum',
16205
+ title: "\u5B9E\u9645\u8865\u53D1\u6570\u91CF",
16206
+ width: 100,
16207
+ validator: function validator(_rule, value) {
16208
+ var title = '';
16209
+ if (((value === null || value === void 0 ? void 0 : value.kmReissueGoods) || []).some(function (goods) {
16210
+ var realNum = toNum$2(goods === null || goods === void 0 ? void 0 : goods.realNum);
16211
+ var res = typeof realNum === 'number' ? realNum < 1 : true;
16212
+ if (res) {
16213
+ title = (goods === null || goods === void 0 ? void 0 : goods.goodName) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : '';
16214
+ }
16215
+ return res;
16216
+ })) {
16217
+ return Promise.reject("".concat(title, "\u5B9E\u9645\u8865\u53D1\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
16218
+ }
16219
+ },
16220
+ render: function render(val, record, index) {
16221
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
16222
+ style: {
16223
+ width: 70
16224
+ },
16225
+ value: val,
16226
+ min: 1,
16227
+ precision: 0,
16228
+ onChange: function onChange(num) {
16229
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'realNum');
16230
+ }
16231
+ }) : /*#__PURE__*/React.createElement("span", null, val);
16232
+ }
16233
+ }, {
16234
+ dataIndex: 'desiredNum',
16235
+ title: "\u5E94\u8865\u53D1\u6570\u91CF",
16236
+ width: 100,
16237
+ render: function render(val, record, index) {
16238
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
16239
+ style: {
16240
+ width: 70
16241
+ },
16242
+ value: val,
16243
+ min: 1,
16244
+ precision: 0,
16245
+ onChange: function onChange(num) {
16246
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'desiredNum');
16247
+ }
16248
+ }) : /*#__PURE__*/React.createElement("span", null, val);
16249
+ }
16250
+ }, {
16251
+ dataIndex: 'price',
16252
+ title: "\u5546\u54C1\u9500\u552E\u4EF7",
16253
+ width: 150
16254
+ }, {
16255
+ dataIndex: 'payment',
16256
+ title: "\u5B9E\u4ED8\u91D1\u989D",
16257
+ width: 150,
16258
+ render: function render(val, record, index) {
16259
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
16260
+ style: {
16261
+ width: 130
16262
+ },
16263
+ value: val,
16264
+ min: 0,
16265
+ precision: 2,
16266
+ onChange: function onChange(num) {
16267
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'payment');
16268
+ }
16269
+ }) : /*#__PURE__*/React.createElement("span", null, val);
16270
+ }
16271
+ }, {
16272
+ dataIndex: 'type',
16273
+ title: "\u5546\u54C1\u7C7B\u578B",
16274
+ width: 150
16275
+ }, {
16276
+ dataIndex: 'sysPicPath',
16277
+ title: "\u5546\u54C1\u56FE\u7247",
16278
+ width: 100,
16279
+ render: function render(val) {
16280
+ return /*#__PURE__*/React.createElement(Image, {
16281
+ width: 60,
16282
+ src: val
16283
+ });
16284
+ }
16285
+ }].map(function (item) {
16286
+ return _objectSpread2(_objectSpread2({}, item), {}, {
16287
+ align: 'center',
16288
+ ellipsis: true
16289
+ });
16161
16290
  })
16162
16291
  };
16163
16292
  };
@@ -16471,7 +16600,7 @@ var isErpType = {
16471
16600
  return ['JST_GOODS', 'JST_REISSUE_GOODS', 'JST_RETURN_GOODS', 'JST_EXCHANGE_GOODS'].includes(type);
16472
16601
  },
16473
16602
  isKm: function isKm(type) {
16474
- return ['KM_GOODS'].includes(type);
16603
+ return ['KM_GOODS', 'KM_REISSUE_GOODS'].includes(type);
16475
16604
  }
16476
16605
  };
16477
16606
  var processGoods = function processGoods(_ref) {
@@ -16622,7 +16751,17 @@ var processJstGoods = function processJstGoods(_ref5) {
16622
16751
  });
16623
16752
  };
16624
16753
  var processKmGoods = function processKmGoods(_ref6) {
16625
- var list = _ref6.list;
16754
+ var list = _ref6.list,
16755
+ type = _ref6.type;
16756
+ var initParamsMap = {
16757
+ KM_GOODS: {
16758
+ num: 1
16759
+ },
16760
+ KM_REISSUE_GOODS: {
16761
+ realNum: 1,
16762
+ desiredNum: 1
16763
+ }
16764
+ };
16626
16765
  return list.map(function (item) {
16627
16766
  return _objectSpread2(_objectSpread2({}, item), {}, {
16628
16767
  sysSkuPropertiesName: item.specName,
@@ -16639,9 +16778,8 @@ var processKmGoods = function processKmGoods(_ref6) {
16639
16778
  type: null,
16640
16779
  uuid: uuid(),
16641
16780
  canDelete: true,
16642
- canEdit: true,
16643
- num: 1
16644
- });
16781
+ canEdit: true
16782
+ }, initParamsMap[type] || {});
16645
16783
  });
16646
16784
  };
16647
16785
  var processDefaultGoods = function processDefaultGoods(_ref7) {
@@ -16688,6 +16826,7 @@ var GoodsModalMap = {
16688
16826
  JST_RETURN_GOODS: JstGoodsModal,
16689
16827
  JST_EXCHANGE_GOODS: JstGoodsModal,
16690
16828
  KM_GOODS: KmGoodsModal,
16829
+ KM_REISSUE_GOODS: KmGoodsModal,
16691
16830
  OTHER_GOODS: GoodsModal$2
16692
16831
  };
16693
16832
  var SelectTradeGoods = function SelectTradeGoods(_ref) {
@@ -16750,7 +16889,7 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
16750
16889
  };
16751
16890
  var getButtonText = function getButtonText() {
16752
16891
  var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
16753
- if (['KM_GOODS'].includes(type)) {
16892
+ if (['KM_GOODS', 'KM_REISSUE_GOODS'].includes(type)) {
16754
16893
  return '选择快麦ERP商品';
16755
16894
  }
16756
16895
  if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
@@ -16897,6 +17036,7 @@ var GoodItem$1 = function GoodItem(props) {
16897
17036
  case 'GY_REISSUE_GOODS':
16898
17037
  case 'GY_RETURN_GOODS':
16899
17038
  case 'KM_GOODS':
17039
+ case 'KM_REISSUE_GOODS':
16900
17040
  {
16901
17041
  columns = getColumnsMap$1({
16902
17042
  text: text,
@@ -19236,7 +19376,9 @@ var typeMap$2 = {
19236
19376
  orderTypeKey: 'orderType',
19237
19377
  oIdKey: 'oId',
19238
19378
  outerOiIdKey: '',
19239
- goodDetailsKey: 'items'
19379
+ goodDetailsKey: 'items',
19380
+ mergeIdenticalGoods: jstMergeIdenticalGoods,
19381
+ uniqueKey: 'uuid'
19240
19382
  },
19241
19383
  JST_RETURN_GOODS: {
19242
19384
  compType: '退货',
@@ -19252,6 +19394,8 @@ var typeMap$2 = {
19252
19394
  oIdKey: 'oId',
19253
19395
  outerOiIdKey: '',
19254
19396
  goodDetailsKey: 'items',
19397
+ mergeIdenticalGoods: jstMergeIdenticalGoods,
19398
+ uniqueKey: 'uuid',
19255
19399
  eventNameMap: {
19256
19400
  // pubsub 事件
19257
19401
  exchangeCopyGood: 'jstExchangeCopyGood',
@@ -19259,10 +19403,25 @@ var typeMap$2 = {
19259
19403
  returnGoodsSysorder: 'jstReturnGoodsSysorder',
19260
19404
  returnGoodsSysorderBack: 'jstReturnGoodsSysorderBack'
19261
19405
  }
19406
+ },
19407
+ KM_REISSUE_GOODS: {
19408
+ compType: '补发',
19409
+ key: 'kmReissueGoods',
19410
+ typeName: 'kmReissueType',
19411
+ systemOrder: 'kmSystemOrder',
19412
+ systemOrderNo: 'kmSystemOrderNo',
19413
+ getOrderList: kmUtils.getOrderListSingleton,
19414
+ updateGoodsHandle: updateKmGoodsHandle,
19415
+ alwaysShowChooseErpGoodsBtn: true,
19416
+ orderTypeKey: 'orderType',
19417
+ oIdKey: 'billNo',
19418
+ outerOiIdKey: '',
19419
+ goodDetailsKey: 'subOrders',
19420
+ uniqueKey: 'id'
19262
19421
  }
19263
19422
  };
19264
19423
  var PublicReissue = function PublicReissue(props) {
19265
- var _typeMap$type31, _typeMap$type34, _typeMap$type35, _typeMap$type36, _typeMap$type37, _value$typeMap$type$s6, _typeMap$type38, _typeMap$type39, _typeMap$type40, _typeMap$type41, _typeMap$type42, _typeMap$type43, _typeMap$type44;
19424
+ var _typeMap$type32, _typeMap$type37, _typeMap$type38, _typeMap$type39, _typeMap$type40, _value$typeMap$type$s6, _typeMap$type41, _typeMap$type42, _typeMap$type43, _typeMap$type44, _typeMap$type45, _typeMap$type46, _typeMap$type47, _typeMap$type48;
19266
19425
  var value = props.value,
19267
19426
  onChange = props.onChange,
19268
19427
  _props$reasonList = props.reasonList,
@@ -19376,7 +19535,7 @@ var PublicReissue = function PublicReissue(props) {
19376
19535
  }))));
19377
19536
  };
19378
19537
  var getGoodDetails = function getGoodDetails(_ref4) {
19379
- var _typeMap$type17, _typeMap$type18, _order$typeMap$type$g, _typeMap$type19;
19538
+ var _typeMap$type17, _typeMap$type18, _order$typeMap$type$g, _typeMap$type19, _typeMap$type20;
19380
19539
  var mode = _ref4.mode,
19381
19540
  sysOrderNo = _ref4.sysOrderNo;
19382
19541
  var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type17 = typeMap$2[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.systemOrder];
@@ -19384,37 +19543,47 @@ var PublicReissue = function PublicReissue(props) {
19384
19543
  var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
19385
19544
  return order[typeMap$2[type].oIdKey] === systemOrderNo;
19386
19545
  });
19387
- var goodDetails = jstMergeIdenticalGoods((order === null || order === void 0 ? void 0 : (_order$typeMap$type$g = order[typeMap$2[type].goodDetailsKey]) === null || _order$typeMap$type$g === void 0 ? void 0 : _order$typeMap$type$g.length) ? (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.updateGoodsHandle([order], true) : []);
19546
+ var orderRest = undefined;
19547
+ if (['JST_REISSUE_GOODS', 'JST_RETURN_GOODS'].includes(type)) {
19548
+ orderRest = true;
19549
+ } else if (type === 'KM_REISSUE_GOODS') {
19550
+ orderRest = {
19551
+ orderBackGoodsLevel: props.orderBackGoodsLevel,
19552
+ canEdit: true
19553
+ };
19554
+ }
19555
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$typeMap$type$g = order[typeMap$2[type].goodDetailsKey]) === null || _order$typeMap$type$g === void 0 ? void 0 : _order$typeMap$type$g.length) ? typeMap$2[type].mergeIdenticalGoods ? typeMap$2[type].mergeIdenticalGoods((_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.updateGoodsHandle([order], orderRest)) : (_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.updateGoodsHandle([order], orderRest) : [];
19388
19556
  var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
19389
- return mode ? goodDetails.filter(function (goodItem) {
19557
+ var list = mode ? goodDetails.filter(function (goodItem) {
19390
19558
  return !orderNo || goodItem[typeMap$2[type].outerOiIdKey] === orderNo;
19391
19559
  }) : goodDetails;
19560
+ return list;
19392
19561
  };
19393
19562
  var changeGoodHandle = function changeGoodHandle(val) {
19394
- var _typeMap$type20;
19563
+ var _typeMap$type21;
19395
19564
  var newValue = _objectSpread2({}, value);
19396
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = val || [];
19565
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.key)] = val || [];
19397
19566
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19398
19567
  };
19399
19568
  var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
19400
- var _typeMap$type21, _typeMap$type22, _value$typeMap$type$t2, _typeMap$type27, _value$typeMap$type$t3, _typeMap$type29;
19569
+ var _typeMap$type22, _typeMap$type23, _value$typeMap$type$t2, _typeMap$type28, _value$typeMap$type$t3, _typeMap$type30;
19401
19570
  var newValue = _objectSpread2({}, value);
19402
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo)] = val;
19403
- if (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.systemOrderBillType) {
19404
- var _value$typeMap$type$s5, _typeMap$type23, _typeMap$type25, _typeMap$type26;
19405
- var orders = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.orders) || [];
19571
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.systemOrderNo)] = val;
19572
+ if (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrderBillType) {
19573
+ var _value$typeMap$type$s5, _typeMap$type24, _typeMap$type26, _typeMap$type27;
19574
+ var orders = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.orders) || [];
19406
19575
  var targetOrder = val && orders.find(function (oItem) {
19407
- var _typeMap$type24;
19408
- return oItem[(_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.oIdKey] === val;
19576
+ var _typeMap$type25;
19577
+ return oItem[(_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.oIdKey] === val;
19409
19578
  });
19410
- newValue[(_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderBillType] = targetOrder === null || targetOrder === void 0 ? void 0 : targetOrder[(_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.orderTypeKey];
19411
- }
19412
- if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
19413
- var _typeMap$type28;
19414
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type28 = typeMap$2[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.key)] = [];
19415
- } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type29 = typeMap$2[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
19416
- var _typeMap$type30;
19417
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type30 = typeMap$2[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.key)] = getGoodDetails({
19579
+ newValue[(_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrderBillType] = targetOrder === null || targetOrder === void 0 ? void 0 : targetOrder[(_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.orderTypeKey];
19580
+ }
19581
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type28 = typeMap$2[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
19582
+ var _typeMap$type29;
19583
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type29 = typeMap$2[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)] = [];
19584
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type30 = typeMap$2[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
19585
+ var _typeMap$type31;
19586
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type31 = typeMap$2[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.key)] = getGoodDetails({
19418
19587
  mode: isStrict,
19419
19588
  sysOrderNo: val
19420
19589
  });
@@ -19422,25 +19591,26 @@ var PublicReissue = function PublicReissue(props) {
19422
19591
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19423
19592
  };
19424
19593
  //显示选择商品按钮
19425
- var showChangeBtn = !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type31 = typeMap$2[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.systemOrderNo]);
19594
+ var showChangeBtn = !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type32 = typeMap$2[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.systemOrderNo]);
19426
19595
  var selectedGoodsChange = useCallback(function (skuList) {
19427
- var _typeMap$type32, _typeMap$type33, _uniqBy;
19596
+ var _typeMap$type33, _typeMap$type34, _uniqBy, _typeMap$type35;
19428
19597
  var newValue = _objectSpread2({}, value);
19429
19598
  // 原订单商品
19430
19599
  var originTradeGoodList = getGoodDetails({
19431
19600
  mode: isStrict
19432
19601
  }) || [];
19433
19602
  // 当前选中的所有商品【包含了原订单+商品库】
19434
- var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type32 = typeMap$2[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)]) || [];
19435
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type33 = typeMap$2[type]) === null || _typeMap$type33 === void 0 ? void 0 : _typeMap$type33.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
19436
- return skuList.includes(item.uuid);
19603
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type33 = typeMap$2[type]) === null || _typeMap$type33 === void 0 ? void 0 : _typeMap$type33.key)]) || [];
19604
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type34 = typeMap$2[type]) === null || _typeMap$type34 === void 0 ? void 0 : _typeMap$type34.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type35 = typeMap$2[type]) === null || _typeMap$type35 === void 0 ? void 0 : _typeMap$type35.uniqueKey) || 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
19605
+ var _typeMap$type36;
19606
+ return skuList.includes(item[typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type36 = typeMap$2[type]) === null || _typeMap$type36 === void 0 ? void 0 : _typeMap$type36.uniqueKey]);
19437
19607
  });
19438
19608
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19439
- }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type34 = typeMap$2[type]) === null || _typeMap$type34 === void 0 ? void 0 : _typeMap$type34.key)], isStrict]);
19609
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type37 = typeMap$2[type]) === null || _typeMap$type37 === void 0 ? void 0 : _typeMap$type37.key)], isStrict]);
19440
19610
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
19441
19611
  gutter: 8,
19442
19612
  wrap: true,
19443
- id: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type35 = typeMap$2[type]) === null || _typeMap$type35 === void 0 ? void 0 : _typeMap$type35.key) || "".concat(Date.now())
19613
+ id: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type38 = typeMap$2[type]) === null || _typeMap$type38 === void 0 ? void 0 : _typeMap$type38.key) || "".concat(Date.now())
19444
19614
  }, /*#__PURE__*/React.createElement(Col, {
19445
19615
  className: "gutter-row",
19446
19616
  xs: {
@@ -19456,12 +19626,12 @@ var PublicReissue = function PublicReissue(props) {
19456
19626
  },
19457
19627
  disabled: disabled,
19458
19628
  allowClear: false,
19459
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type36 = typeMap$2[type]) === null || _typeMap$type36 === void 0 ? void 0 : _typeMap$type36.systemOrderNo)],
19629
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type39 = typeMap$2[type]) === null || _typeMap$type39 === void 0 ? void 0 : _typeMap$type39.systemOrderNo)],
19460
19630
  onChange: function onChange(val) {
19461
19631
  return changeSystemOrderHandle(val);
19462
19632
  },
19463
- placeholder: "\u9009\u62E9".concat((typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type37 = typeMap$2[type]) === null || _typeMap$type37 === void 0 ? void 0 : _typeMap$type37.compType) || '', "\u7CFB\u7EDF\u5355")
19464
- }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s6 = value[(_typeMap$type38 = typeMap$2[type]) === null || _typeMap$type38 === void 0 ? void 0 : _typeMap$type38.systemOrder]) === null || _value$typeMap$type$s6 === void 0 ? void 0 : _value$typeMap$type$s6.showOrderInfo) || []).map(function (item) {
19633
+ placeholder: "\u9009\u62E9".concat((typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type40 = typeMap$2[type]) === null || _typeMap$type40 === void 0 ? void 0 : _typeMap$type40.compType) || '', "\u7CFB\u7EDF\u5355")
19634
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s6 = value[(_typeMap$type41 = typeMap$2[type]) === null || _typeMap$type41 === void 0 ? void 0 : _typeMap$type41.systemOrder]) === null || _value$typeMap$type$s6 === void 0 ? void 0 : _value$typeMap$type$s6.showOrderInfo) || []).map(function (item) {
19465
19635
  return /*#__PURE__*/React.createElement(Select.Option, {
19466
19636
  key: item[typeMap$2[type].oIdKey],
19467
19637
  value: item[typeMap$2[type].oIdKey],
@@ -19483,11 +19653,11 @@ var PublicReissue = function PublicReissue(props) {
19483
19653
  disabled: isSettingConfig ? !isSettingConfig : disabled,
19484
19654
  allowClear: false,
19485
19655
  options: reasonList,
19486
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type39 = typeMap$2[type]) === null || _typeMap$type39 === void 0 ? void 0 : _typeMap$type39.typeName)],
19656
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type42 = typeMap$2[type]) === null || _typeMap$type42 === void 0 ? void 0 : _typeMap$type42.typeName)],
19487
19657
  onChange: function onChange(val) {
19488
19658
  return changeTypeHandle(val);
19489
19659
  }
19490
- })), (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type40 = typeMap$2[type]) === null || _typeMap$type40 === void 0 ? void 0 : _typeMap$type40.systemOrderBillType) && !isSettingConfig && /*#__PURE__*/React.createElement(Col, {
19660
+ })), (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type43 = typeMap$2[type]) === null || _typeMap$type43 === void 0 ? void 0 : _typeMap$type43.systemOrderBillType) && !isSettingConfig && /*#__PURE__*/React.createElement(Col, {
19491
19661
  className: "gutter-row",
19492
19662
  xs: {
19493
19663
  span: 11
@@ -19496,7 +19666,7 @@ var PublicReissue = function PublicReissue(props) {
19496
19666
  span: 6
19497
19667
  }
19498
19668
  }, /*#__PURE__*/React.createElement(Input, {
19499
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type41 = typeMap$2[type]) === null || _typeMap$type41 === void 0 ? void 0 : _typeMap$type41.systemOrderBillType)],
19669
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type44 = typeMap$2[type]) === null || _typeMap$type44 === void 0 ? void 0 : _typeMap$type44.systemOrderBillType)],
19500
19670
  disabled: disabled,
19501
19671
  readOnly: true
19502
19672
  }))), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
@@ -19506,10 +19676,10 @@ var PublicReissue = function PublicReissue(props) {
19506
19676
  disabled: disabled,
19507
19677
  canUpdateNumber: showChangeBtn,
19508
19678
  showChangeBtn: showChangeBtn,
19509
- alwaysShowChooseErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type42 = typeMap$2[type]) === null || _typeMap$type42 === void 0 ? void 0 : _typeMap$type42.alwaysShowChooseErpGoodsBtn,
19510
- showErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type43 = typeMap$2[type]) === null || _typeMap$type43 === void 0 ? void 0 : _typeMap$type43.showErpGoodsBtn,
19679
+ alwaysShowChooseErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type45 = typeMap$2[type]) === null || _typeMap$type45 === void 0 ? void 0 : _typeMap$type45.alwaysShowChooseErpGoodsBtn,
19680
+ showErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type46 = typeMap$2[type]) === null || _typeMap$type46 === void 0 ? void 0 : _typeMap$type46.showErpGoodsBtn,
19511
19681
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
19512
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type44 = typeMap$2[type]) === null || _typeMap$type44 === void 0 ? void 0 : _typeMap$type44.key)],
19682
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type47 = typeMap$2[type]) === null || _typeMap$type47 === void 0 ? void 0 : _typeMap$type47.key)],
19513
19683
  onChange: function onChange(val) {
19514
19684
  return changeGoodHandle(val);
19515
19685
  },
@@ -19520,6 +19690,7 @@ var PublicReissue = function PublicReissue(props) {
19520
19690
  originDataSource: getGoodDetails({
19521
19691
  mode: isStrict
19522
19692
  }),
19693
+ uniqueKey: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type48 = typeMap$2[type]) === null || _typeMap$type48 === void 0 ? void 0 : _typeMap$type48.uniqueKey) || 'uuid',
19523
19694
  selectedGoodsChange: selectedGoodsChange
19524
19695
  }
19525
19696
  })));
package/dist/index.js CHANGED
@@ -16076,6 +16076,15 @@ var getColumns$5 = function getColumns() {
16076
16076
  };
16077
16077
  };
16078
16078
 
16079
+ function toNum$2(value) {
16080
+ if (typeof value === 'string') {
16081
+ return value ? +value : void 0;
16082
+ }
16083
+ if (typeof value === 'number') {
16084
+ return value;
16085
+ }
16086
+ return void 0;
16087
+ }
16079
16088
  var getColumns$6 = function getColumns(_ref) {
16080
16089
  var _ref$text = _ref.text,
16081
16090
  disabled = _ref.disabled,
@@ -16170,6 +16179,126 @@ var getColumns$6 = function getColumns(_ref) {
16170
16179
  align: 'center',
16171
16180
  ellipsis: true
16172
16181
  });
16182
+ }),
16183
+ KM_REISSUE_GOODS: [{
16184
+ dataIndex: 'sysSkuPropertiesName',
16185
+ title: "\u89C4\u683C\u540D\u79F0",
16186
+ width: 250
16187
+ }, {
16188
+ dataIndex: 'sysTitle',
16189
+ title: "\u7CFB\u7EDF\u5546\u54C1\u540D\u79F0",
16190
+ width: 150
16191
+ }, {
16192
+ dataIndex: 'shortTitle',
16193
+ title: "\u5546\u54C1\u7B80\u79F0",
16194
+ width: 150
16195
+ }, {
16196
+ dataIndex: 'title',
16197
+ title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
16198
+ width: 150
16199
+ }, {
16200
+ dataIndex: 'outerId',
16201
+ title: "\u5546\u5BB6\u7F16\u7801",
16202
+ width: 150
16203
+ }, {
16204
+ dataIndex: 'sysOuterId',
16205
+ title: "\u7CFB\u7EDF\u5546\u5BB6\u7F16\u7801",
16206
+ width: 150
16207
+ }, {
16208
+ dataIndex: 'itemSysId',
16209
+ title: "\u7CFB\u7EDF\u5546\u54C1ID",
16210
+ width: 150
16211
+ }, {
16212
+ dataIndex: 'skuSysId',
16213
+ title: "\u7CFB\u7EDF\u89C4\u683CID",
16214
+ width: 150
16215
+ }, {
16216
+ dataIndex: 'realNum',
16217
+ title: "\u5B9E\u9645\u8865\u53D1\u6570\u91CF",
16218
+ width: 100,
16219
+ validator: function validator(_rule, value) {
16220
+ var title = '';
16221
+ if (((value === null || value === void 0 ? void 0 : value.kmReissueGoods) || []).some(function (goods) {
16222
+ var realNum = toNum$2(goods === null || goods === void 0 ? void 0 : goods.realNum);
16223
+ var res = typeof realNum === 'number' ? realNum < 1 : true;
16224
+ if (res) {
16225
+ title = (goods === null || goods === void 0 ? void 0 : goods.goodName) ? "[".concat(goods === null || goods === void 0 ? void 0 : goods.goodName, "]") : '';
16226
+ }
16227
+ return res;
16228
+ })) {
16229
+ return Promise.reject("".concat(title, "\u5B9E\u9645\u8865\u53D1\u6570\u91CF\u5FC5\u987B\u5927\u4E8E0"));
16230
+ }
16231
+ },
16232
+ render: function render(val, record, index) {
16233
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
16234
+ style: {
16235
+ width: 70
16236
+ },
16237
+ value: val,
16238
+ min: 1,
16239
+ precision: 0,
16240
+ onChange: function onChange(num) {
16241
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'realNum');
16242
+ }
16243
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
16244
+ }
16245
+ }, {
16246
+ dataIndex: 'desiredNum',
16247
+ title: "\u5E94\u8865\u53D1\u6570\u91CF",
16248
+ width: 100,
16249
+ render: function render(val, record, index) {
16250
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
16251
+ style: {
16252
+ width: 70
16253
+ },
16254
+ value: val,
16255
+ min: 1,
16256
+ precision: 0,
16257
+ onChange: function onChange(num) {
16258
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'desiredNum');
16259
+ }
16260
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
16261
+ }
16262
+ }, {
16263
+ dataIndex: 'price',
16264
+ title: "\u5546\u54C1\u9500\u552E\u4EF7",
16265
+ width: 150
16266
+ }, {
16267
+ dataIndex: 'payment',
16268
+ title: "\u5B9E\u4ED8\u91D1\u989D",
16269
+ width: 150,
16270
+ render: function render(val, record, index) {
16271
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
16272
+ style: {
16273
+ width: 130
16274
+ },
16275
+ value: val,
16276
+ min: 0,
16277
+ precision: 2,
16278
+ onChange: function onChange(num) {
16279
+ return updateHandle === null || updateHandle === void 0 ? void 0 : updateHandle(num, index, 'payment');
16280
+ }
16281
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
16282
+ }
16283
+ }, {
16284
+ dataIndex: 'type',
16285
+ title: "\u5546\u54C1\u7C7B\u578B",
16286
+ width: 150
16287
+ }, {
16288
+ dataIndex: 'sysPicPath',
16289
+ title: "\u5546\u54C1\u56FE\u7247",
16290
+ width: 100,
16291
+ render: function render(val) {
16292
+ return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
16293
+ width: 60,
16294
+ src: val
16295
+ });
16296
+ }
16297
+ }].map(function (item) {
16298
+ return _objectSpread2(_objectSpread2({}, item), {}, {
16299
+ align: 'center',
16300
+ ellipsis: true
16301
+ });
16173
16302
  })
16174
16303
  };
16175
16304
  };
@@ -16483,7 +16612,7 @@ var isErpType = {
16483
16612
  return ['JST_GOODS', 'JST_REISSUE_GOODS', 'JST_RETURN_GOODS', 'JST_EXCHANGE_GOODS'].includes(type);
16484
16613
  },
16485
16614
  isKm: function isKm(type) {
16486
- return ['KM_GOODS'].includes(type);
16615
+ return ['KM_GOODS', 'KM_REISSUE_GOODS'].includes(type);
16487
16616
  }
16488
16617
  };
16489
16618
  var processGoods = function processGoods(_ref) {
@@ -16634,7 +16763,17 @@ var processJstGoods = function processJstGoods(_ref5) {
16634
16763
  });
16635
16764
  };
16636
16765
  var processKmGoods = function processKmGoods(_ref6) {
16637
- var list = _ref6.list;
16766
+ var list = _ref6.list,
16767
+ type = _ref6.type;
16768
+ var initParamsMap = {
16769
+ KM_GOODS: {
16770
+ num: 1
16771
+ },
16772
+ KM_REISSUE_GOODS: {
16773
+ realNum: 1,
16774
+ desiredNum: 1
16775
+ }
16776
+ };
16638
16777
  return list.map(function (item) {
16639
16778
  return _objectSpread2(_objectSpread2({}, item), {}, {
16640
16779
  sysSkuPropertiesName: item.specName,
@@ -16651,9 +16790,8 @@ var processKmGoods = function processKmGoods(_ref6) {
16651
16790
  type: null,
16652
16791
  uuid: kmkfUtils.uuid(),
16653
16792
  canDelete: true,
16654
- canEdit: true,
16655
- num: 1
16656
- });
16793
+ canEdit: true
16794
+ }, initParamsMap[type] || {});
16657
16795
  });
16658
16796
  };
16659
16797
  var processDefaultGoods = function processDefaultGoods(_ref7) {
@@ -16700,6 +16838,7 @@ var GoodsModalMap = {
16700
16838
  JST_RETURN_GOODS: JstGoodsModal,
16701
16839
  JST_EXCHANGE_GOODS: JstGoodsModal,
16702
16840
  KM_GOODS: KmGoodsModal,
16841
+ KM_REISSUE_GOODS: KmGoodsModal,
16703
16842
  OTHER_GOODS: GoodsModal$2
16704
16843
  };
16705
16844
  var SelectTradeGoods = function SelectTradeGoods(_ref) {
@@ -16762,7 +16901,7 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
16762
16901
  };
16763
16902
  var getButtonText = function getButtonText() {
16764
16903
  var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
16765
- if (['KM_GOODS'].includes(type)) {
16904
+ if (['KM_GOODS', 'KM_REISSUE_GOODS'].includes(type)) {
16766
16905
  return '选择快麦ERP商品';
16767
16906
  }
16768
16907
  if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
@@ -16909,6 +17048,7 @@ var GoodItem$1 = function GoodItem(props) {
16909
17048
  case 'GY_REISSUE_GOODS':
16910
17049
  case 'GY_RETURN_GOODS':
16911
17050
  case 'KM_GOODS':
17051
+ case 'KM_REISSUE_GOODS':
16912
17052
  {
16913
17053
  columns = getColumnsMap$1({
16914
17054
  text: text,
@@ -19248,7 +19388,9 @@ var typeMap$2 = {
19248
19388
  orderTypeKey: 'orderType',
19249
19389
  oIdKey: 'oId',
19250
19390
  outerOiIdKey: '',
19251
- goodDetailsKey: 'items'
19391
+ goodDetailsKey: 'items',
19392
+ mergeIdenticalGoods: kmkfUtils.jstMergeIdenticalGoods,
19393
+ uniqueKey: 'uuid'
19252
19394
  },
19253
19395
  JST_RETURN_GOODS: {
19254
19396
  compType: '退货',
@@ -19264,6 +19406,8 @@ var typeMap$2 = {
19264
19406
  oIdKey: 'oId',
19265
19407
  outerOiIdKey: '',
19266
19408
  goodDetailsKey: 'items',
19409
+ mergeIdenticalGoods: kmkfUtils.jstMergeIdenticalGoods,
19410
+ uniqueKey: 'uuid',
19267
19411
  eventNameMap: {
19268
19412
  // pubsub 事件
19269
19413
  exchangeCopyGood: 'jstExchangeCopyGood',
@@ -19271,10 +19415,25 @@ var typeMap$2 = {
19271
19415
  returnGoodsSysorder: 'jstReturnGoodsSysorder',
19272
19416
  returnGoodsSysorderBack: 'jstReturnGoodsSysorderBack'
19273
19417
  }
19418
+ },
19419
+ KM_REISSUE_GOODS: {
19420
+ compType: '补发',
19421
+ key: 'kmReissueGoods',
19422
+ typeName: 'kmReissueType',
19423
+ systemOrder: 'kmSystemOrder',
19424
+ systemOrderNo: 'kmSystemOrderNo',
19425
+ getOrderList: kmUtils.getOrderListSingleton,
19426
+ updateGoodsHandle: kmkfUtils.updateKmGoodsHandle,
19427
+ alwaysShowChooseErpGoodsBtn: true,
19428
+ orderTypeKey: 'orderType',
19429
+ oIdKey: 'billNo',
19430
+ outerOiIdKey: '',
19431
+ goodDetailsKey: 'subOrders',
19432
+ uniqueKey: 'id'
19274
19433
  }
19275
19434
  };
19276
19435
  var PublicReissue = function PublicReissue(props) {
19277
- var _typeMap$type31, _typeMap$type34, _typeMap$type35, _typeMap$type36, _typeMap$type37, _value$typeMap$type$s6, _typeMap$type38, _typeMap$type39, _typeMap$type40, _typeMap$type41, _typeMap$type42, _typeMap$type43, _typeMap$type44;
19436
+ var _typeMap$type32, _typeMap$type37, _typeMap$type38, _typeMap$type39, _typeMap$type40, _value$typeMap$type$s6, _typeMap$type41, _typeMap$type42, _typeMap$type43, _typeMap$type44, _typeMap$type45, _typeMap$type46, _typeMap$type47, _typeMap$type48;
19278
19437
  var value = props.value,
19279
19438
  onChange = props.onChange,
19280
19439
  _props$reasonList = props.reasonList,
@@ -19388,7 +19547,7 @@ var PublicReissue = function PublicReissue(props) {
19388
19547
  }))));
19389
19548
  };
19390
19549
  var getGoodDetails = function getGoodDetails(_ref4) {
19391
- var _typeMap$type17, _typeMap$type18, _order$typeMap$type$g, _typeMap$type19;
19550
+ var _typeMap$type17, _typeMap$type18, _order$typeMap$type$g, _typeMap$type19, _typeMap$type20;
19392
19551
  var mode = _ref4.mode,
19393
19552
  sysOrderNo = _ref4.sysOrderNo;
19394
19553
  var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type17 = typeMap$2[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.systemOrder];
@@ -19396,37 +19555,47 @@ var PublicReissue = function PublicReissue(props) {
19396
19555
  var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
19397
19556
  return order[typeMap$2[type].oIdKey] === systemOrderNo;
19398
19557
  });
19399
- var goodDetails = kmkfUtils.jstMergeIdenticalGoods((order === null || order === void 0 ? void 0 : (_order$typeMap$type$g = order[typeMap$2[type].goodDetailsKey]) === null || _order$typeMap$type$g === void 0 ? void 0 : _order$typeMap$type$g.length) ? (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.updateGoodsHandle([order], true) : []);
19558
+ var orderRest = undefined;
19559
+ if (['JST_REISSUE_GOODS', 'JST_RETURN_GOODS'].includes(type)) {
19560
+ orderRest = true;
19561
+ } else if (type === 'KM_REISSUE_GOODS') {
19562
+ orderRest = {
19563
+ orderBackGoodsLevel: props.orderBackGoodsLevel,
19564
+ canEdit: true
19565
+ };
19566
+ }
19567
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$typeMap$type$g = order[typeMap$2[type].goodDetailsKey]) === null || _order$typeMap$type$g === void 0 ? void 0 : _order$typeMap$type$g.length) ? typeMap$2[type].mergeIdenticalGoods ? typeMap$2[type].mergeIdenticalGoods((_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.updateGoodsHandle([order], orderRest)) : (_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.updateGoodsHandle([order], orderRest) : [];
19400
19568
  var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
19401
- return mode ? goodDetails.filter(function (goodItem) {
19569
+ var list = mode ? goodDetails.filter(function (goodItem) {
19402
19570
  return !orderNo || goodItem[typeMap$2[type].outerOiIdKey] === orderNo;
19403
19571
  }) : goodDetails;
19572
+ return list;
19404
19573
  };
19405
19574
  var changeGoodHandle = function changeGoodHandle(val) {
19406
- var _typeMap$type20;
19575
+ var _typeMap$type21;
19407
19576
  var newValue = _objectSpread2({}, value);
19408
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = val || [];
19577
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.key)] = val || [];
19409
19578
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19410
19579
  };
19411
19580
  var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
19412
- var _typeMap$type21, _typeMap$type22, _value$typeMap$type$t2, _typeMap$type27, _value$typeMap$type$t3, _typeMap$type29;
19581
+ var _typeMap$type22, _typeMap$type23, _value$typeMap$type$t2, _typeMap$type28, _value$typeMap$type$t3, _typeMap$type30;
19413
19582
  var newValue = _objectSpread2({}, value);
19414
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo)] = val;
19415
- if (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.systemOrderBillType) {
19416
- var _value$typeMap$type$s5, _typeMap$type23, _typeMap$type25, _typeMap$type26;
19417
- var orders = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.orders) || [];
19583
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.systemOrderNo)] = val;
19584
+ if (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrderBillType) {
19585
+ var _value$typeMap$type$s5, _typeMap$type24, _typeMap$type26, _typeMap$type27;
19586
+ var orders = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.orders) || [];
19418
19587
  var targetOrder = val && orders.find(function (oItem) {
19419
- var _typeMap$type24;
19420
- return oItem[(_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.oIdKey] === val;
19588
+ var _typeMap$type25;
19589
+ return oItem[(_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.oIdKey] === val;
19421
19590
  });
19422
- newValue[(_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderBillType] = targetOrder === null || targetOrder === void 0 ? void 0 : targetOrder[(_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.orderTypeKey];
19423
- }
19424
- if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
19425
- var _typeMap$type28;
19426
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type28 = typeMap$2[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.key)] = [];
19427
- } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type29 = typeMap$2[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
19428
- var _typeMap$type30;
19429
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type30 = typeMap$2[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.key)] = getGoodDetails({
19591
+ newValue[(_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrderBillType] = targetOrder === null || targetOrder === void 0 ? void 0 : targetOrder[(_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.orderTypeKey];
19592
+ }
19593
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type28 = typeMap$2[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
19594
+ var _typeMap$type29;
19595
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type29 = typeMap$2[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)] = [];
19596
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type30 = typeMap$2[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
19597
+ var _typeMap$type31;
19598
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type31 = typeMap$2[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.key)] = getGoodDetails({
19430
19599
  mode: isStrict,
19431
19600
  sysOrderNo: val
19432
19601
  });
@@ -19434,25 +19603,26 @@ var PublicReissue = function PublicReissue(props) {
19434
19603
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19435
19604
  };
19436
19605
  //显示选择商品按钮
19437
- var showChangeBtn = !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type31 = typeMap$2[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.systemOrderNo]);
19606
+ var showChangeBtn = !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type32 = typeMap$2[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.systemOrderNo]);
19438
19607
  var selectedGoodsChange = React.useCallback(function (skuList) {
19439
- var _typeMap$type32, _typeMap$type33, _uniqBy;
19608
+ var _typeMap$type33, _typeMap$type34, _uniqBy, _typeMap$type35;
19440
19609
  var newValue = _objectSpread2({}, value);
19441
19610
  // 原订单商品
19442
19611
  var originTradeGoodList = getGoodDetails({
19443
19612
  mode: isStrict
19444
19613
  }) || [];
19445
19614
  // 当前选中的所有商品【包含了原订单+商品库】
19446
- var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type32 = typeMap$2[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)]) || [];
19447
- newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type33 = typeMap$2[type]) === null || _typeMap$type33 === void 0 ? void 0 : _typeMap$type33.key)] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
19448
- return skuList.includes(item.uuid);
19615
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type33 = typeMap$2[type]) === null || _typeMap$type33 === void 0 ? void 0 : _typeMap$type33.key)]) || [];
19616
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type34 = typeMap$2[type]) === null || _typeMap$type34 === void 0 ? void 0 : _typeMap$type34.key)] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type35 = typeMap$2[type]) === null || _typeMap$type35 === void 0 ? void 0 : _typeMap$type35.uniqueKey) || 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
19617
+ var _typeMap$type36;
19618
+ return skuList.includes(item[typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type36 = typeMap$2[type]) === null || _typeMap$type36 === void 0 ? void 0 : _typeMap$type36.uniqueKey]);
19449
19619
  });
19450
19620
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19451
- }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type34 = typeMap$2[type]) === null || _typeMap$type34 === void 0 ? void 0 : _typeMap$type34.key)], isStrict]);
19621
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type37 = typeMap$2[type]) === null || _typeMap$type37 === void 0 ? void 0 : _typeMap$type37.key)], isStrict]);
19452
19622
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
19453
19623
  gutter: 8,
19454
19624
  wrap: true,
19455
- id: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type35 = typeMap$2[type]) === null || _typeMap$type35 === void 0 ? void 0 : _typeMap$type35.key) || "".concat(Date.now())
19625
+ id: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type38 = typeMap$2[type]) === null || _typeMap$type38 === void 0 ? void 0 : _typeMap$type38.key) || "".concat(Date.now())
19456
19626
  }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
19457
19627
  className: "gutter-row",
19458
19628
  xs: {
@@ -19468,12 +19638,12 @@ var PublicReissue = function PublicReissue(props) {
19468
19638
  },
19469
19639
  disabled: disabled,
19470
19640
  allowClear: false,
19471
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type36 = typeMap$2[type]) === null || _typeMap$type36 === void 0 ? void 0 : _typeMap$type36.systemOrderNo)],
19641
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type39 = typeMap$2[type]) === null || _typeMap$type39 === void 0 ? void 0 : _typeMap$type39.systemOrderNo)],
19472
19642
  onChange: function onChange(val) {
19473
19643
  return changeSystemOrderHandle(val);
19474
19644
  },
19475
- placeholder: "\u9009\u62E9".concat((typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type37 = typeMap$2[type]) === null || _typeMap$type37 === void 0 ? void 0 : _typeMap$type37.compType) || '', "\u7CFB\u7EDF\u5355")
19476
- }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s6 = value[(_typeMap$type38 = typeMap$2[type]) === null || _typeMap$type38 === void 0 ? void 0 : _typeMap$type38.systemOrder]) === null || _value$typeMap$type$s6 === void 0 ? void 0 : _value$typeMap$type$s6.showOrderInfo) || []).map(function (item) {
19645
+ placeholder: "\u9009\u62E9".concat((typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type40 = typeMap$2[type]) === null || _typeMap$type40 === void 0 ? void 0 : _typeMap$type40.compType) || '', "\u7CFB\u7EDF\u5355")
19646
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s6 = value[(_typeMap$type41 = typeMap$2[type]) === null || _typeMap$type41 === void 0 ? void 0 : _typeMap$type41.systemOrder]) === null || _value$typeMap$type$s6 === void 0 ? void 0 : _value$typeMap$type$s6.showOrderInfo) || []).map(function (item) {
19477
19647
  return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
19478
19648
  key: item[typeMap$2[type].oIdKey],
19479
19649
  value: item[typeMap$2[type].oIdKey],
@@ -19495,11 +19665,11 @@ var PublicReissue = function PublicReissue(props) {
19495
19665
  disabled: isSettingConfig ? !isSettingConfig : disabled,
19496
19666
  allowClear: false,
19497
19667
  options: reasonList,
19498
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type39 = typeMap$2[type]) === null || _typeMap$type39 === void 0 ? void 0 : _typeMap$type39.typeName)],
19668
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type42 = typeMap$2[type]) === null || _typeMap$type42 === void 0 ? void 0 : _typeMap$type42.typeName)],
19499
19669
  onChange: function onChange(val) {
19500
19670
  return changeTypeHandle(val);
19501
19671
  }
19502
- })), (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type40 = typeMap$2[type]) === null || _typeMap$type40 === void 0 ? void 0 : _typeMap$type40.systemOrderBillType) && !isSettingConfig && /*#__PURE__*/React__default['default'].createElement(antd.Col, {
19672
+ })), (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type43 = typeMap$2[type]) === null || _typeMap$type43 === void 0 ? void 0 : _typeMap$type43.systemOrderBillType) && !isSettingConfig && /*#__PURE__*/React__default['default'].createElement(antd.Col, {
19503
19673
  className: "gutter-row",
19504
19674
  xs: {
19505
19675
  span: 11
@@ -19508,7 +19678,7 @@ var PublicReissue = function PublicReissue(props) {
19508
19678
  span: 6
19509
19679
  }
19510
19680
  }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
19511
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type41 = typeMap$2[type]) === null || _typeMap$type41 === void 0 ? void 0 : _typeMap$type41.systemOrderBillType)],
19681
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type44 = typeMap$2[type]) === null || _typeMap$type44 === void 0 ? void 0 : _typeMap$type44.systemOrderBillType)],
19512
19682
  disabled: disabled,
19513
19683
  readOnly: true
19514
19684
  }))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
@@ -19518,10 +19688,10 @@ var PublicReissue = function PublicReissue(props) {
19518
19688
  disabled: disabled,
19519
19689
  canUpdateNumber: showChangeBtn,
19520
19690
  showChangeBtn: showChangeBtn,
19521
- alwaysShowChooseErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type42 = typeMap$2[type]) === null || _typeMap$type42 === void 0 ? void 0 : _typeMap$type42.alwaysShowChooseErpGoodsBtn,
19522
- showErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type43 = typeMap$2[type]) === null || _typeMap$type43 === void 0 ? void 0 : _typeMap$type43.showErpGoodsBtn,
19691
+ alwaysShowChooseErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type45 = typeMap$2[type]) === null || _typeMap$type45 === void 0 ? void 0 : _typeMap$type45.alwaysShowChooseErpGoodsBtn,
19692
+ showErpGoodsBtn: typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type46 = typeMap$2[type]) === null || _typeMap$type46 === void 0 ? void 0 : _typeMap$type46.showErpGoodsBtn,
19523
19693
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
19524
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type44 = typeMap$2[type]) === null || _typeMap$type44 === void 0 ? void 0 : _typeMap$type44.key)],
19694
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type47 = typeMap$2[type]) === null || _typeMap$type47 === void 0 ? void 0 : _typeMap$type47.key)],
19525
19695
  onChange: function onChange(val) {
19526
19696
  return changeGoodHandle(val);
19527
19697
  },
@@ -19532,6 +19702,7 @@ var PublicReissue = function PublicReissue(props) {
19532
19702
  originDataSource: getGoodDetails({
19533
19703
  mode: isStrict
19534
19704
  }),
19705
+ uniqueKey: (typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type48 = typeMap$2[type]) === null || _typeMap$type48 === void 0 ? void 0 : _typeMap$type48.uniqueKey) || 'uuid',
19535
19706
  selectedGoodsChange: selectedGoodsChange
19536
19707
  }
19537
19708
  })));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.0.54-beta.36",
3
+ "version": "2.0.54-beta.39",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.34",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.39",
24
24
  "ahooks": "^3.7.4",
25
25
  "bignumber.js": "^9.1.2",
26
26
  "kmkf-monitor": "^0.8.9",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "07e9d14d1b0839423e6558c8ed41cc1a5d47fd90"
68
+ "gitHead": "49b0b68362eefefcdab0ee03d4e181bc37d248cb"
69
69
  }