@kmkf-fe-packages/basic-components 0.8.17-alpha.9 → 0.8.17

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
@@ -7274,15 +7274,20 @@ var ParseLogistics = function ParseLogistics(props) {
7274
7274
  _useState2 = _slicedToArray(_useState, 2),
7275
7275
  value = _useState2[0],
7276
7276
  setValue = _useState2[1];
7277
- var handleIdentify = function handleIdentify() {
7278
- if (!value) {
7277
+ var _useState3 = useState(false),
7278
+ _useState4 = _slicedToArray(_useState3, 2),
7279
+ isCopy = _useState4[0],
7280
+ setIsCopy = _useState4[1];
7281
+ var handleIdentify = function handleIdentify(val) {
7282
+ if (!value && !val) {
7279
7283
  return;
7280
7284
  }
7285
+ setIsCopy(false);
7281
7286
  request$1({
7282
7287
  url: '/qy/logistics/addressAnalysis',
7283
7288
  method: 'post',
7284
7289
  data: {
7285
- fullAddress: value
7290
+ fullAddress: value || val
7286
7291
  }
7287
7292
  }).then(function (res) {
7288
7293
  var data = res.data;
@@ -7291,17 +7296,33 @@ var ParseLogistics = function ParseLogistics(props) {
7291
7296
  console.log(e);
7292
7297
  });
7293
7298
  };
7299
+ var _onKeyDown = function onKeyDown(e) {
7300
+ if (e.keyCode === 86) {
7301
+ setIsCopy(true);
7302
+ }
7303
+ };
7304
+ var onChangeValue = function onChangeValue(val) {
7305
+ setValue(val);
7306
+ if (isCopy) {
7307
+ handleIdentify(val);
7308
+ }
7309
+ };
7294
7310
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextArea, {
7295
7311
  placeholder: "\u590D\u5236\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
7296
7312
  rows: 3,
7297
7313
  value: value,
7298
7314
  onChange: function onChange(e) {
7299
- return setValue(e.target.value);
7315
+ return onChangeValue(e.target.value);
7316
+ },
7317
+ onKeyDown: function onKeyDown(e) {
7318
+ return _onKeyDown(e);
7300
7319
  }
7301
7320
  }), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Button, {
7302
7321
  size: "small",
7303
7322
  type: "primary",
7304
- onClick: handleIdentify
7323
+ onClick: function onClick() {
7324
+ return handleIdentify('');
7325
+ }
7305
7326
  }, "\u667A\u80FD\u8BC6\u522B"), /*#__PURE__*/React.createElement(Button, {
7306
7327
  size: "small",
7307
7328
  onClick: function onClick() {
@@ -9580,10 +9601,9 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9580
9601
  };
9581
9602
 
9582
9603
  var jstGoods = function jstGoods(props) {
9583
- var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6;
9604
+ var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
9584
9605
  var _props$value = props.value,
9585
9606
  value = _props$value === void 0 ? [] : _props$value,
9586
- _props$options = props.options,
9587
9607
  onChange = props.onChange,
9588
9608
  disabled = props.disabled,
9589
9609
  _props$type = props.type,
@@ -9596,7 +9616,7 @@ var jstGoods = function jstGoods(props) {
9596
9616
  setChangeIndex = _useState2[1]; //选中的包裹
9597
9617
  useEffect(function () {
9598
9618
  setChangeIndex(0);
9599
- }, []);
9619
+ }, [value]);
9600
9620
  var content = function content(item, index) {
9601
9621
  return /*#__PURE__*/React.createElement("div", {
9602
9622
  style: {
@@ -9693,6 +9713,13 @@ var jstGoods = function jstGoods(props) {
9693
9713
  return changeInputHandle(e.target.value, 'sendName');
9694
9714
  },
9695
9715
  value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName
9716
+ })) : null, type === 4 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
9717
+ disabled: disabled,
9718
+ placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
9719
+ onChange: function onChange(e) {
9720
+ return changeInputHandle(e.target.value, 'deliveryNo');
9721
+ },
9722
+ value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
9696
9723
  })) : null) : null);
9697
9724
  };
9698
9725
 
@@ -10212,6 +10239,18 @@ var GoodItem = function GoodItem(props) {
10212
10239
  }
10213
10240
  });
10214
10241
  }
