@kmkf-fe-packages/basic-components 0.29.1-rc.9 → 0.29.2-rc.0

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
@@ -10423,7 +10423,7 @@ var typeInitValueMap = {
10423
10423
  }]
10424
10424
  };
10425
10425
  var jstGoods = function jstGoods(props) {
10426
- var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
10426
+ var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7, _value$changeIndex8;
10427
10427
  var _props$value = props.value,
10428
10428
  value = _props$value === void 0 ? [] : _props$value,
10429
10429
  onChange = props.onChange,
@@ -10431,17 +10431,25 @@ var jstGoods = function jstGoods(props) {
10431
10431
  _props$type = props.type,
10432
10432
  type = _props$type === void 0 ? 1 : _props$type,
10433
10433
  _props$showField = props.showField,
10434
- showField = _props$showField === void 0 ? '' : _props$showField;
10434
+ showField = _props$showField === void 0 ? '' : _props$showField,
10435
+ _props$componentType = props.componentType,
10436
+ componentType = _props$componentType === void 0 ? '' : _props$componentType;
10435
10437
  var _useState = useState(0),
10436
10438
  _useState2 = _slicedToArray(_useState, 2),
10437
10439
  changeIndex = _useState2[0],
10438
10440
  setChangeIndex = _useState2[1]; //选中的包裹
10441
+ var _useState3 = useState([]),
10442
+ _useState4 = _slicedToArray(_useState3, 2),
10443
+ wdtSendOptions = _useState4[0],
10444
+ setSendOptions = _useState4[1];
10439
10445
  useEffect(function () {
10440
10446
  //没有值塞个默认值
10441
10447
  if (!(value === null || value === void 0 ? void 0 : value.length)) {
10442
10448
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10443
10449
  }
10444
10450
  }, [value, type]);
10451
+ useEffect(function () {
10452
+ }, []);
10445
10453
  var content = function content(item, index) {
10446
10454
  return /*#__PURE__*/React.createElement("div", {
10447
10455
  style: {
@@ -10462,6 +10470,18 @@ var jstGoods = function jstGoods(props) {
10462
10470
  }), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, t.title), /*#__PURE__*/React.createElement("div", null, "\u7F16\u7801\uFF1A", t.skuId))));
10463
10471
  }));
10464
10472
  };
10473
+ var handleSelected = function handleSelected(val, type, option) {
10474
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
10475
+ changeOrderInfo[type] = val;
10476
+ changeOrderInfo['sendId'] = option.warehouseNo;
10477
+ var newList = _toConsumableArray(value);
10478
+ newList[changeIndex] = changeOrderInfo;
10479
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
10480
+ };
10481
+ var filterOption = function filterOption(input, option) {
10482
+ var _option$label;
10483
+ return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').includes(input);
10484
+ };
10465
10485
  var changeInputHandle = function changeInputHandle(val, type) {
10466
10486
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
10467
10487
  changeOrderInfo[type] = val;
@@ -10532,20 +10552,34 @@ var jstGoods = function jstGoods(props) {
10532
10552
  return changeInputHandle(e.target.value, 'sendId');
10533
10553
  },
10534
10554
  value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
10535
- }), ['sendName', 'all'].includes(showField) && /*#__PURE__*/React.createElement(Input, {
10555
+ }), ['sendName', 'all'].includes(showField) && (componentType === 'WDT_SEND_GOOD' ? /*#__PURE__*/React.createElement(Select, {
10556
+ style: {
10557
+ minWidth: '100px',
10558
+ maxWidth: '180px'
10559
+ },
10560
+ disabled: disabled,
10561
+ placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
10562
+ showSearch: true,
10563
+ options: wdtSendOptions,
10564
+ filterOption: filterOption,
10565
+ value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName,
10566
+ onChange: function onChange(value, option) {
10567
+ return handleSelected(value, 'sendName', option);
10568
+ }
10569
+ }) : /*#__PURE__*/React.createElement(Input, {
10536
10570
  disabled: disabled,
10537
10571
  placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u540D\u79F0",
10538
10572
  onChange: function onChange(e) {
10539
10573
  return changeInputHandle(e.target.value, 'sendName');
10540
10574
  },
10541
- value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName
10542
- })) : null, type === 4 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
10575
+ value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
10576
+ }))) : null, type === 4 ? /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
10543
10577
  disabled: disabled,
10544
10578
  placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
10545
10579
  onChange: function onChange(e) {
10546
10580
  return changeInputHandle(e.target.value, 'deliveryNo');
10547
10581
  },
10548
- value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
10582
+ value: (_value$changeIndex8 = value[changeIndex]) === null || _value$changeIndex8 === void 0 ? void 0 : _value$changeIndex8.sendName
10549
10583
  })) : null) : null);
