@kmkf-fe-packages/basic-components 2.0.54-beta.43 → 2.0.54-beta.45

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
@@ -3,8 +3,8 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseOutlined, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, MinusCircleFilled } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, WdtAddressData, GyAddressData, request as request$1, ExpressData, uuid, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, servers, filterJstOrders, filterKmOrders, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog } from '@kmkf-fe-packages/kmkf-utils';
7
- import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, isBoolean, isEqual, takeRight, reject, isEmpty, intersection, uniqBy } from 'lodash';
6
+ import { AddressData, BsAddressData, WdtAddressData, GyAddressData, request as request$1, ExpressData, uuid, servers, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterKmOrders, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog } from '@kmkf-fe-packages/kmkf-utils';
7
+ import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, uniqBy, cloneDeep, difference, differenceWith, isBoolean, isEqual, takeRight, reject, isEmpty, intersection } from 'lodash';
8
8
  import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
9
9
  import zhCN from 'antd/lib/locale/zh_CN';
10
10
  import pubsub from 'pubsub-js';
@@ -8131,17 +8131,16 @@ var SubForm = function SubForm(props) {
8131
8131
  return [{
8132
8132
  dataIndex: 'index',
8133
8133
  title: '序号',
8134
+ fixed: 'left',
8135
+ width: 20,
8134
8136
  render: function render(val, record, index) {
8135
- return /*#__PURE__*/React.createElement("div", {
8136
- style: {
8137
- width: 25
8138
- }
8139
- }, index + 1);
8137
+ return index + 1;
8140
8138
  }
8141
8139
  }].concat(_toConsumableArray(newTableHeader.map(function (t) {
8142
8140
  return {
8143
8141
  dataIndex: t.key,
8144
- title: t.name
8142
+ title: t.name,
8143
+ width: 90
8145
8144
  };
8146
8145
  })));
8147
8146
  }, [newTableHeader]);