10242
+ }, {
10243
+ dataIndex: 'skuName',
10244
+ title: "".concat(text, "sku\u540D\u79F0"),
10245
+ align: 'center',
10246
+ ellipsis: true,
10247
+ width: 250
10248
+ }, {
10249
+ dataIndex: 'sku',
10250
+ title: "".concat(text, "sku\u7F16\u7801"),
10251
+ align: 'center',
10252
+ ellipsis: true,
10253
+ width: 100
10215
10254
  }, {
10216
10255
  dataIndex: 'name',
10217
10256
  title: "".concat(text, "\u540D\u79F0"),
@@ -10236,12 +10275,6 @@ var GoodItem = function GoodItem(props) {
10236
10275
  align: 'center',
10237
10276
  ellipsis: true,
10238
10277
  width: 100
10239
- }, {
10240
- dataIndex: 'sku',
10241
- title: "".concat(text, "sku\u7F16\u7801"),
10242
- align: 'center',
10243
- ellipsis: true,
10244
- width: 100
10245
10278
  }, {
10246
10279
  dataIndex: 'money',
10247
10280
  title: "\u5B9E\u4ED8\u91D1\u989D",
@@ -10319,11 +10352,13 @@ var GoodItem = function GoodItem(props) {
10319
10352
  name = item.name,
10320
10353
  code = item.code,
10321
10354
  skuCode = item.skuCode,
10322
- marketPrice = item.marketPrice;
10355
+ marketPrice = item.marketPrice,
10356
+ skuName = item.skuName;
10323
10357
  return {
10324
10358
  id: goodsId,
10325
10359
  mark: '是',
10326
10360
  pic: '',
10361
+ skuName: skuName,
10327
10362
  name: name,
10328
10363
  code: code,
10329
10364
  sku: skuCode,
@@ -10406,7 +10441,7 @@ var BsGoods = function BsGoods(props) {
10406
10441
  useEffect(function () {
10407
10442
  pubsub.subscribe('type', function (type, data) {
10408
10443
  if (disabled) return;
10409
- console.log(type, data);
10444
+ // console.log(type, data);
10410
10445
  withInfo.current = {
10411
10446
  type: type,
10412
10447
  val: data.val,
@@ -10432,25 +10467,54 @@ var BsGoods = function BsGoods(props) {
10432
10467
  setTableSelect(['2', '4'].includes(data.val));
10433
10468
  if (['1', '3'].includes(data.val)) {
10434
10469
  var _valueRef$current2;
10470
+ // console.log(
10471
+ // 'goods-reissueSelectListReturn',
10472
+ // valueRef?.current?.bsGoods,
10473
+ // );
10435
10474
  pubsub.publish('reissueSelectListReturn', {
10436
10475
  list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10437
10476
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10438
10477
  });
10439
10478
  }
10440
10479
  });
10480
+ //退货
10481
+ pubsub.subscribe('bsReturnType', function (type, data) {
10482
+ if (disabled) return;
10483
+ withInfo.current = {
10484
+ type: type,
10485
+ val: data.val,
10486
+ goodValue: data.goodValue
10487
+ };
10488
+ setTableSelect(['2', '4'].includes(data.val));
10489
+ if (['1', '3'].includes(data.val)) {
10490
+ var _valueRef$current3;
10491
+ pubsub.publish('returnSelectListReturn', {
10492
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10493
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10494
+ });
10495
+ }
10496
+ });
10441
10497
  pubsub.subscribeOnce('changeShopCode', function (type, data) {
10442
- console.log(data);
10498
+ // console.log(data);
10443
10499
  onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
10444
10500
  shopCode: data.shopCode
10445
10501
  }));
10446
10502
  });
10503
+ return function () {
10504
+ pubsub.clearAllSubscriptions();
10505
+ };
10447
10506
  }, [disabled]);
10448
10507
  var _onSelect = function onSelect(list) {
10449
10508
  var _withInfo$current, _withInfo$current2;
10450
10509
  if (disabled) return;
10451
10510
  var newList = cloneDeep(list);
10452
- var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10453
- console.log('onSelect', type, withInfo.current, newList);
10511
+ var typeMap = {
10512
+ type: 'selectList',
10513
+ reissueType: 'reissueSelectList',
10514
+ returnType: 'returnSelectList'
10515
+ };
10516
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
10517
+ // console.log('onSelect', type, withInfo.current, newList);
10454
10518
  pubsub.publish(type, {
10455
10519
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10456
10520
  list: newList.map(function (item) {
@@ -10464,6 +10528,7 @@ var BsGoods = function BsGoods(props) {
10464
10528
  var deleteId = item === null || item === void 0 ? void 0 : item.sku;
10465
10529
  pubsub.publish('deleteGood', deleteId);
10466
10530
  pubsub.publish('reissueDeleteGood', deleteId);
10531
+ pubsub.publish('returnDeleteGood', deleteId);
10467
10532
  };
10468
10533
  var changeHandle = function changeHandle(list) {
10469
10534
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
@@ -10731,7 +10796,7 @@ var BsReissue = function BsReissue(props) {
10731
10796
  var valueRef = useRef({});
10732
10797
  useEffect(function () {
10733
10798
  pubsub.subscribe('reissueSelectList', function (_, data) {
10734
- console.log('reissueSelectList', data);
10799
+ // console.log('reissueSelectList', data);
10735
10800
  if (disabled) return;
10736
10801
  var newValue = _objectSpread2({}, data.goodValue);
10737
10802
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10745,7 +10810,7 @@ var BsReissue = function BsReissue(props) {
10745
10810
  }, []);
10746
10811
  useEffect(function () {
10747
10812
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10748
- console.log('reissueSelectListReturn', data);
10813
+ // console.log('reissueSelectListReturn', data);
10749
10814
  if (disabled) return;
10750
10815
  var newValue = _objectSpread2({}, data.goodValue);
10751
10816
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10827,6 +10892,99 @@ var BsReissue = function BsReissue(props) {
10827
10892
  })));
10828
10893
  };
10829
10894
 
10895
+ var _excluded$f = ["value", "onChange", "reasonList", "disabled"];
10896
+ var BsReturnGoods = function BsReturnGoods(props) {
10897
+ var value = props.value,
10898
+ onChange = props.onChange,
10899
+ _props$reasonList = props.reasonList,
10900
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10901
+ disabled = props.disabled,
10902
+ other = _objectWithoutProperties(props, _excluded$f);
10903
+ var valueRef = useRef({});
10904
+ useEffect(function () {
10905
+ pubsub.subscribe('returnSelectList', function (_, data) {
10906
+ // console.log('returnSelectList', data);
10907
+ if (disabled) return;
10908
+ var newValue = _objectSpread2({}, data.goodValue);
10909
+ newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
10910
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10911
+ });
10912
+ }, []);
10913
+ useEffect(function () {
10914
+ pubsub.subscribe('returnSelectListReturn', function (_, data) {
10915
+ // console.log('returnSelectListReturn', data);
10916
+ if (disabled) return;
10917
+ var newValue = _objectSpread2({}, data.goodValue);
10918
+ newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
10919
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10920
+ });
10921
+ }, []);
10922
+ useEffect(function () {
10923
+ valueRef.current = value;
10924
+ pubsub.subscribeOnce('returnDeleteGood', function (_, data) {
10925
+ if (disabled) return;
10926
+ if (value) {
10927
+ var newValue = _objectSpread2({}, value);
10928
+ newValue.bsReturnGoods = newValue.bsReturnGoods.filter(function (item) {
10929
+ return item.sku !== data;
10930
+ });
10931
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10932
+ }
10933
+ });
10934
+ pubsub.subscribeOnce('changeShopCode', function (type, data) {
10935
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10936
+ shopCode: data.shopCode
10937
+ }));
10938
+ });
10939
+ }, [value, disabled]);
10940
+ var changeTypeHandle = function changeTypeHandle(val) {
10941
+ var newValue = _objectSpread2({}, value);
10942
+ newValue['bsReturnType'] = val;
10943
+ newValue.bsReturnGoods = [];
10944
+ if (['2', '4'].includes(val[0])) {
10945
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10946
+ valueRef.current = newValue;
10947
+ }
10948
+ pubsub.publish('returnType', {
10949
+ val: val[0],
10950
+ goodValue: newValue
10951
+ });
10952
+ };
10953
+ var changeGoodHandle = function changeGoodHandle(val) {
10954
+ var newValue = _objectSpread2({}, value);
10955
+ newValue['bsReturnGoods'] = val;
10956
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10957
+ };
10958
+ //显示选择商品按钮 原单换不显示选择商品
10959
+ var showChangeBtn = useMemo(function () {
10960
+ var _value$bsReturnType;
10961
+ return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsReturnType = value.bsReturnType) === null || _value$bsReturnType === void 0 ? void 0 : _value$bsReturnType[0]);
10962
+ }, [value === null || value === void 0 ? void 0 : value.bsReturnType]);
10963
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
10964
+ style: {
10965
+ marginBottom: '8px'
10966
+ },
10967
+ disabled: disabled,
10968
+ allowClear: false,
10969
+ options: reasonList,
10970
+ value: value === null || value === void 0 ? void 0 : value.bsReturnType,
10971
+ onChange: function onChange(val) {
10972
+ return changeTypeHandle(val);
10973
+ }
10974
+ }), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
10975
+ key: 'returnGoods'
10976
+ }, other), {}, {
10977
+ disabled: disabled,
10978
+ canUpdateNumber: showChangeBtn,
10979
+ showChangeBtn: showChangeBtn,
10980
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10981
+ value: value === null || value === void 0 ? void 0 : value.bsReturnGoods,
10982
+ onChange: function onChange(val) {
10983
+ return changeGoodHandle(val);
10984
+ }
10985
+ })));
10986
+ };
10987
+
10830
10988
  var columns$1 = [{
10831
10989
  dataIndex: 'billType',
10832
10990
  title: '单据类型'
@@ -11394,12 +11552,12 @@ var Goods$1 = function Goods(props, ref) {
11394
11552
  };
11395
11553
  var index$1 = /*#__PURE__*/forwardRef(Goods$1);
11396
11554
 
11397
- var _excluded$f = ["onChange", "value", "failValue"];
11398
- function MultiStatus(props) {
11555
+ var _excluded$g = ["onChange", "value", "failValue"];
11556
+ function CommonStatus(props) {
11399
11557
  var onChange = props.onChange,
11400
11558
  value = props.value,
11401
11559
  failValue = props.failValue,
11402
- other = _objectWithoutProperties(props, _excluded$f);
11560
+ other = _objectWithoutProperties(props, _excluded$g);
11403
11561
  var changeHandle = function changeHandle(val) {
11404
11562
  onChange === null || onChange === void 0 ? void 0 : onChange({
11405
11563
  status: val,
@@ -11408,6 +11566,7 @@ function MultiStatus(props) {
11408
11566
  };
11409
11567
  return /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({
11410
11568
  showSearch: true,
11569
+ value: value === null || value === void 0 ? void 0 : value.status,
11411
11570
  filterOption: function filterOption(input, option) {
11412
11571
  return option.label.includes(input);
11413
11572
  }
@@ -11416,4 +11575,161 @@ function MultiStatus(props) {
11416
11575
  }));
11417
11576
  }
11418
11577
 
11419
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, ApaasUploadAsync$1 as ApaasUploadFile, BsExchange, BsGoods, BsReissue, index as BsSystemOrder, BuyerNick, ChooseBaby, MultiStatus as CommonStatus, ExpressLogistics, Goods, index$1 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };
11578
+ var CommonSystemOrder = function CommonSystemOrder(props) {
11579
+ var _value$changeIndex, _value$changeIndex2;
11580
+ var _props$value = props.value,
11581
+ value = _props$value === void 0 ? [] : _props$value,
11582
+ onChange = props.onChange,
11583
+ disabled = props.disabled,
11584
+ _props$type = props.type,
11585
+ type = _props$type === void 0 ? 1 : _props$type;
11586
+ var _useState = useState(0),
11587
+ _useState2 = _slicedToArray(_useState, 2),
11588
+ changeIndex = _useState2[0],
11589
+ setChangeIndex = _useState2[1]; //选中的包裹
11590
+ useEffect(function () {
11591
+ setChangeIndex(0);
11592
+ }, [value]);
11593
+ var content = function content(item, index) {
11594
+ return /*#__PURE__*/React.createElement("div", {
11595
+ style: {
11596
+ maxHeight: '300px',
11597
+ overflowY: 'auto'
11598
+ }
11599
+ }, type === 1 ? /*#__PURE__*/React.createElement("span", null, "\u7CFB\u7EDF\u8BA2\u5355\u53F7", index + 1, "\uFF1A", item.systemOrderId) : null);
11600
+ };
11601
+ var changeInputHandle = function changeInputHandle(val, type) {
11602
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11603
+ changeOrderInfo[type] = val;
11604
+ var newList = _toConsumableArray(value);
11605
+ newList[changeIndex] = changeOrderInfo;
11606
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
11607
+ };
11608
+ //判断是否是单个且没有商品数据
11609
+ var isSingle = useMemo(function () {
11610
+ return value && value.length === 1;
11611
+ }, [value]);
11612
+ return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, {
11613
+ wrap: true
11614
+ }, (value || []).map(function (item, index) {
11615
+ return /*#__PURE__*/React.createElement(Popover, {
11616
+ content: content(item, index),
11617
+ key: index
11618
+ }, /*#__PURE__*/React.createElement("span", {
11619
+ style: {
11620
+ color: changeIndex === index ? '#4569d4' : 'black',
11621
+ cursor: 'pointer'
11622
+ },
11623
+ onClick: function onClick() {
11624
+ return setChangeIndex(index);
11625
+ }
11626
+ }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
11627
+ }))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
11628
+ disabled: disabled,
11629
+ placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
11630
+ onChange: function onChange(e) {
11631
+ return changeInputHandle(e.target.value, 'deliveryNo');
11632
+ },
11633
+ value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.deliveryNo
11634
+ })) : null, type === 2 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
11635
+ disabled: disabled,
11636
+ placeholder: "\u8BF7\u8F93\u5165\u9000\u8D27\u5355id",
11637
+ onChange: function onChange(e) {
11638
+ return changeInputHandle(e.target.value, 'returnGoodsTradeId');
11639
+ },
11640
+ value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.returnGoodsTradeId
11641
+ })) : null) : null);
11642
+ };
11643
+
11644
+ var _excluded$h = ["value", "onChange", "disabled", "failValue", "type"];
11645
+ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
11646
+ var _value$changeIndex;
11647
+ var _props$value = props.value,
11648
+ value = _props$value === void 0 ? [] : _props$value,
11649
+ onChange = props.onChange,
11650
+ disabled = props.disabled,
11651
+ failValue = props.failValue,
11652
+ _props$type = props.type,
11653
+ type = _props$type === void 0 ? 1 : _props$type,
11654
+ other = _objectWithoutProperties(props, _excluded$h);
11655
+ var _useState = useState(0),
11656
+ _useState2 = _slicedToArray(_useState, 2),
11657
+ changeIndex = _useState2[0],
11658
+ setChangeIndex = _useState2[1]; //选中的包裹
11659
+ useEffect(function () {
11660
+ setChangeIndex(0);
11661
+ }, [value]);
11662
+ var content = function content(item, index) {
11663
+ return /*#__PURE__*/React.createElement("div", {
11664
+ style: {
11665
+ maxHeight: '300px',
11666
+ overflowY: 'auto'
11667
+ }
11668
+ }, type === 1 ? /*#__PURE__*/React.createElement("span", null, "\u7CFB\u7EDF\u8BA2\u5355\u53F7", index + 1, "\uFF1A", item.systemOrderId) : null);
11669
+ };
11670
+ var changeHandle = function changeHandle(val, valType) {
11671
+ console.log(val, valType);
11672
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11673
+ changeOrderInfo[valType] = val;
11674
+ if (val === failValue) {
11675
+ changeOrderInfo.reason = '';
11676
+ }
11677
+ var newList = _toConsumableArray(value);
11678
+ newList[changeIndex] = changeOrderInfo;
11679
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
11680
+ };
11681
+ //判断是否是单个且没有商品数据
11682
+ var isSingle = useMemo(function () {
11683
+ return value && value.length === 1;
11684
+ }, [value]);
11685
+ return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Space, {
11686
+ wrap: true
11687
+ }, (value || []).map(function (item, index) {
11688
+ return /*#__PURE__*/React.createElement(Popover, {
11689
+ content: content(item, index),
11690
+ key: index
11691
+ }, /*#__PURE__*/React.createElement("span", {
11692
+ style: {
11693
+ color: changeIndex === index ? '#4569d4' : 'black',
11694
+ cursor: 'pointer'
11695
+ },
11696
+ onClick: function onClick() {
11697
+ return setChangeIndex(index);
11698
+ }
11699
+ }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
11700
+ }))) : null, value.length ? /*#__PURE__*/React.createElement(React.Fragment, null, type === 1 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
11701
+ showSearch: true,
11702
+ value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
11703
+ filterOption: function filterOption(input, option) {
11704
+ return option.label.includes(input);
11705
+ },
11706
+ style: {
11707
+ width: 200
11708
+ },
11709
+ placeholder: "\u8BF7\u9009\u62E9",
11710
+ disabled: disabled,
11711
+ onChange: function onChange(val) {
11712
+ return changeHandle(val, 'status');
11713
+ }
11714
+ }))) : null) : null);
11715
+ };
11716
+
11717
+ var CalculationInput = function CalculationInput(props) {
11718
+ var _props$config = props.config,
11719
+ config = _props$config === void 0 ? {} : _props$config;
11720
+ return /*#__PURE__*/React.createElement("span", {
11721
+ style: {
11722
+ display: 'flex',
11723
+ alignItems: 'center'
11724
+ }
11725
+ }, /*#__PURE__*/React.createElement(ApaasInput, _objectSpread2(_objectSpread2({}, props), {}, {
11726
+ placeholder: "\u6839\u636E\u89C4\u5219\u914D\u7F6E\uFF0C\u81EA\u52A8\u8BA1\u7B97\u6570\u503C"
11727
+ })), /*#__PURE__*/React.createElement("span", {
11728
+ style: {
11729
+ marginLeft: '4px',
11730
+ width: '92px'
11731
+ }
11732
+ }, config === null || config === void 0 ? void 0 : config.unit));
11733
+ };
11734
+
11735
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, ApaasUploadAsync$1 as ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$1 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };
package/dist/index.js CHANGED
@@ -7285,15 +7285,20 @@ var ParseLogistics = function ParseLogistics(props) {
7285
7285
  _useState2 = _slicedToArray(_useState, 2),
7286
7286
  value = _useState2[0],
7287
7287
  setValue = _useState2[1];
7288
- var handleIdentify = function handleIdentify() {
7289
- if (!value) {
7288
+ var _useState3 = React.useState(false),
7289
+ _useState4 = _slicedToArray(_useState3, 2),
7290
+ isCopy = _useState4[0],
7291
+ setIsCopy = _useState4[1];
7292
+ var handleIdentify = function handleIdentify(val) {
7293
+ if (!value && !val) {
7290
7294
  return;
7291
7295
  }
7296
+ setIsCopy(false);
7292
7297
  kmkfUtils.request({
7293
7298
  url: '/qy/logistics/addressAnalysis',
7294
7299
  method: 'post',
7295
7300
  data: {
7296
- fullAddress: value
7301
+ fullAddress: value || val
7297
7302
  }
7298
7303
  }).then(function (res) {
7299
7304
  var data = res.data;
@@ -7302,17 +7307,33 @@ var ParseLogistics = function ParseLogistics(props) {
7302
7307
  console.log(e);
7303
7308
  });
7304
7309
  };
7310
+ var _onKeyDown = function onKeyDown(e) {
7311
+ if (e.keyCode === 86) {
7312
+ setIsCopy(true);
7313
+ }
7314
+ };
7315
+ var onChangeValue = function onChangeValue(val) {
7316
+ setValue(val);
7317
+ if (isCopy) {
7318
+ handleIdentify(val);
7319
+ }
7320
+ };
7305
7321
  return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(TextArea, {
7306
7322
  placeholder: "\u590D\u5236\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
7307
7323
  rows: 3,
7308
7324
  value: value,
7309
7325
  onChange: function onChange(e) {
7310
- return setValue(e.target.value);
7326
+ return onChangeValue(e.target.value);
7327
+ },
7328
+ onKeyDown: function onKeyDown(e) {
7329
+ return _onKeyDown(e);
7311
7330
  }
7312
7331
  }), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7313
7332
  size: "small",
7314
7333
  type: "primary",
7315
- onClick: handleIdentify
7334
+ onClick: function onClick() {
7335
+ return handleIdentify('');
7336
+ }
7316
7337
  }, "\u667A\u80FD\u8BC6\u522B"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
7317
7338
  size: "small",
7318
7339
  onClick: function onClick() {
@@ -9591,10 +9612,9 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9591
9612
  };
9592
9613
 
9593
9614
  var jstGoods = function jstGoods(props) {
9594
- var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6;
9615
+ var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
9595
9616
  var _props$value = props.value,
9596
9617
  value = _props$value === void 0 ? [] : _props$value,
9597
- _props$options = props.options,
9598
9618
  onChange = props.onChange,
9599
9619
  disabled = props.disabled,
9600
9620
  _props$type = props.type,
@@ -9607,7 +9627,7 @@ var jstGoods = function jstGoods(props) {
9607
9627
  setChangeIndex = _useState2[1]; //选中的包裹
9608
9628
  React.useEffect(function () {
9609
9629
  setChangeIndex(0);
9610
- }, []);
9630
+ }, [value]);
9611
9631
  var content = function content(item, index) {
9612
9632
  return /*#__PURE__*/React__default['default'].createElement("div", {
9613
9633
  style: {
@@ -9704,6 +9724,13 @@ var jstGoods = function jstGoods(props) {
9704
9724
  return changeInputHandle(e.target.value, 'sendName');
9705
9725
  },
9706
9726
  value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName
9727
+ })) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
9728
+ disabled: disabled,
9729
+ placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
9730
+ onChange: function onChange(e) {
9731
+ return changeInputHandle(e.target.value, 'deliveryNo');
9732
+ },
9733
+ value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
9707
9734
  })) : null) : null);