10550
10584
  };
10551
10585
 
@@ -12352,20 +12386,6 @@ var typeMap = {
12352
12386
  money: 'money',
12353
12387
  share: 'share'
12354
12388
  }
12355
- },
12356
- WDT_REISSUE_GOODS: {
12357
- key: 'wdtReissueGoods',
12358
- name: '旺店通',
12359
- typeName: 'wdtReissueType',
12360
- reissueSelectList: 'wdtReissueSelectList',
12361
- reissueSelectListReturn: 'wdtReissueSelectListReturn',
12362
- reissueDeleteGood: 'wdtReissueDeleteGood',
12363
- changeShopCode: 'wdtChangeShopCode',
12364
- reissueType: 'wdtReissueType',
12365
- formatDefaultField: {
12366
- money: 'orderPrice',
12367
- share: 'sharePrice'
12368
- }
12369
12389
  }
12370
12390
  };
12371
12391
  var BsReissue = function BsReissue(props) {
@@ -12968,6 +12988,245 @@ var CommonGoods = function CommonGoods(props) {
12968
12988
  }));
12969
12989
  };
12970
12990
 
12991
+ var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
12992
+ var typeMap$1 = {
12993
+ WDT_REISSUE_GOODS: {
12994
+ key: 'wdtReissueGoods',
12995
+ name: '旺店通',
12996
+ typeName: 'wdtReissueType',
12997
+ wdtSystemOrder: 'wdtSystemOrder',
12998
+ wdtSystemOrderNo: 'wdtSystemOrderNo',
12999
+ reissueSelectList: 'wdtReissueSelectList',
13000
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
13001
+ reissueDeleteGood: 'wdtReissueDeleteGood',
13002
+ changeShopCode: 'wdtChangeShopCode',
13003
+ reissueType: 'wdtReissueType',
13004
+ formatDefaultField: {
13005
+ money: 'orderPrice',
13006
+ share: 'sharePrice'
13007
+ }
13008
+ }
13009
+ };
13010
+ var wdtReissue = function wdtReissue(props) {
13011
+ var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type11, _typeMap$type25, _typeMap$type26, _value$typeMap$type$w2, _typeMap$type27, _typeMap$type28, _typeMap$type29;
13012
+ var value = props.value,
13013
+ onChange = props.onChange,
13014
+ _props$reasonList = props.reasonList,
13015
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
13016
+ disabled = props.disabled,
13017
+ type = props.type,
13018
+ other = _objectWithoutProperties(props, _excluded$g);
13019
+ var valueRef = useRef({});
13020
+ useEffect(function () {
13021
+ var _typeMap$type, _typeMap$type4;
13022
+ valueRef.current = value;
13023
+ pubsub.subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
13024
+ if (disabled) return;
13025
+ if (value) {
13026
+ var _typeMap$type2, _typeMap$type3;
13027
+ var newValue = _objectSpread2({}, value);
13028
+ newValue["".concat((_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.key)].filter(function (item) {
13029
+ return item.sku !== data;
13030
+ });
13031
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13032
+ }
13033
+ });
13034
+ pubsub.subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
13035
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13036
+ shopCode: data.shopCode
13037
+ }));
13038
+ });
13039
+ }, [value, disabled]);
13040
+ useEffect(function () {
13041
+ var _value$orders, _value$showOrderInfo;
13042
+ if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
13043
+ if (type === 'WDT_SYSTEM_ORDER') {
13044
+ getWdtOrderList(value.orderNo);
13045
+ }
13046
+ }
13047
+ return;
13048
+ }, [value]);
13049
+ useEffect(function () {
13050
+ var _typeMap$type5;
13051
+ var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.wdtSystemOrderNo];
13052
+ if (wdtSystemOrderNo) {
13053
+ var _value$typeMap$type$t, _typeMap$type6;
13054
+ if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
13055
+ getGoodItems(wdtSystemOrderNo);
13056
+ }
13057
+ }
13058
+ return;
13059
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
13060
+ useEffect(function () {
13061
+ var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
13062
+ var typeName = value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0];
13063
+ var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.wdtSystemOrderNo];
13064
+ if (['1'].includes(typeName)) {
13065
+ wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
13066
+ } else if (['2'].includes(typeName)) {
13067
+ var _typeMap$type10;
13068
+ var newValue = _objectSpread2({}, value);
13069
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = [];
13070
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13071
+ }
13072
+ return;
13073
+ }, [value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]]);
13074
+ var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
13075
+ var _value$typeMap$type$w, _typeMap$type12, _ref;
13076
+ var orders = value === null || value === void 0 ? void 0 : (_value$typeMap$type$w = value[(_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.wdtSystemOrder]) === null || _value$typeMap$type$w === void 0 ? void 0 : _value$typeMap$type$w.orders;
13077
+ var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
13078
+ return orderItem.billNo === wdtSystemOrderNo;
13079
+ });
13080
+ if (order) {
13081
+ var _typeMap$type13, _order$goodDetails;
13082
+ var newValue = _objectSpread2({}, value);
13083
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
13084
+ var _typeMap$type14, _typeMap$type15;
13085
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.money)] = 0;
13086
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.formatDefaultField.share)] = 0;
13087
+ item.canUpdateNumber = true;
13088
+ return item;
13089
+ });
13090
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13091
+ }
13092
+ };
13093
+ var getWdtOrderList = /*#__PURE__*/function () {
13094
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
13095
+ var _yield$request, success, data, _typeMap$type16, _typeMap$type17, orders, showOrderInfo;
13096
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13097
+ while (1) switch (_context.prev = _context.next) {
13098
+ case 0:
13099
+ _context.next = 2;
13100
+ return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13101
+ method: 'post',
13102
+ data: {
13103
+ billNo: orderNo
13104
+ }
13105
+ });
13106
+ case 2:
13107
+ _yield$request = _context.sent;
13108
+ success = _yield$request.success;
13109
+ data = _yield$request.data;
13110
+ if (success) {
13111
+ orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
13112
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13113
+ billNo: item.tradeNo,
13114
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13115
+ billTag: item.tagName
13116
+ });
13117
+ });
13118
+ showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
13119
+ return {
13120
+ billNo: item.tradeNo,
13121
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13122
+ billTag: item.tagName
13123
+ };
13124
+ });
13125
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.wdtSystemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.wdtSystemOrder]), {}, {
13126
+ showOrderInfo: showOrderInfo,
13127
+ orders: orders
13128
+ }))));
13129
+ }
13130
+ case 6:
13131
+ case "end":
13132
+ return _context.stop();
13133
+ }
13134
+ }, _callee);
13135
+ }));
13136
+ return function getWdtOrderList(_x) {
13137
+ return _ref2.apply(this, arguments);
13138
+ };
13139
+ }();
13140
+ var changeTypeHandle = function changeTypeHandle(val) {
13141
+ var _typeMap$type18, _typeMap$type19;
13142
+ var newValue = _objectSpread2({}, value);
13143
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName)] = val;
13144
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = [];
13145
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13146
+ valueRef.current = newValue;
13147
+ // if (['2'].includes(val[0])) {
13148
+ // onChange?.(newValue);
13149
+ // valueRef.current = newValue;
13150
+ // }
13151
+ // pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
13152
+ // val: val[0],
13153
+ // goodValue: newValue,
13154
+ // });
13155
+ };
13156
+
13157
+ var changeGoodHandle = function changeGoodHandle(val) {
13158
+ var _typeMap$type20;
13159
+ var newValue = _objectSpread2({}, value);
13160
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = (val || []).map(function (item) {
13161
+ var _typeMap$type21, _typeMap$type22;
13162
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.formatDefaultField.money)] = 0;
13163
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.formatDefaultField.share)] = 0;
13164
+ return item;
13165
+ });
13166
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13167
+ };
13168
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
13169
+ var _typeMap$type23;
13170
+ var newValue = _objectSpread2({}, value);
13171
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.wdtSystemOrderNo)] = val;
13172
+ console.log('changeSystemOrderHandle', val, newValue);
13173
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13174
+ };
13175
+ //显示选择商品按钮 原单换不显示选择商品
13176
+ var showChangeBtn = useMemo(function () {
13177
+ var _typeMap$type24;
13178
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.wdtSystemOrderNo]);
13179
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]]);
13180
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
13181
+ gutter: 8
13182
+ }, /*#__PURE__*/React.createElement(Col, {
13183
+ className: "gutter-row",
13184
+ span: 6
13185
+ }, /*#__PURE__*/React.createElement(Select, {
13186
+ style: {
13187
+ marginBottom: '8px'
13188
+ },
13189
+ disabled: disabled,
13190
+ allowClear: false,
13191
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo)],
13192
+ onChange: function onChange(val) {
13193
+ return changeSystemOrderHandle(val);
13194
+ }
13195
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$w2 = value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.wdtSystemOrder]) === null || _value$typeMap$type$w2 === void 0 ? void 0 : _value$typeMap$type$w2.showOrderInfo) || []).map(function (item) {
13196
+ return /*#__PURE__*/React.createElement(Select.Option, {
13197
+ key: item.billNo,
13198
+ value: item.billNo,
13199
+ label: item.billNo
13200
+ }, item.billNo);
13201
+ }))), /*#__PURE__*/React.createElement(Col, {
13202
+ className: "gutter-row",
13203
+ span: 6
13204
+ }, /*#__PURE__*/React.createElement(Cascader, {
13205
+ style: {
13206
+ marginBottom: '8px'
13207
+ },
13208
+ disabled: disabled,
13209
+ allowClear: false,
13210
+ options: reasonList,
13211
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName)],
13212
+ onChange: function onChange(val) {
13213
+ return changeTypeHandle(val);
13214
+ }
13215
+ }))), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13216
+ key: 'reissueGoods'
13217
+ }, other), {}, {
13218
+ type: type,
13219
+ disabled: disabled,
13220
+ canUpdateNumber: showChangeBtn,
13221
+ showChangeBtn: showChangeBtn,
13222
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13223
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)],
13224
+ onChange: function onChange(val) {
13225
+ return changeGoodHandle(val);
13226
+ }
13227
+ })));
13228
+ };
13229
+
12971
13230
  var css_248z$a = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