@@ -8329,7 +8328,7 @@ var SubForm = function SubForm(props) {
8329
8328
  onScrollCapture: onScrollCapture,
8330
8329
  style: {
8331
8330
  height: 320,
8332
- maxWidth: platform !== 'pc' ? '325px' : '100%',
8331
+ maxWidth: platform !== 'pc' ? '325px' : '700px',
8333
8332
  overflowY: 'scroll',
8334
8333
  overflowX: 'auto'
8335
8334
  }
@@ -8340,7 +8339,7 @@ var SubForm = function SubForm(props) {
8340
8339
  size: "small",
8341
8340
  pagination: false,
8342
8341
  scroll: {
8343
- x: '100%'
8342
+ x: 'max-content'
8344
8343
  },
8345
8344
  locale: {
8346
8345
  emptyText: '暂无数据'
@@ -8713,7 +8712,9 @@ var GoodsModal = function GoodsModal(props) {
8713
8712
  changeSku = props.changeSku,
8714
8713
  width = props.width,
8715
8714
  _props$numIidType = props.numIidType,
8716
- numIidType = _props$numIidType === void 0 ? 'string' : _props$numIidType;
8715
+ numIidType = _props$numIidType === void 0 ? 'string' : _props$numIidType,
8716
+ form = props.form,
8717
+ isPriorityDisplayOfOrderNo = props.isPriorityDisplayOfOrderNo;
8717
8718
  var _useState = useState([]),
8718
8719
  _useState2 = _slicedToArray(_useState, 2),
8719
8720
  selectList = _useState2[0],
@@ -8726,10 +8727,14 @@ var GoodsModal = function GoodsModal(props) {
8726
8727
  _useState6 = _slicedToArray(_useState5, 2),
8727
8728
  goodList = _useState6[0],
8728
8729
  setGoodList = _useState6[1];
8729
- var _useState7 = useState(false),
8730
+ var _useState7 = useState([]),
8730
8731
  _useState8 = _slicedToArray(_useState7, 2),
8731
- loading = _useState8[0],
8732
- setLoading = _useState8[1];
8732
+ orderNoItems = _useState8[0],
8733
+ setOrderNoItems = _useState8[1];
8734
+ var _useState9 = useState(false),
8735
+ _useState10 = _slicedToArray(_useState9, 2),
8736
+ loading = _useState10[0],
8737
+ setLoading = _useState10[1];
8733
8738
  var transformIdType = function transformIdType(id) {
8734
8739
  if (!['string', 'number'].includes(_typeof(id))) return id;
8735
8740
  return numIidType === 'string' ? id + '' : +id;
@@ -8749,7 +8754,7 @@ var GoodsModal = function GoodsModal(props) {
8749
8754
  var handleSetGoodList = function handleSetGoodList(list) {
8750
8755
  return setGoodList(list.map(transformType));
8751
8756
  };
8752
- var _useState9 = useState({
8757
+ var _useState11 = useState({
8753
8758
  apiName: 'queryItems',
8754
8759
  desc: true,
8755
8760
  numIids: '',
@@ -8761,30 +8766,30 @@ var GoodsModal = function GoodsModal(props) {
8761
8766
  cids: '',
8762
8767
  title: ''
8763
8768
  }),
8764
- _useState10 = _slicedToArray(_useState9, 2),
8765
- searchParams = _useState10[0],
8766
- setSearch = _useState10[1];
8767
- var _useState11 = useState(0),
8768
8769
  _useState12 = _slicedToArray(_useState11, 2),
8769
- total = _useState12[0],
8770
- setTotal = _useState12[1];
8771
- var _useState13 = useState(''),
8770
+ searchParams = _useState12[0],
8771
+ setSearch = _useState12[1];
8772
+ var _useState13 = useState(0),
8772
8773
  _useState14 = _slicedToArray(_useState13, 2),
8773
- platform = _useState14[0],
8774
- setPlatform = _useState14[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
8775
- var _useState15 = useState({}),
8774
+ total = _useState14[0],
8775
+ setTotal = _useState14[1];
8776
+ var _useState15 = useState(''),
8776
8777
  _useState16 = _slicedToArray(_useState15, 2),
8777
- shopInfo = _useState16[0],
8778
- setShopInfo = _useState16[1]; //店铺信息
8779
- var _useState17 = useState(true),
8778
+ platform = _useState16[0],
8779
+ setPlatform = _useState16[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
8780
+ var _useState17 = useState({}),
8780
8781
  _useState18 = _slicedToArray(_useState17, 2),
8781
- canSearch = _useState18[0],
8782
- setCanSearch = _useState18[1];
8783
- var _useState19 = useState([null]),
8782
+ shopInfo = _useState18[0],
8783
+ setShopInfo = _useState18[1]; //店铺信息
8784
+ var _useState19 = useState(true),
8784
8785
  _useState20 = _slicedToArray(_useState19, 2),
8785
- nextKeyList = _useState20[0],
8786
- setNextKeyList = _useState20[1];
8787
- var _useState21 = useState([{
8786
+ canSearch = _useState20[0],
8787
+ setCanSearch = _useState20[1];
8788
+ var _useState21 = useState([null]),
8789
+ _useState22 = _slicedToArray(_useState21, 2),
8790
+ nextKeyList = _useState22[0],
8791
+ setNextKeyList = _useState22[1];
8792
+ var _useState23 = useState([{
8788
8793
  tab: '出售中',
8789
8794
  key: 'onSale'
8790
8795
  }, {
@@ -8794,10 +8799,10 @@ var GoodsModal = function GoodsModal(props) {
8794
8799
  tab: '已选择',
8795
8800
  key: 'select'
8796
8801
  }]),
8797
- _useState22 = _slicedToArray(_useState21, 2),
8798
- tabs = _useState22[0],
8799
- setTabs = _useState22[1];
8800
- var _useState23 = useState([{
8802
+ _useState24 = _slicedToArray(_useState23, 2),
8803
+ tabs = _useState24[0],
8804
+ setTabs = _useState24[1];
8805
+ var _useState25 = useState([{
8801
8806
  name: '上架时间',
8802
8807
  value: 'list_time'
8803
8808
  }, {
@@ -8807,13 +8812,13 @@ var GoodsModal = function GoodsModal(props) {
8807
8812
  name: '按价格',
8808
8813
  value: 'price'
8809
8814
  }]),
8810
- _useState24 = _slicedToArray(_useState23, 1),
8811
- goodSort = _useState24[0];
8815
+ _useState26 = _slicedToArray(_useState25, 1),
8816
+ goodSort = _useState26[0];
8812
8817
  //宝贝分类
8813
- var _useState25 = useState([]),
8814
- _useState26 = _slicedToArray(_useState25, 2),
8815
- shell = _useState26[0],
8816
- setShell = _useState26[1];
8818
+ var _useState27 = useState([]),
8819
+ _useState28 = _slicedToArray(_useState27, 2),
8820
+ shell = _useState28[0],
8821
+ setShell = _useState28[1];
8817
8822
  var clickOrder = function clickOrder(sort) {
8818
8823
  if (sort.value === searchParams.orderBy) {
8819
8824
  setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
@@ -9086,8 +9091,112 @@ var GoodsModal = function GoodsModal(props) {
9086
9091
  }
9087
9092
  }, [platform]);
9088
9093
  useEffect(function () {
9089
- platform && canSearch && getItem(searchParams, platform);
9094
+ if (platform && canSearch) {
9095
+ if (searchParams.type === 'orderProduct') {
9096
+ getOrderProductItem(searchParams);
9097
+ } else {
9098
+ getItem(searchParams, platform);
9099
+ }
9100
+ }
9090
9101
  }, [searchParams, platform]);
9102
+ useEffect(function () {
9103
+ if (visible && platform !== 'fxg') {
9104
+ var val = (form === null || form === void 0 ? void 0 : form.getFieldsValue()) || {};
9105
+ var orderNo = val['m3ap1EvEyd'];
9106
+ if (orderNo) {
9107
+ setTabs(function (prev) {
9108
+ return uniqBy([{
9109
+ tab: '订单商品',
9110
+ key: 'orderProduct'
9111
+ }].concat(_toConsumableArray(prev)), 'key');
9112
+ });
9113
+ if (isPriorityDisplayOfOrderNo) {
9114
+ setSearch(function (prev) {
9115
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
9116
+ type: 'orderProduct'
9117
+ });
9118
+ });
9119
+ }
9120
+ }
9121
+ }
9122
+ if (!visible) {
9123
+ setOrderNoItems([]);
9124
+ }
9125
+ }, [visible]);
9126
+ var getOrderProductItem = /*#__PURE__*/function () {
9127
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
9128
+ var val, orderNo, shopId, res, items, totalCount, pageNo, pageSize, _pageNo, _pageSize, title, _items;
9129
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9130
+ while (1) switch (_context2.prev = _context2.next) {
9131
+ case 0:
9132
+ val = (form === null || form === void 0 ? void 0 : form.getFieldsValue()) || {};
9133
+ orderNo = val.m3ap1EvEyd, shopId = val.shopId;
9134
+ if (orderNo) {
9135
+ _context2.next = 4;
9136
+ break;
9137
+ }
9138
+ return _context2.abrupt("return", handleSetGoodList([]));
9139
+ case 4:
9140
+ if (orderNoItems.length) {
9141
+ _context2.next = 20;
9142
+ break;
9143
+ }
9144
+ _context2.prev = 5;
9145
+ setLoading(true);
9146
+ _context2.next = 9;
9147
+ return servers.orderDetail({
9148
+ shopId: shopId,
9149
+ orderNo: orderNo
9150
+ });
9151
+ case 9:
9152
+ res = _context2.sent;
9153
+ if (res.success) {
9154
+ _context2.next = 14;
9155
+ break;
9156
+ }
9157
+ handleSetGoodList([]);
9158
+ message.warn(res.message);
9159
+ return _context2.abrupt("return");
9160
+ case 14:
9161
+ if (res.data && res.data.itemList && res.data.itemList.length) {
9162
+ items = res.data.itemList;
9163
+ totalCount = items.length;
9164
+ items.forEach(function (item) {
9165
+ item.platform = platform;
9166
+ });
9167
+ setOrderNoItems(items);
9168
+ pageNo = params.pageNo, pageSize = params.pageSize;
9169
+ handleSetGoodList(_toConsumableArray(items.slice((pageNo - 1) * pageSize, pageNo * pageSize)));
9170
+ setTotal(totalCount);
9171
+ }
9172
+ case 15:
9173
+ _context2.prev = 15;
9174
+ setLoading(false);
9175
+ return _context2.finish(15);
9176
+ case 18:
9177
+ _context2.next = 26;
9178
+ break;
9179
+ case 20:
9180
+ _pageNo = params.pageNo, _pageSize = params.pageSize;
9181
+ title = params.title;
9182
+ if (platform !== 'taobao') {
9183
+ title = params.numIids;
9184
+ }
9185
+ _items = title ? orderNoItems.filter(function (item) {
9186
+ return item.title.includes(title.trim());
9187
+ }) : orderNoItems;
9188
+ handleSetGoodList(_toConsumableArray(_items.slice((_pageNo - 1) * _pageSize, _pageNo * _pageSize)));
9189
+ setTotal(_items.length);
9190
+ case 26:
9191
+ case "end":
9192
+ return _context2.stop();
9193
+ }
9194
+ }, _callee2, null, [[5,, 15, 18]]);
9195
+ }));
9196
+ return function getOrderProductItem(_x2) {
9197
+ return _ref4.apply(this, arguments);
9198
+ };
9199
+ }();
9091
9200
  return /*#__PURE__*/React.createElement(Modal, {
9092
9201
  title: '选择宝贝',
9093
9202
  okText: '确认',
@@ -9121,7 +9230,7 @@ var GoodsModal = function GoodsModal(props) {
9121
9230
  style: {
9122
9231
  display: searchParams.type === 'select' ? 'none' : ''
9123
9232
  }
9124
- }, platform === 'taobao' && /*#__PURE__*/React.createElement(Radio.Group, {
9233
+ }, /*#__PURE__*/React.createElement("div", null, platform === 'taobao' && searchParams.type !== 'orderProduct' && /*#__PURE__*/React.createElement(Radio.Group, {
9125
9234
  value: searchParams.orderBy,
9126
9235
  onChange: function onChange(e) {
9127
9236
  setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
@@ -9137,7 +9246,7 @@ var GoodsModal = function GoodsModal(props) {
9137
9246
  },
9138
9247
  key: sort.value
9139
9248
  }, sort.name, sort.value === searchParams.orderBy ? searchParams.desc ? /*#__PURE__*/React.createElement("span", null, "\u21BE") : /*#__PURE__*/React.createElement("span", null, "\u21C2") : /*#__PURE__*/React.createElement("span", null, "\u21C5"));
9140
- })), /*#__PURE__*/React.createElement("div", null, platform === 'taobao' && /*#__PURE__*/React.createElement(Select, {
9249
+ }))), /*#__PURE__*/React.createElement("div", null, platform === 'taobao' && searchParams.type !== 'orderProduct' && /*#__PURE__*/React.createElement(Select, {
9141
9250
  className: "classify",
9142
9251
  value: searchParams.cids,
9143
9252
  onChange: function onChange(value) {
@@ -9152,7 +9261,7 @@ var GoodsModal = function GoodsModal(props) {
9152
9261
  key: item.value
9153
9262
  }, item.label);
9154
9263
  })), /*#__PURE__*/React.createElement(Search, {
9155
- placeholder: platform === 'taobao' ? '宝贝链接,标题' : '商品ID',
9264
+ placeholder: searchParams.type !== 'orderProduct' ? platform === 'taobao' ? '宝贝链接,标题' : '商品ID' : '宝贝标题',
9156
9265
  // enterButton="搜索"
9157
9266
  className: "search",
9158
9267
  value: platform === 'taobao' ? searchParams.title : searchParams.numIids,
@@ -9775,7 +9884,9 @@ var GoodItem = function GoodItem(props) {
9775
9884
  userNick = props.userNick,
9776
9885
  disabled = props.disabled,
9777
9886
  changeSku = props.changeSku,
9778
- width = props.width;
9887
+ width = props.width,
9888
+ form = props.form,
9889
+ isPriorityDisplayOfOrderNo = props.isPriorityDisplayOfOrderNo;
9779
9890
  var shopId = value.shopId,
9780
9891
  imgList = value.imgList;
9781
9892
  var _useState = useState(false),
@@ -9866,7 +9977,7 @@ var GoodItem = function GoodItem(props) {
9866
9977
  var onSubmit = /*#__PURE__*/function () {
9867
9978
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
9868
9979
  var _list$;
9869
- var newList, newImgList;
9980
+ var newList, newImgList, _list$2;
9870
9981
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9871
9982
  while (1) switch (_context2.prev = _context2.next) {
9872
9983
  case 0:
@@ -9888,7 +9999,11 @@ var GoodItem = function GoodItem(props) {
9888
9999
  // if (type === 1) {
9889
10000
  // params.outerId = item.outerId; //编码
9890
10001
  // }
9891
- if (changeSku) {
10002
+ //返填商品属性 && 为订单商品
10003
+ if (changeSku && item.skuInfoDTO) {
10004
+ params.outerSkuId = item.skuInfoDTO.outerSkuId;
10005
+ params.propertiesName = item.skuInfoDTO.propertiesName;
10006
+ } else if (changeSku) {
9892
10007
  params.propertiesName = '';
9893
10008
  }
9894
10009
  // if (type === 4) {
@@ -9907,7 +10022,9 @@ var GoodItem = function GoodItem(props) {
9907
10022
  imgList: newImgList
9908
10023
  });
9909
10024
  setVisible(false);
9910
- checkSkus(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.numIid, newImgList.length - 1);
10025
+ if (!(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.skuInfoDTO)) {
10026
+ checkSkus(list === null || list === void 0 ? void 0 : (_list$2 = list[0]) === null || _list$2 === void 0 ? void 0 : _list$2.numIid, newImgList.length - 1);
10027
+ }
9911
10028
  case 5:
9912
10029
  case "end":
9913
10030
  return _context2.stop();
@@ -10164,6 +10281,8 @@ var GoodItem = function GoodItem(props) {
10164
10281
  shopId: shopId,
10165
10282
  maxLength: maxLength,
10166
10283
  changeSku: changeSku,
10284
+ form: form,
10285
+ isPriorityDisplayOfOrderNo: isPriorityDisplayOfOrderNo,
10167
10286
  onCancel: function onCancel() {
10168
10287
  setVisible(false);
10169
10288
  }
package/dist/index.js CHANGED
@@ -8143,17 +8143,16 @@ var SubForm = function SubForm(props) {
8143
8143
  return [{
8144
8144
  dataIndex: 'index',
8145
8145
  title: '序号',
8146
+ fixed: 'left',
8147
+ width: 20,
8146
8148
  render: function render(val, record, index) {
8147
- return /*#__PURE__*/React__default['default'].createElement("div", {
8148
- style: {
8149
- width: 25
8150
- }
8151
- }, index + 1);
8149
+ return index + 1;
8152
8150
  }
8153
8151
  }].concat(_toConsumableArray(newTableHeader.map(function (t) {
8154
8152
  return {
8155
8153
  dataIndex: t.key,
8156
- title: t.name
8154
+ title: t.name,
8155
+ width: 90
8157
8156
  };
8158
8157
  })));
8159
8158
  }, [newTableHeader]);
@@ -8341,7 +8340,7 @@ var SubForm = function SubForm(props) {
8341
8340
  onScrollCapture: onScrollCapture,
8342
8341
  style: {
8343
8342
  height: 320,
8344
- maxWidth: platform !== 'pc' ? '325px' : '100%',
8343
+ maxWidth: platform !== 'pc' ? '325px' : '700px',
8345
8344
  overflowY: 'scroll',
8346
8345
  overflowX: 'auto'
8347
8346
  }
@@ -8352,7 +8351,7 @@ var SubForm = function SubForm(props) {
8352
8351
  size: "small",
8353
8352
  pagination: false,
8354
8353
  scroll: {
8355
- x: '100%'
8354
+ x: 'max-content'
8356
8355
  },
8357
8356
  locale: {
8358
8357
  emptyText: '暂无数据'
@@ -8725,7 +8724,9 @@ var GoodsModal = function GoodsModal(props) {
8725
8724
  changeSku = props.changeSku,
8726
8725
  width = props.width,
8727
8726
  _props$numIidType = props.numIidType,
8728
- numIidType = _props$numIidType === void 0 ? 'string' : _props$numIidType;
8727
+ numIidType = _props$numIidType === void 0 ? 'string' : _props$numIidType,
8728
+ form = props.form,
8729
+ isPriorityDisplayOfOrderNo = props.isPriorityDisplayOfOrderNo;
8729
8730
  var _useState = React.useState([]),
8730
8731
  _useState2 = _slicedToArray(_useState, 2),
8731
8732
  selectList = _useState2[0],
@@ -8738,10 +8739,14 @@ var GoodsModal = function GoodsModal(props) {
8738
8739
  _useState6 = _slicedToArray(_useState5, 2),
8739
8740
  goodList = _useState6[0],
8740
8741
  setGoodList = _useState6[1];
8741
- var _useState7 = React.useState(false),
8742
+ var _useState7 = React.useState([]),
8742
8743
  _useState8 = _slicedToArray(_useState7, 2),
8743
- loading = _useState8[0],
8744
- setLoading = _useState8[1];
8744
+ orderNoItems = _useState8[0],
8745
+ setOrderNoItems = _useState8[1];
8746
+ var _useState9 = React.useState(false),
8747
+ _useState10 = _slicedToArray(_useState9, 2),
8748
+ loading = _useState10[0],
8749
+ setLoading = _useState10[1];
8745
8750
  var transformIdType = function transformIdType(id) {
8746
8751
  if (!['string', 'number'].includes(_typeof(id))) return id;
8747
8752
  return numIidType === 'string' ? id + '' : +id;
@@ -8761,7 +8766,7 @@ var GoodsModal = function GoodsModal(props) {
8761
8766
  var handleSetGoodList = function handleSetGoodList(list) {
8762
8767
  return setGoodList(list.map(transformType));
8763
8768
  };
8764
- var _useState9 = React.useState({
8769
+ var _useState11 = React.useState({
8765
8770
  apiName: 'queryItems',
8766
8771
  desc: true,
8767
8772
  numIids: '',
@@ -8773,30 +8778,30 @@ var GoodsModal = function GoodsModal(props) {
8773
8778
  cids: '',
8774
8779
  title: ''
8775
8780
  }),
8776
- _useState10 = _slicedToArray(_useState9, 2),
8777
- searchParams = _useState10[0],
8778
- setSearch = _useState10[1];
8779
- var _useState11 = React.useState(0),
8780
8781
  _useState12 = _slicedToArray(_useState11, 2),
8781
- total = _useState12[0],
8782
- setTotal = _useState12[1];
8783
- var _useState13 = React.useState(''),
8782
+ searchParams = _useState12[0],
8783
+ setSearch = _useState12[1];
8784
+ var _useState13 = React.useState(0),
8784
8785
  _useState14 = _slicedToArray(_useState13, 2),
8785
- platform = _useState14[0],
8786
- setPlatform = _useState14[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
8787
- var _useState15 = React.useState({}),
8786
+ total = _useState14[0],
8787
+ setTotal = _useState14[1];
8788
+ var _useState15 = React.useState(''),
8788
8789
  _useState16 = _slicedToArray(_useState15, 2),
8789
- shopInfo = _useState16[0],
8790
- setShopInfo = _useState16[1]; //店铺信息
8791
- var _useState17 = React.useState(true),
8790
+ platform = _useState16[0],
8791
+ setPlatform = _useState16[1]; //平台 taobao=淘宝 fxg=抖音 pdd=拼多多 sph=微信视屏号
8792
+ var _useState17 = React.useState({}),
8792
8793
  _useState18 = _slicedToArray(_useState17, 2),
8793
- canSearch = _useState18[0],
8794
- setCanSearch = _useState18[1];
8795
- var _useState19 = React.useState([null]),
8794
+ shopInfo = _useState18[0],
8795
+ setShopInfo = _useState18[1]; //店铺信息
8796
+ var _useState19 = React.useState(true),
8796
8797
  _useState20 = _slicedToArray(_useState19, 2),
8797
- nextKeyList = _useState20[0],
8798
- setNextKeyList = _useState20[1];
8799
- var _useState21 = React.useState([{
8798
+ canSearch = _useState20[0],
8799
+ setCanSearch = _useState20[1];
8800
+ var _useState21 = React.useState([null]),
8801
+ _useState22 = _slicedToArray(_useState21, 2),
8802
+ nextKeyList = _useState22[0],
8803
+ setNextKeyList = _useState22[1];
8804
+ var _useState23 = React.useState([{
8800
8805
  tab: '出售中',
8801
8806
  key: 'onSale'
8802
8807
  }, {
@@ -8806,10 +8811,10 @@ var GoodsModal = function GoodsModal(props) {
8806
8811
  tab: '已选择',
8807
8812
  key: 'select'
8808
8813
  }]),
8809
- _useState22 = _slicedToArray(_useState21, 2),
8810
- tabs = _useState22[0],
8811
- setTabs = _useState22[1];
8812
- var _useState23 = React.useState([{
8814
+ _useState24 = _slicedToArray(_useState23, 2),
8815
+ tabs = _useState24[0],
8816
+ setTabs = _useState24[1];
8817
+ var _useState25 = React.useState([{
8813
8818
  name: '上架时间',
8814
8819
  value: 'list_time'
8815
8820
  }, {
@@ -8819,13 +8824,13 @@ var GoodsModal = function GoodsModal(props) {
8819
8824
  name: '按价格',
8820
8825
  value: 'price'
8821
8826
  }]),
8822
- _useState24 = _slicedToArray(_useState23, 1),
8823
- goodSort = _useState24[0];
8827
+ _useState26 = _slicedToArray(_useState25, 1),
8828
+ goodSort = _useState26[0];
8824
8829
  //宝贝分类
8825
- var _useState25 = React.useState([]),
8826
- _useState26 = _slicedToArray(_useState25, 2),
8827
- shell = _useState26[0],
8828
- setShell = _useState26[1];
8830
+ var _useState27 = React.useState([]),
8831
+ _useState28 = _slicedToArray(_useState27, 2),
8832
+ shell = _useState28[0],
8833
+ setShell = _useState28[1];
8829
8834
  var clickOrder = function clickOrder(sort) {
8830
8835
  if (sort.value === searchParams.orderBy) {
8831
8836
  setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
@@ -9098,8 +9103,112 @@ var GoodsModal = function GoodsModal(props) {
9098
9103
  }
9099
9104
  }, [platform]);
9100
9105
  React.useEffect(function () {
9101
- platform && canSearch && getItem(searchParams, platform);
9106
+ if (platform && canSearch) {
9107
+ if (searchParams.type === 'orderProduct') {
9108
+ getOrderProductItem(searchParams);
9109
+ } else {
9110
+ getItem(searchParams, platform);
9111
+ }
9112
+ }
9102
9113
  }, [searchParams, platform]);
9114
+ React.useEffect(function () {
9115
+ if (visible && platform !== 'fxg') {
9116
+ var val = (form === null || form === void 0 ? void 0 : form.getFieldsValue()) || {};
9117
+ var orderNo = val['m3ap1EvEyd'];
9118
+ if (orderNo) {
9119
+ setTabs(function (prev) {
9120
+ return lodash.uniqBy([{
9121
+ tab: '订单商品',
9122
+ key: 'orderProduct'
9123
+ }].concat(_toConsumableArray(prev)), 'key');
9124
+ });
9125
+ if (isPriorityDisplayOfOrderNo) {
9126
+ setSearch(function (prev) {
9127
+ return _objectSpread2(_objectSpread2({}, prev), {}, {
9128
+ type: 'orderProduct'
9129
+ });
9130
+ });
9131
+ }
9132
+ }
9133
+ }
9134
+ if (!visible) {
9135
+ setOrderNoItems([]);
9136
+ }
9137
+ }, [visible]);
9138
+ var getOrderProductItem = /*#__PURE__*/function () {
9139
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
9140
+ var val, orderNo, shopId, res, items, totalCount, pageNo, pageSize, _pageNo, _pageSize, title, _items;
9141
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9142
+ while (1) switch (_context2.prev = _context2.next) {
9143
+ case 0:
9144
+ val = (form === null || form === void 0 ? void 0 : form.getFieldsValue()) || {};
9145
+ orderNo = val.m3ap1EvEyd, shopId = val.shopId;
9146
+ if (orderNo) {
9147
+ _context2.next = 4;
9148
+ break;
9149
+ }
9150
+ return _context2.abrupt("return", handleSetGoodList([]));
9151
+ case 4:
9152
+ if (orderNoItems.length) {
9153
+ _context2.next = 20;
9154
+ break;
9155
+ }
9156
+ _context2.prev = 5;
9157
+ setLoading(true);
9158
+ _context2.next = 9;
9159
+ return kmkfUtils.servers.orderDetail({
9160
+ shopId: shopId,
9161
+ orderNo: orderNo
9162
+ });
9163
+ case 9:
9164
+ res = _context2.sent;
9165
+ if (res.success) {
9166
+ _context2.next = 14;
9167
+ break;
9168
+ }
9169
+ handleSetGoodList([]);
9170
+ antd.message.warn(res.message);
9171
+ return _context2.abrupt("return");
9172
+ case 14:
9173
+ if (res.data && res.data.itemList && res.data.itemList.length) {
9174
+ items = res.data.itemList;
9175
+ totalCount = items.length;
9176
+ items.forEach(function (item) {
9177
+ item.platform = platform;
9178
+ });
9179
+ setOrderNoItems(items);
9180
+ pageNo = params.pageNo, pageSize = params.pageSize;
9181
+ handleSetGoodList(_toConsumableArray(items.slice((pageNo - 1) * pageSize, pageNo * pageSize)));
9182
+ setTotal(totalCount);
9183
+ }
9184
+ case 15:
9185
+ _context2.prev = 15;
9186
+ setLoading(false);
9187
+ return _context2.finish(15);
9188
+ case 18:
9189
+ _context2.next = 26;
9190
+ break;
9191
+ case 20:
9192
+ _pageNo = params.pageNo, _pageSize = params.pageSize;
9193
+ title = params.title;
9194
+ if (platform !== 'taobao') {
9195
+ title = params.numIids;
9196
+ }
9197
+ _items = title ? orderNoItems.filter(function (item) {
9198
+ return item.title.includes(title.trim());
9199
+ }) : orderNoItems;
9200
+ handleSetGoodList(_toConsumableArray(_items.slice((_pageNo - 1) * _pageSize, _pageNo * _pageSize)));
9201
+ setTotal(_items.length);
9202
+ case 26:
9203
+ case "end":
9204
+ return _context2.stop();
9205
+ }
9206
+ }, _callee2, null, [[5,, 15, 18]]);
9207
+ }));
9208
+ return function getOrderProductItem(_x2) {
9209
+ return _ref4.apply(this, arguments);
9210
+ };
9211
+ }();
9103
9212
  return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
9104
9213
  title: '选择宝贝',
9105
9214
  okText: '确认',
@@ -9133,7 +9242,7 @@ var GoodsModal = function GoodsModal(props) {
9133
9242
  style: {
9134
9243
  display: searchParams.type === 'select' ? 'none' : ''
9135
9244
  }
9136
- }, platform === 'taobao' && /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, {
9245
+ }, /*#__PURE__*/React__default['default'].createElement("div", null, platform === 'taobao' && searchParams.type !== 'orderProduct' && /*#__PURE__*/React__default['default'].createElement(antd.Radio.Group, {
9137
9246
  value: searchParams.orderBy,
9138
9247
  onChange: function onChange(e) {
9139
9248
  setSearch(_objectSpread2(_objectSpread2({}, searchParams), {}, {
@@ -9149,7 +9258,7 @@ var GoodsModal = function GoodsModal(props) {
9149
9258
  },
9150
9259
  key: sort.value
9151
9260
  }, sort.name, sort.value === searchParams.orderBy ? searchParams.desc ? /*#__PURE__*/React__default['default'].createElement("span", null, "\u21BE") : /*#__PURE__*/React__default['default'].createElement("span", null, "\u21C2") : /*#__PURE__*/React__default['default'].createElement("span", null, "\u21C5"));
9152
- })), /*#__PURE__*/React__default['default'].createElement("div", null, platform === 'taobao' && /*#__PURE__*/React__default['default'].createElement(antd.Select, {
9261
+ }))), /*#__PURE__*/React__default['default'].createElement("div", null, platform === 'taobao' && searchParams.type !== 'orderProduct' && /*#__PURE__*/React__default['default'].createElement(antd.Select, {
9153
9262
  className: "classify",
9154
9263
  value: searchParams.cids,
9155
9264
  onChange: function onChange(value) {
@@ -9164,7 +9273,7 @@ var GoodsModal = function GoodsModal(props) {
9164
9273
  key: item.value
9165
9274
  }, item.label);
9166
9275
  })), /*#__PURE__*/React__default['default'].createElement(Search, {
9167
- placeholder: platform === 'taobao' ? '宝贝链接,标题' : '商品ID',
9276
+ placeholder: searchParams.type !== 'orderProduct' ? platform === 'taobao' ? '宝贝链接,标题' : '商品ID' : '宝贝标题',
9168
9277
  // enterButton="搜索"
9169
9278
  className: "search",
9170
9279
  value: platform === 'taobao' ? searchParams.title : searchParams.numIids,
@@ -9787,7 +9896,9 @@ var GoodItem = function GoodItem(props) {
9787
9896
  userNick = props.userNick,
9788
9897
  disabled = props.disabled,
9789
9898
  changeSku = props.changeSku,
9790
- width = props.width;
9899
+ width = props.width,
9900
+ form = props.form,
9901
+ isPriorityDisplayOfOrderNo = props.isPriorityDisplayOfOrderNo;
9791
9902
  var shopId = value.shopId,
9792
9903
  imgList = value.imgList;
9793
9904
  var _useState = React.useState(false),
@@ -9878,7 +9989,7 @@ var GoodItem = function GoodItem(props) {
9878
9989
  var onSubmit = /*#__PURE__*/function () {
9879
9990
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(list) {
9880
9991
  var _list$;
9881
- var newList, newImgList;
9992
+ var newList, newImgList, _list$2;
9882
9993
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9883
9994
  while (1) switch (_context2.prev = _context2.next) {
9884
9995
  case 0:
@@ -9900,7 +10011,11 @@ var GoodItem = function GoodItem(props) {
9900
10011
  // if (type === 1) {
9901
10012
  // params.outerId = item.outerId; //编码
9902
10013
  // }
9903
- if (changeSku) {
10014
+ //返填商品属性 && 为订单商品
10015
+ if (changeSku && item.skuInfoDTO) {
10016
+ params.outerSkuId = item.skuInfoDTO.outerSkuId;
10017
+ params.propertiesName = item.skuInfoDTO.propertiesName;
10018
+ } else if (changeSku) {
9904
10019
  params.propertiesName = '';
9905
10020
  }
9906
10021
  // if (type === 4) {
@@ -9919,7 +10034,9 @@ var GoodItem = function GoodItem(props) {
9919
10034
  imgList: newImgList
9920
10035
  });
9921
10036
  setVisible(false);
9922
- checkSkus(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.numIid, newImgList.length - 1);
10037
+ if (!(list === null || list === void 0 ? void 0 : (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.skuInfoDTO)) {
10038
+ checkSkus(list === null || list === void 0 ? void 0 : (_list$2 = list[0]) === null || _list$2 === void 0 ? void 0 : _list$2.numIid, newImgList.length - 1);
10039
+ }
9923
10040
  case 5:
9924
10041
  case "end":
9925
10042
  return _context2.stop();
@@ -10176,6 +10293,8 @@ var GoodItem = function GoodItem(props) {
10176
10293
  shopId: shopId,
10177
10294
  maxLength: maxLength,
10178
10295
  changeSku: changeSku,
10296
+ form: form,
10297
+ isPriorityDisplayOfOrderNo: isPriorityDisplayOfOrderNo,
10179
10298
  onCancel: function onCancel() {
10180
10299
  setVisible(false);
10181
10300
  }
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { FormInstance } from 'antd';
2
3
  import './richItem.less';
3
4
  type ShowHeaderObjType = {
4
5
  title: string;
@@ -26,6 +27,8 @@ export interface RichGoodProps {
26
27
  disabled?: boolean;
27
28
  changeSku?: boolean;
28
29
  width?: string | number;
30
+ form?: FormInstance;
31
+ isPriorityDisplayOfOrderNo?: boolean;
29
32
  }
30
33
  declare const GoodItem: (props: Partial<RichGoodProps>) => React.JSX.Element;
31
34
  export default GoodItem;
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { FormInstance } from 'antd';
2
3
  import './index.less';
3
4
  interface GoodModelProps {
4
5
  visible: boolean;
@@ -10,6 +11,8 @@ interface GoodModelProps {
10
11
  changeSku?: boolean;
11
12
  width?: string | number;
12
13
  numIidType?: 'string' | 'number';
14
+ form?: FormInstance;
15
+ isPriorityDisplayOfOrderNo?: boolean;
13
16
  onSubmit: (...args: any[]) => any;
14
17
  onCancel: (...args: any[]) => any;
15
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "2.0.54-beta.43",
3
+ "version": "2.0.54-beta.45",
4
4
  "description": "> TODO: description",
5
5
  "homepage": "",
6
6
  "license": "ISC",
@@ -20,7 +20,7 @@
20
20
  "watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.39",
23
+ "@kmkf-fe-packages/kmkf-utils": "2.0.54-beta.45",
24
24
  "ahooks": "^3.7.4",
25
25
  "bignumber.js": "^9.1.2",
26
26
  "kmkf-monitor": "^0.8.9",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "f90e2c8d0f5eca05f430c4c832819005a31a1840"
68
+ "gitHead": "5093fe6e531d5fd77836eefc0fb07a713e95c74d"
69
69
  }