9708
9735
  };
9709
9736
 
@@ -10223,6 +10250,18 @@ var GoodItem = function GoodItem(props) {
10223
10250
  }
10224
10251
  });
10225
10252
  }
10253
+ }, {
10254
+ dataIndex: 'skuName',
10255
+ title: "".concat(text, "sku\u540D\u79F0"),
10256
+ align: 'center',
10257
+ ellipsis: true,
10258
+ width: 250
10259
+ }, {
10260
+ dataIndex: 'sku',
10261
+ title: "".concat(text, "sku\u7F16\u7801"),
10262
+ align: 'center',
10263
+ ellipsis: true,
10264
+ width: 100
10226
10265
  }, {
10227
10266
  dataIndex: 'name',
10228
10267
  title: "".concat(text, "\u540D\u79F0"),
@@ -10247,12 +10286,6 @@ var GoodItem = function GoodItem(props) {
10247
10286
  align: 'center',
10248
10287
  ellipsis: true,
10249
10288
  width: 100
10250
- }, {
10251
- dataIndex: 'sku',
10252
- title: "".concat(text, "sku\u7F16\u7801"),
10253
- align: 'center',
10254
- ellipsis: true,
10255
- width: 100
10256
10289
  }, {
10257
10290
  dataIndex: 'money',
10258
10291
  title: "\u5B9E\u4ED8\u91D1\u989D",
@@ -10330,11 +10363,13 @@ var GoodItem = function GoodItem(props) {
10330
10363
  name = item.name,
10331
10364
  code = item.code,
10332
10365
  skuCode = item.skuCode,
10333
- marketPrice = item.marketPrice;
10366
+ marketPrice = item.marketPrice,
10367
+ skuName = item.skuName;
10334
10368
  return {
10335
10369
  id: goodsId,
10336
10370
  mark: '是',
10337
10371
  pic: '',
10372
+ skuName: skuName,
10338
10373
  name: name,
10339
10374
  code: code,
10340
10375
  sku: skuCode,
@@ -10417,7 +10452,7 @@ var BsGoods = function BsGoods(props) {
10417
10452
  React.useEffect(function () {
10418
10453
  pubsub__default['default'].subscribe('type', function (type, data) {
10419
10454
  if (disabled) return;
10420
- console.log(type, data);
10455
+ // console.log(type, data);
10421
10456
  withInfo.current = {
10422
10457
  type: type,
10423
10458
  val: data.val,
@@ -10443,25 +10478,54 @@ var BsGoods = function BsGoods(props) {
10443
10478
  setTableSelect(['2', '4'].includes(data.val));
10444
10479
  if (['1', '3'].includes(data.val)) {
10445
10480
  var _valueRef$current2;
10481
+ // console.log(
10482
+ // 'goods-reissueSelectListReturn',
10483
+ // valueRef?.current?.bsGoods,
10484
+ // );
10446
10485
  pubsub__default['default'].publish('reissueSelectListReturn', {
10447
10486
  list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.bsGoods) || []),
10448
10487
  goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10449
10488
  });
10450
10489
  }
10451
10490
  });
10491
+ //退货
10492
+ pubsub__default['default'].subscribe('bsReturnType', function (type, data) {
10493
+ if (disabled) return;
10494
+ withInfo.current = {
10495
+ type: type,
10496
+ val: data.val,
10497
+ goodValue: data.goodValue
10498
+ };
10499
+ setTableSelect(['2', '4'].includes(data.val));
10500
+ if (['1', '3'].includes(data.val)) {
10501
+ var _valueRef$current3;
10502
+ pubsub__default['default'].publish('returnSelectListReturn', {
10503
+ list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3.bsGoods) || []),
10504
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
10505
+ });
10506
+ }
10507
+ });
10452
10508
  pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
10453
- console.log(data);
10509
+ // console.log(data);
10454
10510
  onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
10455
10511
  shopCode: data.shopCode
10456
10512
  }));
10457
10513
  });