12972
13231
  styleInject(css_248z$a);
12973
13232
 
@@ -13444,12 +13703,12 @@ var Goods$1 = function Goods(props, ref) {
13444
13703
  };
13445
13704
  var index$2 = /*#__PURE__*/forwardRef(Goods$1);
13446
13705
 
13447
- var _excluded$g = ["onChange", "value", "failValue"];
13706
+ var _excluded$h = ["onChange", "value", "failValue"];
13448
13707
  function CommonStatus(props) {
13449
13708
  var onChange = props.onChange,
13450
13709
  value = props.value,
13451
13710
  failValue = props.failValue,
13452
- other = _objectWithoutProperties(props, _excluded$g);
13711
+ other = _objectWithoutProperties(props, _excluded$h);
13453
13712
  var changeHandle = function changeHandle(val) {
13454
13713
  onChange === null || onChange === void 0 ? void 0 : onChange({
13455
13714
  status: val,
@@ -13568,7 +13827,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
13568
13827
  })) : null) : null);
13569
13828
  };
13570
13829
 
13571
- var _excluded$h = ["value", "onChange", "disabled", "failValue", "type"];
13830
+ var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
13572
13831
  var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13573
13832
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
13574
13833
  var _props$value = props.value,
@@ -13578,7 +13837,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13578
13837
  failValue = props.failValue,
13579
13838
  _props$type = props.type,
13580
13839
  type = _props$type === void 0 ? 1 : _props$type,
13581
- other = _objectWithoutProperties(props, _excluded$h);
13840
+ other = _objectWithoutProperties(props, _excluded$i);
13582
13841
  var _useState = useState(0),
13583
13842
  _useState2 = _slicedToArray(_useState, 2),
13584
13843
  changeIndex = _useState2[0],
@@ -13644,7 +13903,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13644
13903
  }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
13645
13904
  };
13646
13905
 
13647
- var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
13906
+ var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
13648
13907
  var msgTypeCh = {
13649
13908
  ding: '钉钉',
13650
13909
  wechat: '微信',
@@ -13660,7 +13919,7 @@ var MsgStatus = function MsgStatus(props) {
13660
13919
  failValue = props.failValue,
13661
13920
  _props$type = props.type,
13662
13921
  type = _props$type === void 0 ? 1 : _props$type,
13663
- other = _objectWithoutProperties(props, _excluded$i);
13922
+ other = _objectWithoutProperties(props, _excluded$j);
13664
13923
  var _useState = useState(0),
13665
13924
  _useState2 = _slicedToArray(_useState, 2),
13666
13925
  changeIndex = _useState2[0],
@@ -13729,4 +13988,4 @@ var CalculationInput = function CalculationInput(props) {
13729
13988
  }, config === null || config === void 0 ? void 0 : config.unit));
13730
13989
  };
13731
13990
 
13732
- 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, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
13991
+ 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, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, wdtReissue as WdtReissue, WlnGoods };
package/dist/index.js CHANGED
@@ -10434,7 +10434,7 @@ var typeInitValueMap = {
10434
10434
  }]
10435
10435
  };