10514
+ return function () {
10515
+ pubsub__default['default'].clearAllSubscriptions();
10516
+ };
10458
10517
  }, [disabled]);
10459
10518
  var _onSelect = function onSelect(list) {
10460
10519
  var _withInfo$current, _withInfo$current2;
10461
10520
  if (disabled) return;
10462
10521
  var newList = lodash.cloneDeep(list);
10463
- var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10464
- console.log('onSelect', type, withInfo.current, newList);
10522
+ var typeMap = {
10523
+ type: 'selectList',
10524
+ reissueType: 'reissueSelectList',
10525
+ returnType: 'returnSelectList'
10526
+ };
10527
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
10528
+ // console.log('onSelect', type, withInfo.current, newList);
10465
10529
  pubsub__default['default'].publish(type, {
10466
10530
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10467
10531
  list: newList.map(function (item) {
@@ -10475,6 +10539,7 @@ var BsGoods = function BsGoods(props) {
10475
10539
  var deleteId = item === null || item === void 0 ? void 0 : item.sku;
10476
10540
  pubsub__default['default'].publish('deleteGood', deleteId);
10477
10541
  pubsub__default['default'].publish('reissueDeleteGood', deleteId);
10542
+ pubsub__default['default'].publish('returnDeleteGood', deleteId);
10478
10543
  };
10479
10544
  var changeHandle = function changeHandle(list) {
10480
10545
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
@@ -10742,7 +10807,7 @@ var BsReissue = function BsReissue(props) {
10742
10807
  var valueRef = React.useRef({});
10743
10808
  React.useEffect(function () {
10744
10809
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10745
- console.log('reissueSelectList', data);
10810
+ // console.log('reissueSelectList', data);
10746
10811
  if (disabled) return;
10747
10812
  var newValue = _objectSpread2({}, data.goodValue);
10748
10813
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10756,7 +10821,7 @@ var BsReissue = function BsReissue(props) {
10756
10821
  }, []);
10757
10822
  React.useEffect(function () {
10758
10823
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
10759
- console.log('reissueSelectListReturn', data);
10824
+ // console.log('reissueSelectListReturn', data);
10760
10825
  if (disabled) return;
10761
10826
  var newValue = _objectSpread2({}, data.goodValue);
10762
10827
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10838,6 +10903,99 @@ var BsReissue = function BsReissue(props) {
10838
10903
  })));
10839
10904
  };
10840
10905
 
10906
+ var _excluded$f = ["value", "onChange", "reasonList", "disabled"];
10907
+ var BsReturnGoods = function BsReturnGoods(props) {
10908
+ var value = props.value,
10909
+ onChange = props.onChange,
10910
+ _props$reasonList = props.reasonList,
10911
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
10912
+ disabled = props.disabled,
10913
+ other = _objectWithoutProperties(props, _excluded$f);
10914
+ var valueRef = React.useRef({});
10915
+ React.useEffect(function () {
10916
+ pubsub__default['default'].subscribe('returnSelectList', function (_, data) {
10917
+ // console.log('returnSelectList', data);
10918
+ if (disabled) return;
10919
+ var newValue = _objectSpread2({}, data.goodValue);
10920
+ newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
10921
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10922
+ });
10923
+ }, []);
10924
+ React.useEffect(function () {
10925
+ pubsub__default['default'].subscribe('returnSelectListReturn', function (_, data) {
10926
+ // console.log('returnSelectListReturn', data);
10927
+ if (disabled) return;
10928
+ var newValue = _objectSpread2({}, data.goodValue);
10929
+ newValue.bsReturnGoods = (data === null || data === void 0 ? void 0 : data.list) || [];
10930
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10931
+ });
10932
+ }, []);
10933
+ React.useEffect(function () {
10934
+ valueRef.current = value;
10935
+ pubsub__default['default'].subscribeOnce('returnDeleteGood', function (_, data) {
10936
+ if (disabled) return;
10937
+ if (value) {
10938
+ var newValue = _objectSpread2({}, value);
10939
+ newValue.bsReturnGoods = newValue.bsReturnGoods.filter(function (item) {
10940
+ return item.sku !== data;
10941
+ });
10942
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10943
+ }
10944
+ });
10945
+ pubsub__default['default'].subscribeOnce('changeShopCode', function (type, data) {
10946
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
10947
+ shopCode: data.shopCode
10948
+ }));
10949
+ });
10950
+ }, [value, disabled]);
10951
+ var changeTypeHandle = function changeTypeHandle(val) {
10952
+ var newValue = _objectSpread2({}, value);
10953
+ newValue['bsReturnType'] = val;
10954
+ newValue.bsReturnGoods = [];
10955
+ if (['2', '4'].includes(val[0])) {
10956
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10957
+ valueRef.current = newValue;
10958
+ }
10959
+ pubsub__default['default'].publish('returnType', {
10960
+ val: val[0],
10961
+ goodValue: newValue
10962
+ });
10963
+ };
10964
+ var changeGoodHandle = function changeGoodHandle(val) {
10965
+ var newValue = _objectSpread2({}, value);
10966
+ newValue['bsReturnGoods'] = val;
10967
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10968
+ };
10969
+ //显示选择商品按钮 原单换不显示选择商品
10970
+ var showChangeBtn = React.useMemo(function () {
10971
+ var _value$bsReturnType;
10972
+ return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsReturnType = value.bsReturnType) === null || _value$bsReturnType === void 0 ? void 0 : _value$bsReturnType[0]);
10973
+ }, [value === null || value === void 0 ? void 0 : value.bsReturnType]);
10974
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
10975
+ style: {
10976
+ marginBottom: '8px'
10977
+ },
10978
+ disabled: disabled,
10979
+ allowClear: false,
10980
+ options: reasonList,
10981
+ value: value === null || value === void 0 ? void 0 : value.bsReturnType,
10982
+ onChange: function onChange(val) {
10983
+ return changeTypeHandle(val);
10984
+ }
10985
+ }), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10986
+ key: 'returnGoods'
10987
+ }, other), {}, {
10988
+ disabled: disabled,
10989
+ canUpdateNumber: showChangeBtn,
10990
+ showChangeBtn: showChangeBtn,
10991
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10992
+ value: value === null || value === void 0 ? void 0 : value.bsReturnGoods,
10993
+ onChange: function onChange(val) {
10994
+ return changeGoodHandle(val);
10995
+ }
10996
+ })));
10997
+ };
10998
+
10841
10999
  var columns$1 = [{
10842
11000
  dataIndex: 'billType',
10843
11001
  title: '单据类型'
@@ -11405,12 +11563,12 @@ var Goods$1 = function Goods(props, ref) {
11405
11563
  };
11406
11564
  var index$1 = /*#__PURE__*/React.forwardRef(Goods$1);
11407
11565
 
11408
- var _excluded$f = ["onChange", "value", "failValue"];
11409
- function MultiStatus(props) {
11566
+ var _excluded$g = ["onChange", "value", "failValue"];
11567
+ function CommonStatus(props) {
11410
11568
  var onChange = props.onChange,
11411
11569
  value = props.value,
11412
11570
  failValue = props.failValue,
11413
- other = _objectWithoutProperties(props, _excluded$f);
11571
+ other = _objectWithoutProperties(props, _excluded$g);
11414
11572
  var changeHandle = function changeHandle(val) {
11415
11573
  onChange === null || onChange === void 0 ? void 0 : onChange({
11416
11574
  status: val,
@@ -11419,6 +11577,7 @@ function MultiStatus(props) {
11419
11577
  };
11420
11578
  return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({
11421
11579
  showSearch: true,
11580
+ value: value === null || value === void 0 ? void 0 : value.status,
11422
11581
  filterOption: function filterOption(input, option) {
11423
11582
  return option.label.includes(input);
11424
11583
  }
@@ -11427,6 +11586,163 @@ function MultiStatus(props) {
11427
11586
  }));
11428
11587
  }
11429
11588
 
11589
+ var CommonSystemOrder = function CommonSystemOrder(props) {
11590
+ var _value$changeIndex, _value$changeIndex2;
11591
+ var _props$value = props.value,
11592
+ value = _props$value === void 0 ? [] : _props$value,
11593
+ onChange = props.onChange,
11594
+ disabled = props.disabled,
11595
+ _props$type = props.type,
11596
+ type = _props$type === void 0 ? 1 : _props$type;
11597
+ var _useState = React.useState(0),
11598
+ _useState2 = _slicedToArray(_useState, 2),
11599
+ changeIndex = _useState2[0],
11600
+ setChangeIndex = _useState2[1]; //选中的包裹
11601
+ React.useEffect(function () {
11602
+ setChangeIndex(0);
11603
+ }, [value]);
11604
+ var content = function content(item, index) {
11605
+ return /*#__PURE__*/React__default['default'].createElement("div", {
11606
+ style: {
11607
+ maxHeight: '300px',
11608
+ overflowY: 'auto'
11609
+ }
11610
+ }, type === 1 ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u7CFB\u7EDF\u8BA2\u5355\u53F7", index + 1, "\uFF1A", item.systemOrderId) : null);
11611
+ };
11612
+ var changeInputHandle = function changeInputHandle(val, type) {
11613
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11614
+ changeOrderInfo[type] = val;
11615
+ var newList = _toConsumableArray(value);
11616
+ newList[changeIndex] = changeOrderInfo;
11617
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
11618
+ };
11619
+ //判断是否是单个且没有商品数据
11620
+ var isSingle = React.useMemo(function () {
11621
+ return value && value.length === 1;
11622
+ }, [value]);
11623
+ return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Space, {
11624
+ wrap: true
11625
+ }, (value || []).map(function (item, index) {
11626
+ return /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
11627
+ content: content(item, index),
11628
+ key: index
11629
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
11630
+ style: {
11631
+ color: changeIndex === index ? '#4569d4' : 'black',
11632
+ cursor: 'pointer'
11633
+ },
11634
+ onClick: function onClick() {
11635
+ return setChangeIndex(index);
11636
+ }
11637
+ }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
11638
+ }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11639
+ disabled: disabled,
11640
+ placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
11641
+ onChange: function onChange(e) {
11642
+ return changeInputHandle(e.target.value, 'deliveryNo');
11643
+ },
11644
+ value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.deliveryNo
11645
+ })) : null, type === 2 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11646
+ disabled: disabled,
11647
+ placeholder: "\u8BF7\u8F93\u5165\u9000\u8D27\u5355id",
11648
+ onChange: function onChange(e) {
11649
+ return changeInputHandle(e.target.value, 'returnGoodsTradeId');
11650
+ },
11651
+ value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.returnGoodsTradeId
11652
+ })) : null) : null);
11653
+ };
11654
+
11655
+ var _excluded$h = ["value", "onChange", "disabled", "failValue", "type"];
11656
+ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
11657
+ var _value$changeIndex;
11658
+ var _props$value = props.value,
11659
+ value = _props$value === void 0 ? [] : _props$value,
11660
+ onChange = props.onChange,
11661
+ disabled = props.disabled,
11662
+ failValue = props.failValue,
11663
+ _props$type = props.type,
11664
+ type = _props$type === void 0 ? 1 : _props$type,
11665
+ other = _objectWithoutProperties(props, _excluded$h);
11666
+ var _useState = React.useState(0),
11667
+ _useState2 = _slicedToArray(_useState, 2),
11668
+ changeIndex = _useState2[0],
11669
+ setChangeIndex = _useState2[1]; //选中的包裹
11670
+ React.useEffect(function () {
11671
+ setChangeIndex(0);
11672
+ }, [value]);
11673
+ var content = function content(item, index) {
11674
+ return /*#__PURE__*/React__default['default'].createElement("div", {
11675
+ style: {
11676
+ maxHeight: '300px',
11677
+ overflowY: 'auto'
11678
+ }
11679
+ }, type === 1 ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u7CFB\u7EDF\u8BA2\u5355\u53F7", index + 1, "\uFF1A", item.systemOrderId) : null);
11680
+ };
11681
+ var changeHandle = function changeHandle(val, valType) {
11682
+ console.log(val, valType);
11683
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11684
+ changeOrderInfo[valType] = val;
11685
+ if (val === failValue) {
11686
+ changeOrderInfo.reason = '';
11687
+ }
11688
+ var newList = _toConsumableArray(value);
11689
+ newList[changeIndex] = changeOrderInfo;
11690
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
11691
+ };
11692
+ //判断是否是单个且没有商品数据
11693
+ var isSingle = React.useMemo(function () {
11694
+ return value && value.length === 1;
11695
+ }, [value]);
11696
+ return /*#__PURE__*/React__default['default'].createElement("div", null, !isSingle ? /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(antd.Space, {
11697
+ wrap: true
11698
+ }, (value || []).map(function (item, index) {
11699
+ return /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
11700
+ content: content(item, index),
11701
+ key: index
11702
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
11703
+ style: {
11704
+ color: changeIndex === index ? '#4569d4' : 'black',
11705
+ cursor: 'pointer'
11706
+ },
11707
+ onClick: function onClick() {
11708
+ return setChangeIndex(index);
11709
+ }
11710
+ }, "\u7CFB\u7EDF\u8BA2\u5355\u53F7".concat(index + 1)));
11711
+ }))) : null, value.length ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
11712
+ showSearch: true,
11713
+ value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
11714
+ filterOption: function filterOption(input, option) {
11715
+ return option.label.includes(input);
11716
+ },
11717
+ style: {
11718
+ width: 200
11719
+ },
11720
+ placeholder: "\u8BF7\u9009\u62E9",
11721
+ disabled: disabled,
11722
+ onChange: function onChange(val) {
11723
+ return changeHandle(val, 'status');
11724
+ }
11725
+ }))) : null) : null);
11726
+ };
11727
+
11728
+ var CalculationInput = function CalculationInput(props) {
11729
+ var _props$config = props.config,
11730
+ config = _props$config === void 0 ? {} : _props$config;
11731
+ return /*#__PURE__*/React__default['default'].createElement("span", {
11732
+ style: {
11733
+ display: 'flex',
11734
+ alignItems: 'center'
11735
+ }
11736
+ }, /*#__PURE__*/React__default['default'].createElement(ApaasInput, _objectSpread2(_objectSpread2({}, props), {}, {
11737
+ placeholder: "\u6839\u636E\u89C4\u5219\u914D\u7F6E\uFF0C\u81EA\u52A8\u8BA1\u7B97\u6570\u503C"
11738
+ })), /*#__PURE__*/React__default['default'].createElement("span", {
11739
+ style: {
11740
+ marginLeft: '4px',
11741
+ width: '92px'
11742
+ }
11743
+ }, config === null || config === void 0 ? void 0 : config.unit));
11744
+ };
11745
+
11430
11746
  exports.Address = ApaasAddress;