10436
10436
  var jstGoods = function jstGoods(props) {
10437
- var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
10437
+ var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7, _value$changeIndex8;
10438
10438
  var _props$value = props.value,
10439
10439
  value = _props$value === void 0 ? [] : _props$value,
10440
10440
  onChange = props.onChange,
@@ -10442,17 +10442,25 @@ var jstGoods = function jstGoods(props) {
10442
10442
  _props$type = props.type,
10443
10443
  type = _props$type === void 0 ? 1 : _props$type,
10444
10444
  _props$showField = props.showField,
10445
- showField = _props$showField === void 0 ? '' : _props$showField;
10445
+ showField = _props$showField === void 0 ? '' : _props$showField,
10446
+ _props$componentType = props.componentType,
10447
+ componentType = _props$componentType === void 0 ? '' : _props$componentType;
10446
10448
  var _useState = React.useState(0),
10447
10449
  _useState2 = _slicedToArray(_useState, 2),
10448
10450
  changeIndex = _useState2[0],
10449
10451
  setChangeIndex = _useState2[1]; //选中的包裹
10452
+ var _useState3 = React.useState([]),
10453
+ _useState4 = _slicedToArray(_useState3, 2),
10454
+ wdtSendOptions = _useState4[0],
10455
+ setSendOptions = _useState4[1];
10450
10456
  React.useEffect(function () {
10451
10457
  //没有值塞个默认值
10452
10458
  if (!(value === null || value === void 0 ? void 0 : value.length)) {
10453
10459
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10454
10460
  }
10455
10461
  }, [value, type]);
10462
+ React.useEffect(function () {
10463
+ }, []);
10456
10464
  var content = function content(item, index) {
10457
10465
  return /*#__PURE__*/React__default['default'].createElement("div", {
10458
10466
  style: {
@@ -10473,6 +10481,18 @@ var jstGoods = function jstGoods(props) {
10473
10481
  }), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", null, t.title), /*#__PURE__*/React__default['default'].createElement("div", null, "\u7F16\u7801\uFF1A", t.skuId))));
10474
10482
  }));
10475
10483
  };
10484
+ var handleSelected = function handleSelected(val, type, option) {
10485
+ var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
10486
+ changeOrderInfo[type] = val;
10487
+ changeOrderInfo['sendId'] = option.warehouseNo;
10488
+ var newList = _toConsumableArray(value);
10489
+ newList[changeIndex] = changeOrderInfo;
10490
+ onChange === null || onChange === void 0 ? void 0 : onChange(newList);
10491
+ };
10492
+ var filterOption = function filterOption(input, option) {
10493
+ var _option$label;
10494
+ return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').includes(input);
10495
+ };
10476
10496
  var changeInputHandle = function changeInputHandle(val, type) {
10477
10497
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
10478
10498
  changeOrderInfo[type] = val;
@@ -10543,20 +10563,34 @@ var jstGoods = function jstGoods(props) {
10543
10563
  return changeInputHandle(e.target.value, 'sendId');
10544
10564
  },
10545
10565
  value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
10546
- }), ['sendName', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10566
+ }), ['sendName', 'all'].includes(showField) && (componentType === 'WDT_SEND_GOOD' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
10567
+ style: {
10568
+ minWidth: '100px',
10569
+ maxWidth: '180px'
10570
+ },
10571
+ disabled: disabled,
10572
+ placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
10573
+ showSearch: true,
10574
+ options: wdtSendOptions,
10575
+ filterOption: filterOption,
10576
+ value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName,
10577
+ onChange: function onChange(value, option) {
10578
+ return handleSelected(value, 'sendName', option);
10579
+ }
10580
+ }) : /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10547
10581
  disabled: disabled,
10548
10582
  placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u540D\u79F0",
10549
10583
  onChange: function onChange(e) {
10550
10584
  return changeInputHandle(e.target.value, 'sendName');
10551
10585
  },
10552
- value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName
10553
- })) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10586
+ value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
10587
+ }))) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
10554
10588
  disabled: disabled,
10555
10589
  placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
10556
10590
  onChange: function onChange(e) {
10557
10591
  return changeInputHandle(e.target.value, 'deliveryNo');
10558
10592
  },
10559
- value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
10593
+ value: (_value$changeIndex8 = value[changeIndex]) === null || _value$changeIndex8 === void 0 ? void 0 : _value$changeIndex8.sendName
10560
10594
  })) : null) : null);
10561
10595
  };
10562
10596
 
@@ -12363,20 +12397,6 @@ var typeMap = {
12363
12397
  money: 'money',
12364
12398
  share: 'share'
12365
12399
  }
12366
- },
12367
- WDT_REISSUE_GOODS: {
12368
- key: 'wdtReissueGoods',
12369
- name: '旺店通',
12370
- typeName: 'wdtReissueType',
12371
- reissueSelectList: 'wdtReissueSelectList',
12372
- reissueSelectListReturn: 'wdtReissueSelectListReturn',
12373
- reissueDeleteGood: 'wdtReissueDeleteGood',
12374
- changeShopCode: 'wdtChangeShopCode',
12375
- reissueType: 'wdtReissueType',
12376
- formatDefaultField: {
12377
- money: 'orderPrice',
12378
- share: 'sharePrice'
12379
- }
12380
12400
  }
12381
12401
  };
12382
12402
  var BsReissue = function BsReissue(props) {
@@ -12979,6 +12999,245 @@ var CommonGoods = function CommonGoods(props) {
12979
12999
  }));
12980
13000
  };
12981
13001
 
13002
+ var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
13003
+ var typeMap$1 = {
13004
+ WDT_REISSUE_GOODS: {
13005
+ key: 'wdtReissueGoods',
13006
+ name: '旺店通',
13007
+ typeName: 'wdtReissueType',
13008
+ wdtSystemOrder: 'wdtSystemOrder',
13009
+ wdtSystemOrderNo: 'wdtSystemOrderNo',
13010
+ reissueSelectList: 'wdtReissueSelectList',
13011
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
13012
+ reissueDeleteGood: 'wdtReissueDeleteGood',
13013
+ changeShopCode: 'wdtChangeShopCode',
13014
+ reissueType: 'wdtReissueType',
13015
+ formatDefaultField: {
13016
+ money: 'orderPrice',
13017
+ share: 'sharePrice'
13018
+ }
13019
+ }
13020
+ };
13021
+ var wdtReissue = function wdtReissue(props) {
13022
+ var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type11, _typeMap$type25, _typeMap$type26, _value$typeMap$type$w2, _typeMap$type27, _typeMap$type28, _typeMap$type29;
13023
+ var value = props.value,
13024
+ onChange = props.onChange,
13025
+ _props$reasonList = props.reasonList,
13026
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
13027
+ disabled = props.disabled,
13028
+ type = props.type,
13029
+ other = _objectWithoutProperties(props, _excluded$g);
13030
+ var valueRef = React.useRef({});
13031
+ React.useEffect(function () {
13032
+ var _typeMap$type, _typeMap$type4;
13033
+ valueRef.current = value;
13034
+ pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
13035
+ if (disabled) return;
13036
+ if (value) {
13037
+ var _typeMap$type2, _typeMap$type3;
13038
+ var newValue = _objectSpread2({}, value);
13039
+ newValue["".concat((_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.key)].filter(function (item) {
13040
+ return item.sku !== data;
13041
+ });
13042
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13043
+ }
13044
+ });
13045
+ pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
13046
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13047
+ shopCode: data.shopCode
13048
+ }));
13049
+ });
13050
+ }, [value, disabled]);
13051
+ React.useEffect(function () {
13052
+ var _value$orders, _value$showOrderInfo;
13053
+ if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
13054
+ if (type === 'WDT_SYSTEM_ORDER') {
13055
+ getWdtOrderList(value.orderNo);
13056
+ }
13057
+ }
13058
+ return;
13059
+ }, [value]);
13060
+ React.useEffect(function () {
13061
+ var _typeMap$type5;
13062
+ var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.wdtSystemOrderNo];
13063
+ if (wdtSystemOrderNo) {
13064
+ var _value$typeMap$type$t, _typeMap$type6;
13065
+ if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
13066
+ getGoodItems(wdtSystemOrderNo);
13067
+ }
13068
+ }
13069
+ return;
13070
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
13071
+ React.useEffect(function () {
13072
+ var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
13073
+ var typeName = value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0];
13074
+ var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.wdtSystemOrderNo];
13075
+ if (['1'].includes(typeName)) {
13076
+ wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
13077
+ } else if (['2'].includes(typeName)) {
13078
+ var _typeMap$type10;
13079
+ var newValue = _objectSpread2({}, value);
13080
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = [];
13081
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13082
+ }
13083
+ return;
13084
+ }, [value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]]);
13085
+ var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
13086
+ var _value$typeMap$type$w, _typeMap$type12, _ref;
13087
+ var orders = value === null || value === void 0 ? void 0 : (_value$typeMap$type$w = value[(_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.wdtSystemOrder]) === null || _value$typeMap$type$w === void 0 ? void 0 : _value$typeMap$type$w.orders;
13088
+ var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
13089
+ return orderItem.billNo === wdtSystemOrderNo;
13090
+ });
13091
+ if (order) {
13092
+ var _typeMap$type13, _order$goodDetails;
13093
+ var newValue = _objectSpread2({}, value);
13094
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
13095
+ var _typeMap$type14, _typeMap$type15;
13096
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.money)] = 0;
13097
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.formatDefaultField.share)] = 0;
13098
+ item.canUpdateNumber = true;
13099
+ return item;
13100
+ });
13101
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13102
+ }
13103
+ };
13104
+ var getWdtOrderList = /*#__PURE__*/function () {
13105
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
13106
+ var _yield$request, success, data, _typeMap$type16, _typeMap$type17, orders, showOrderInfo;
13107
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
13108
+ while (1) switch (_context.prev = _context.next) {
13109
+ case 0:
13110
+ _context.next = 2;
13111
+ return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13112
+ method: 'post',
13113
+ data: {
13114
+ billNo: orderNo
13115
+ }
13116
+ });
13117
+ case 2:
13118
+ _yield$request = _context.sent;
13119
+ success = _yield$request.success;
13120
+ data = _yield$request.data;
13121
+ if (success) {
13122
+ orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
13123
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13124
+ billNo: item.tradeNo,
13125
+ billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13126
+ billTag: item.tagName
13127
+ });
13128
+ });
13129
+ showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
13130
+ return {
13131
+ billNo: item.tradeNo,
13132
+ billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13133
+ billTag: item.tagName
13134
+ };
13135
+ });
13136
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.wdtSystemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.wdtSystemOrder]), {}, {
13137
+ showOrderInfo: showOrderInfo,
13138
+ orders: orders
13139
+ }))));
13140
+ }
13141
+ case 6:
13142
+ case "end":
13143
+ return _context.stop();
13144
+ }
13145
+ }, _callee);
13146
+ }));
13147
+ return function getWdtOrderList(_x) {
13148
+ return _ref2.apply(this, arguments);
13149
+ };
13150
+ }();
13151
+ var changeTypeHandle = function changeTypeHandle(val) {
13152
+ var _typeMap$type18, _typeMap$type19;
13153
+ var newValue = _objectSpread2({}, value);
13154
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName)] = val;
13155
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = [];
13156
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13157
+ valueRef.current = newValue;
13158
+ // if (['2'].includes(val[0])) {
13159
+ // onChange?.(newValue);
13160
+ // valueRef.current = newValue;
13161
+ // }
13162
+ // pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
13163
+ // val: val[0],
13164
+ // goodValue: newValue,
13165
+ // });
13166
+ };
13167
+
13168
+ var changeGoodHandle = function changeGoodHandle(val) {
13169
+ var _typeMap$type20;
13170
+ var newValue = _objectSpread2({}, value);
13171
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = (val || []).map(function (item) {
13172
+ var _typeMap$type21, _typeMap$type22;
13173
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.formatDefaultField.money)] = 0;
13174
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.formatDefaultField.share)] = 0;
13175
+ return item;
13176
+ });
13177
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13178
+ };
13179
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
13180
+ var _typeMap$type23;
13181
+ var newValue = _objectSpread2({}, value);
13182
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.wdtSystemOrderNo)] = val;
13183
+ console.log('changeSystemOrderHandle', val, newValue);
13184
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
13185
+ };
13186
+ //显示选择商品按钮 原单换不显示选择商品
13187
+ var showChangeBtn = React.useMemo(function () {
13188
+ var _typeMap$type24;
13189
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.wdtSystemOrderNo]);
13190
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]]);
13191
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
13192
+ gutter: 8
13193
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
13194
+ className: "gutter-row",
13195
+ span: 6
13196
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
13197
+ style: {
13198
+ marginBottom: '8px'
13199
+ },
13200
+ disabled: disabled,
13201
+ allowClear: false,
13202
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo)],
13203
+ onChange: function onChange(val) {
13204
+ return changeSystemOrderHandle(val);
13205
+ }
13206
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$w2 = value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.wdtSystemOrder]) === null || _value$typeMap$type$w2 === void 0 ? void 0 : _value$typeMap$type$w2.showOrderInfo) || []).map(function (item) {
13207
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
13208
+ key: item.billNo,
13209
+ value: item.billNo,
13210
+ label: item.billNo
13211
+ }, item.billNo);
13212
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
13213
+ className: "gutter-row",
13214
+ span: 6
13215
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
13216
+ style: {
13217
+ marginBottom: '8px'
13218
+ },
13219
+ disabled: disabled,
13220
+ allowClear: false,
13221
+ options: reasonList,
13222
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName)],
13223
+ onChange: function onChange(val) {
13224
+ return changeTypeHandle(val);
13225
+ }
13226
+ }))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13227
+ key: 'reissueGoods'
13228
+ }, other), {}, {
13229
+ type: type,
13230
+ disabled: disabled,
13231
+ canUpdateNumber: showChangeBtn,
13232
+ showChangeBtn: showChangeBtn,
13233
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
13234
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)],
13235
+ onChange: function onChange(val) {
13236
+ return changeGoodHandle(val);
13237
+ }
13238
+ })));
13239
+ };
13240
+
12982
13241
  var css_248z$a = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