11431
11747
  exports.AliPay = AliPay;
11432
11748
  exports.ApaasAddress = Province;
@@ -11450,10 +11766,14 @@ exports.ApaasUploadFile = ApaasUploadAsync$1;
11450
11766
  exports.BsExchange = BsExchange;
11451
11767
  exports.BsGoods = BsGoods;
11452
11768
  exports.BsReissue = BsReissue;
11769
+ exports.BsReturn = BsReturnGoods;
11453
11770
  exports.BsSystemOrder = index;
11454
11771
  exports.BuyerNick = BuyerNick;
11772
+ exports.CalculationInput = CalculationInput;
11455
11773
  exports.ChooseBaby = ChooseBaby;
11456
- exports.CommonStatus = MultiStatus;
11774
+ exports.CommonMultiStatus = CommonSystemOrder$1;
11775
+ exports.CommonStatus = CommonStatus;
11776
+ exports.CommonSystemOrder = CommonSystemOrder;
11457
11777
  exports.ExpressLogistics = ExpressLogistics;
11458
11778
  exports.Goods = Goods;
11459
11779
  exports.GoodsTable = index$1;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const CalculationInput: (props: any) => React.JSX.Element;
3
+ export default CalculationInput;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const BsReturnGoods: (props: any) => React.JSX.Element;
3
+ export default BsReturnGoods;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface CommonSystemOrderProps {
3
+ value: {
4
+ status: string;
5
+ reason?: string;
6
+ systemOrderId?: string;
7
+ }[];
8
+ failValue: string;
9
+ options: any[];
10
+ onChange: (val: any) => void;
11
+ disabled: boolean;
12
+ type: number;
13
+ }
14
+ declare const CommonSystemOrder: (props: Partial<CommonSystemOrderProps>) => React.JSX.Element;
15
+ export default CommonSystemOrder;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- interface MultiStatusProps {
2
+ interface CommonStatusProps {
3
3
  value: {
4
4
  status: string;
5
5
  reason: string;
@@ -8,5 +8,5 @@ interface MultiStatusProps {
8
8
  options: any[];
9
9
  onChange: (val: any) => void;
10
10
  }
11
- declare function MultiStatus(props: Partial<MultiStatusProps>): React.JSX.Element;
12
- export default MultiStatus;
11
+ declare function CommonStatus(props: Partial<CommonStatusProps>): React.JSX.Element;
12
+ export default CommonStatus;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface CommonSystemOrderProps {
3
+ value: any[];
4
+ type: number;
5
+ options: any[];
6
+ disabled: boolean;
7
+ onChange: (val: any[]) => void;
8
+ }
9
+ declare const CommonSystemOrder: (props: Partial<CommonSystemOrderProps>) => React.JSX.Element;
10
+ export default CommonSystemOrder;
@@ -39,8 +39,12 @@ export { default as JstItemList } from './jst/ItemList';
39
39
  export { default as BsGoods } from './bs/Goods';
40
40
  export { default as BsExchange } from './bs/Exchange';
41
41
  export { default as BsReissue } from './bs/Reissue';
42
+ export { default as BsReturn } from './bs/Return';
42
43
  export { default as BsSystemOrder } from './bs/SystemOrder';
43
44
  export { default as GoodsTable } from './common/GoodsTable';
44
45
  export { default as CommonStatus } from './common/CommonStatus';
46
+ export { default as CommonSystemOrder } from './common/CommonSystemOrder';
47
+ export { default as CommonMultiStatus } from './common/CommonMultiStatus';
45
48
  export { default as ParseLogistics } from './common/ParseLogistics';
46
49
  export { default as IdentifyAddress } from './common/IdentifyAddress';
50
+ export { default as CalculationInput } from './apaas/CalculationInput';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.8.17-alpha.9",
3
+ "version": "0.8.17",
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": "^0.8.17-alpha.9",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.8.17",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "react-copy-to-clipboard": "^5.1.0",
@@ -60,5 +60,5 @@
60
60
  "publishConfig": {
61
61
  "access": "public"
62
62
  },
63
- "gitHead": "53d97c7e58b0f9ee82fd6fc5de6e8d7890797d44"
63
+ "gitHead": "fbac5157adf5ac4b01dd6a57fd1a19bb0137ce18"
64
64
  }