12983
13242
  styleInject(css_248z$a);
12984
13243
 
@@ -13455,12 +13714,12 @@ var Goods$1 = function Goods(props, ref) {
13455
13714
  };
13456
13715
  var index$2 = /*#__PURE__*/React.forwardRef(Goods$1);
13457
13716
 
13458
- var _excluded$g = ["onChange", "value", "failValue"];
13717
+ var _excluded$h = ["onChange", "value", "failValue"];
13459
13718
  function CommonStatus(props) {
13460
13719
  var onChange = props.onChange,
13461
13720
  value = props.value,
13462
13721
  failValue = props.failValue,
13463
- other = _objectWithoutProperties(props, _excluded$g);
13722
+ other = _objectWithoutProperties(props, _excluded$h);
13464
13723
  var changeHandle = function changeHandle(val) {
13465
13724
  onChange === null || onChange === void 0 ? void 0 : onChange({
13466
13725
  status: val,
@@ -13579,7 +13838,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
13579
13838
  })) : null) : null);
13580
13839
  };
13581
13840
 
13582
- var _excluded$h = ["value", "onChange", "disabled", "failValue", "type"];
13841
+ var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
13583
13842
  var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13584
13843
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
13585
13844
  var _props$value = props.value,
@@ -13589,7 +13848,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13589
13848
  failValue = props.failValue,
13590
13849
  _props$type = props.type,
13591
13850
  type = _props$type === void 0 ? 1 : _props$type,
13592
- other = _objectWithoutProperties(props, _excluded$h);
13851
+ other = _objectWithoutProperties(props, _excluded$i);
13593
13852
  var _useState = React.useState(0),
13594
13853
  _useState2 = _slicedToArray(_useState, 2),
13595
13854
  changeIndex = _useState2[0],
@@ -13655,7 +13914,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
13655
13914
  }, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
13656
13915
  };
13657
13916
 
13658
- var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
13917
+ var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
13659
13918
  var msgTypeCh = {
13660
13919
  ding: '钉钉',
13661
13920
  wechat: '微信',
@@ -13671,7 +13930,7 @@ var MsgStatus = function MsgStatus(props) {
13671
13930
  failValue = props.failValue,
13672
13931
  _props$type = props.type,
13673
13932
  type = _props$type === void 0 ? 1 : _props$type,
13674
- other = _objectWithoutProperties(props, _excluded$i);
13933
+ other = _objectWithoutProperties(props, _excluded$j);
13675
13934
  var _useState = React.useState(0),
13676
13935
  _useState2 = _slicedToArray(_useState, 2),
13677
13936
  changeIndex = _useState2[0],
@@ -13794,4 +14053,5 @@ exports.Supplier = Supplier;
13794
14053
  exports.TBGoodId = TBGoodId;
13795
14054
  exports.TBGoodSerial = TBGoodSerial;
13796
14055
  exports.TradeId = TradeId;
14056
+ exports.WdtReissue = wdtReissue;
13797
14057
  exports.WlnGoods = WlnGoods;
@@ -45,6 +45,7 @@ export { default as BsReturn } from './bs/Return';
45
45
  export { default as BsSystemOrder } from './bs/SystemOrder';
46
46
  export { default as WlnGoods } from './wln/Goods';
47
47
  export { default as CommonGoods } from './common/CommonGoods';
48
+ export { default as WdtReissue } from './wdt/Reissue';
48
49
  export { default as GoodsTable } from './common/GoodsTable';
49
50
  export { default as CommonStatus } from './common/CommonStatus';
50
51
  export { default as CommonSystemOrder } from './common/CommonSystemOrder';
@@ -6,6 +6,7 @@ interface JstGoodsProps {
6
6
  disabled: boolean;
7
7
  onChange: (val: any[]) => void;
8
8
  showField: string;
9
+ componentType?: string;
9
10
  }
10
11
  declare const jstGoods: (props: Partial<JstGoodsProps>) => React.JSX.Element;
11
12
  export default jstGoods;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const wdtReissue: (props: any) => React.JSX.Element;
3
+ export default wdtReissue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.29.1-rc.9",
3
+ "version": "0.29.2-rc.0",
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.29.1-rc.0",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.29.2-rc.0",
24
24
  "ahooks": "^3.7.4",
25
25
  "kmkf-monitor": "^0.8.8",
26
26
  "lodash": "^4.17.21",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "cc7333a75e7bec0ffa98f8d707eff2cf0b95a62b"
67
+ "gitHead": "eed63a70fe1fb8dd114b3fb525a415f68427ea49"
68
68
  }