@kmkf-fe-packages/basic-components 2.0.0-rc.9 → 2.0.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.js CHANGED
@@ -940,7 +940,7 @@ var fn$1 = function fn() {
940
940
  var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
941
941
  var _document;
942
942
  var _ref$maxCount = _ref.maxCount,
943
- maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
943
+ maxCount = _ref$maxCount === void 0 ? 20 : _ref$maxCount,
944
944
  _ref$maxSize = _ref.maxSize,
945
945
  maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
946
946
  _ref$uploadText = _ref.uploadText,
@@ -6875,7 +6875,7 @@ var fn$2 = function fn() {
6875
6875
  };
6876
6876
  var ApaasUploadFile = function ApaasUploadFile(_ref) {
6877
6877
  var _ref$maxCount = _ref.maxCount,
6878
- maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
6878
+ maxCount = _ref$maxCount === void 0 ? 20 : _ref$maxCount,
6879
6879
  _ref$maxSize = _ref.maxSize,
6880
6880
  maxSize = _ref$maxSize === void 0 ? 100 : _ref$maxSize,
6881
6881
  _ref$onChange = _ref.onChange,
@@ -7373,7 +7373,8 @@ var Province = function Province(props) {
7373
7373
  var mapping = {
7374
7374
  workOrder: kmkfUtils.AddressData.getInstance(),
7375
7375
  bs: kmkfUtils.BsAddressData.getInstance(),
7376
- wdt: kmkfUtils.WdtAddressData.getInstance()
7376
+ wdt: kmkfUtils.WdtAddressData.getInstance(),
7377
+ gy: kmkfUtils.GyAddressData.getInstance()
7377
7378
  };
7378
7379
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, _objectSpread2(_objectSpread2({}, props), {}, {
7379
7380
  options: ((_mapping$type = mapping[type]) === null || _mapping$type === void 0 ? void 0 : _mapping$type.addressOptions) || [],
@@ -7478,10 +7479,16 @@ var IdentifyAddress = function IdentifyAddress(props) {
7478
7479
  var addressData = (type && {
7479
7480
  bs: kmkfUtils.BsAddressData,
7480
7481
  wdt: kmkfUtils.WdtAddressData,
7482
+ gy: kmkfUtils.GyAddressData,
7481
7483
  workOrder: kmkfUtils.AddressData
7482
7484
  }[type] || kmkfUtils.AddressData).getInstance();
7483
7485
  if ((val === null || val === void 0 ? void 0 : val.province) && addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province)) {
7484
- params.address = [addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.city), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
7486
+ // params.address = [
7487
+ // addressData.getProCodeByName(val?.province),
7488
+ // addressData.getProCodeByName(val?.city),
7489
+ // addressData.getProCodeByName(val?.district),
7490
+ // ];
7491
+ params.address = addressData.getCodesByNames([val === null || val === void 0 ? void 0 : val.province, val === null || val === void 0 ? void 0 : val.city, val === null || val === void 0 ? void 0 : val.district]);
7485
7492
  }
7486
7493
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
7487
7494
  };
@@ -7554,11 +7561,13 @@ function ApaasPosting(props) {
7554
7561
  });
7555
7562
  }
7556
7563
 
7557
- var _excluded$a = ["value", "onChange", "platformType"];
7564
+ var _excluded$a = ["value", "onChange", "platformType", "type"];
7558
7565
  function ApaasLogistics(props) {
7559
7566
  var value = props.value,
7560
7567
  onChange = props.onChange,
7561
7568
  platformType = props.platformType,
7569
+ _props$type = props.type,
7570
+ type = _props$type === void 0 ? 'select' : _props$type,
7562
7571
  other = _objectWithoutProperties(props, _excluded$a);
7563
7572
  var _useState = React.useState([]),
7564
7573
  _useState2 = _slicedToArray(_useState, 2),
@@ -7589,10 +7598,18 @@ function ApaasLogistics(props) {
7589
7598
  isFirst.current = true;
7590
7599
  }
7591
7600
  }, []);
7592
- return /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
7601
+ var handleInputChange = function handleInputChange(e) {
7602
+ var val = e.target.value;
7603
+ onChange === null || onChange === void 0 ? void 0 : onChange(val);
7604
+ };
7605
+ return type === 'input' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, _objectSpread2(_objectSpread2({}, other), {}, {
7606
+ value: value,
7607
+ onChange: handleInputChange
7608
+ })) : /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
7593
7609
  value: value,
7594
7610
  onChange: onChange,
7595
- options: option
7611
+ options: option,
7612
+ virtual: true
7596
7613
  }));
7597
7614
  }
7598
7615
 
@@ -8122,7 +8139,7 @@ function ApaasAddress(props) {
8122
8139
  };
8123
8140
  var addressData = type === 'bs' ? kmkfUtils.BsAddressData.getInstance() : kmkfUtils.AddressData.getInstance();
8124
8141
  if ((val === null || val === void 0 ? void 0 : val.province) && addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province)) {
8125
- params.address = [addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.city), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
8142
+ params.address = addressData.getCodesByNames([val === null || val === void 0 ? void 0 : val.province, val === null || val === void 0 ? void 0 : val.city, val === null || val === void 0 ? void 0 : val.district]);
8126
8143
  }
8127
8144
  onChange === null || onChange === void 0 ? void 0 : onChange(params);
8128
8145
  };
@@ -9486,7 +9503,8 @@ var GoodItem = function GoodItem(props) {
9486
9503
  picUrl: item.picUrl,
9487
9504
  numIid: item.numIid,
9488
9505
  skuId: item.skuId,
9489
- outerSkuId: item.outerSkuId
9506
+ outerSkuId: item.outerSkuId,
9507
+ num: 1 //手动选择商品默认数量
9490
9508
  };
9491
9509
  // if (type === 1) {
9492
9510
  // params.outerId = item.outerId; //编码
@@ -9576,34 +9594,33 @@ var GoodItem = function GoodItem(props) {
9576
9594
  };
9577
9595
  }();
9578
9596
  var headerList = React.useMemo(function () {
9579
- if (!Array.isArray(showHeader)) return ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9580
- ];
9581
-
9597
+ if (!Array.isArray(showHeader)) return kmkfUtils.columnsGoodsList.map(function (item) {
9598
+ return item.dataIndex;
9599
+ });
9582
9600
  var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9583
9601
  var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9584
9602
  var dataIndexList = [];
9585
9603
  if (isStringArray) {
9586
9604
  dataIndexList = showHeader;
9587
9605
  } else if (isObjectArray) {
9588
- dataIndexList = showHeader.map(function (item) {
9606
+ dataIndexList = showHeader.filter(function (item) {
9607
+ return item.show !== false;
9608
+ }).map(function (item) {
9589
9609
  return item.dataIndex;
9590
9610
  });
9591
9611
  }
9592
- return isStringArray ? showHeader : isObjectArray ? showHeader.filter(function (item) {
9593
- return item.show !== false;
9594
- }).map(function (item) {
9595
- return item.dataIndex;
9596
- }) : [] || {
9597
- 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9598
- ]
9612
+ return dataIndexList || {
9613
+ 1: kmkfUtils.columnsGoodsList.map(function (item) {
9614
+ return item.dataIndex;
9615
+ })
9599
9616
  }[type] || [];
9600
9617
  }, [showHeader]);
9601
9618
  //修改参数
9602
- var handleChangeValue = function handleChangeValue(key, index) {
9619
+ var handleChangeValue = function handleChangeValue(key, index, replaceFn) {
9603
9620
  return function (e) {
9604
- var _e$target;
9621
+ var _e$target, _e$target2;
9605
9622
  var newImgList = _toConsumableArray(imgList);
9606
- newImgList[index][key] = e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value;
9623
+ newImgList[index][key] = replaceFn ? replaceFn(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) : e === null || e === void 0 ? void 0 : (_e$target2 = e.target) === null || _e$target2 === void 0 ? void 0 : _e$target2.value;
9607
9624
  var newValue = {
9608
9625
  shopId: shopId,
9609
9626
  imgList: newImgList
@@ -9627,6 +9644,20 @@ var GoodItem = function GoodItem(props) {
9627
9644
  isShow: headerList.includes('numIid'),
9628
9645
  key: 'numIid',
9629
9646
  label: '商品id'
9647
+ }, {
9648
+ isShow: headerList.includes('num'),
9649
+ key: 'num',
9650
+ label: '商品数量',
9651
+ replaceFn: function replaceFn(value) {
9652
+ // 使用正则表达式匹配所有数字字符
9653
+ var numbers = String(value || '').match(/\d+/g);
9654
+ // 如果没有匹配到任何数字字符,返回null
9655
+ if (!numbers) {
9656
+ return null;
9657
+ }
9658
+ // 将匹配到的数字字符拼接成一个新的数字
9659
+ return Number(numbers.join('')) ? Number(numbers.join('')) : null;
9660
+ }
9630
9661
  }, {
9631
9662
  isShow: changeSku && headerList.includes('skuId'),
9632
9663
  key: 'skuId',
@@ -9642,11 +9673,7 @@ var GoodItem = function GoodItem(props) {
9642
9673
  }];
9643
9674
  if (!Array.isArray(showHeader)) return initList;
9644
9675
  var newList = [];
9645
- var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9646
- var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9647
- (isStringArray ? showHeader : isObjectArray ? showHeader.map(function (item) {
9648
- return item.dataIndex;
9649
- }) : []).forEach(function (dataIndex) {
9676
+ headerList.forEach(function (dataIndex) {
9650
9677
  if (initList.find(function (item) {
9651
9678
  return item.key === dataIndex;
9652
9679
  })) {
@@ -9720,7 +9747,7 @@ var GoodItem = function GoodItem(props) {
9720
9747
  title: String(img[item.key] || ''),
9721
9748
  value: img[item.key],
9722
9749
  disabled: item.disabled || disabled,
9723
- onChange: handleChangeValue(item.key, index)
9750
+ onChange: handleChangeValue(item.key, index, item.replaceFn)
9724
9751
  }));
9725
9752
  }), !disabled && !hasPic && type !== 4 && changeSku ? /*#__PURE__*/React__default['default'].createElement(antd.Button, {
9726
9753
  style: {
@@ -11003,13 +11030,15 @@ var jstGoods = function jstGoods(props) {
11003
11030
  _props$showField = props.showField,
11004
11031
  showField = _props$showField === void 0 ? '' : _props$showField,
11005
11032
  _props$platformType = props.platformType,
11006
- platformType = _props$platformType === void 0 ? 'default' : _props$platformType;
11033
+ platformType = _props$platformType === void 0 ? 'default' : _props$platformType,
11034
+ onlyShowFieldSelect = props.onlyShowFieldSelect;
11007
11035
  var _useState = React.useState(0),
11008
11036
  _useState2 = _slicedToArray(_useState, 2),
11009
11037
  changeIndex = _useState2[0],
11010
11038
  setChangeIndex = _useState2[1]; //选中的包裹
11011
11039
  var sendOptions = kmkfUtils.SendDataCenter.getInstance(platformType).getSendData();
11012
- var isSelectName = ['wdt', 'bsE3', 'km'].includes(platformType);
11040
+ var isSelectName = ['wdt', 'bsE3', 'km', 'gy'].includes(platformType);
11041
+ var logisticsType = type === 1 && platformType === 'gy' ? 'input' : 'select';
11013
11042
  React.useEffect(function () {
11014
11043
  //没有值塞个默认值
11015
11044
  if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
@@ -11041,10 +11070,12 @@ var jstGoods = function jstGoods(props) {
11041
11070
  }), /*#__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))));
11042
11071
  }));
11043
11072
  };
11044
- var handleSelected = function handleSelected(val, type, option) {
11073
+ var handleSelected = function handleSelected(val, type, option, onlyShowFieldSelect) {
11045
11074
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11046
11075
  changeOrderInfo[type] = val;
11047
- changeOrderInfo['sendId'] = option.value;
11076
+ if (!onlyShowFieldSelect) {
11077
+ changeOrderInfo['sendId'] = option.value;
11078
+ }
11048
11079
  if (isSelectName && type === 'sendName') {
11049
11080
  changeOrderInfo['sendSnapshotName'] = option.label;
11050
11081
  }
@@ -11083,24 +11114,32 @@ var jstGoods = function jstGoods(props) {
11083
11114
  return setChangeIndex(index);
11084
11115
  }
11085
11116
  }, "\u5305\u88F9".concat(index + 1)));
11086
- }))) : null, value.length || type === 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React__default['default'].createElement(ApaasLogistics, {
11117
+ }))) : null, value.length || type === 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, !showField || showField === 'logisticsCompany' ? /*#__PURE__*/React__default['default'].createElement(ApaasLogistics, _objectSpread2(_objectSpread2({
11118
+ type: logisticsType,
11087
11119
  disabled: disabled,
11088
11120
  placeholder: "\u7269\u6D41\u516C\u53F8",
11089
11121
  onChange: function onChange(val) {
11090
- return changeInputHandle(val, 'logisticsCompany');
11122
+ if (logisticsType === 'input') {
11123
+ changeInputHandle(null, 'logisticsCompany');
11124
+ changeInputHandle(val, 'logisticsCompanyName');
11125
+ } else {
11126
+ changeInputHandle(val, 'logisticsCompany');
11127
+ }
11091
11128
  },
11092
- value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.logisticsCompany,
11129
+ value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex[logisticsType === 'input' ? 'logisticsCompanyName' : 'logisticsCompany']
11130
+ }, logisticsType === 'input' ? {} : {
11093
11131
  showSearch: true,
11132
+ dropdownMatchSelectWidth: false,
11094
11133
  filterOption: function filterOption(input, option) {
11095
11134
  return option.label.includes(input);
11096
- },
11097
- dropdownMatchSelectWidth: false,
11135
+ }
11136
+ }), {}, {
11098
11137
  style: {
11099
11138
  minWidth: '100px',
11100
11139
  maxWidth: '180px'
11101
11140
  },
11102
11141
  platformType: platformType
11103
- }) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11142
+ })) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11104
11143
  disabled: disabled,
11105
11144
  placeholder: "\u7269\u6D41\u5355\u53F7",
11106
11145
  onChange: function onChange(e) {
@@ -11140,7 +11179,7 @@ var jstGoods = function jstGoods(props) {
11140
11179
  filterOption: filterOption,
11141
11180
  value: ((_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName) || null,
11142
11181
  onChange: function onChange(value, option) {
11143
- return handleSelected(value, 'sendName', option);
11182
+ return handleSelected(value, 'sendName', option, onlyShowFieldSelect);
11144
11183
  }
11145
11184
  }) : /*#__PURE__*/React__default['default'].createElement(antd.Input, {
11146
11185
  disabled: disabled,
@@ -12484,79 +12523,412 @@ var GoodsModal$4 = function GoodsModal(props, ref) {
12484
12523
  };
12485
12524
  var BsE3GoodsModal = /*#__PURE__*/React.forwardRef(GoodsModal$4);
12486
12525
 
12487
- var getColumns = function getColumns(_ref) {
12488
- var _ref$text = _ref.text,
12489
- text = _ref$text === void 0 ? '' : _ref$text,
12490
- disabled = _ref.disabled,
12491
- updateHandle = _ref.updateHandle;
12492
- return {
12493
- //百胜E3补发商品
12494
- BS_E3_REISSUE_GOODS: [{
12495
- dataIndex: 'sku',
12496
- title: "SKU",
12497
- width: 150
12498
- }, {
12499
- dataIndex: 'skuId',
12500
- title: "SKU ID",
12501
- width: 150
12502
- }, {
12503
- dataIndex: 'goodsName',
12504
- title: "\u5546\u54C1\u540D\u79F0",
12505
- width: 150
12506
- }, {
12507
- dataIndex: 'goodsShortName',
12508
- title: "\u5546\u54C1\u7B80\u79F0",
12509
- width: 150
12510
- }, {
12511
- dataIndex: 'picPath',
12512
- title: "\u5546\u54C1\u56FE\u7247",
12513
- width: 150
12514
- }, {
12515
- dataIndex: 'goodsSn',
12516
- title: "\u8D27\u53F7",
12517
- width: 150
12518
- }, {
12519
- dataIndex: 'goodsId',
12520
- title: "\u8D27\u53F7ID",
12521
- width: 150
12522
- }, {
12523
- dataIndex: 'colorName',
12524
- title: "\u989C\u8272\u540D\u79F0",
12525
- width: 150
12526
- }, {
12527
- dataIndex: 'colorCode',
12528
- title: "\u989C\u8272\u4EE3\u7801",
12529
- width: 150
12530
- }, {
12531
- dataIndex: 'sizeName',
12532
- title: "\u5C3A\u7801\u540D\u79F0",
12533
- width: 150
12534
- }, {
12535
- dataIndex: 'sizeCode',
12536
- title: "\u5C3A\u7801\u4EE3\u7801",
12537
- width: 150
12538
- }, {
12539
- dataIndex: 'brandName',
12540
- title: "\u54C1\u724C\u540D\u79F0",
12526
+ var getTableData$2 = function getTableData(_ref, formData) {
12527
+ var current = _ref.current,
12528
+ pageSize = _ref.pageSize;
12529
+ var data = {
12530
+ skuName: formData.skuName || null,
12531
+ skuCode: formData.skuCode || null,
12532
+ goodName: formData.goodName || null,
12533
+ goodNo: formData.goodNo || null
12534
+ };
12535
+ return extendRequest('/qy/gdfw/product/product/page', {
12536
+ method: 'post',
12537
+ data: _objectSpread2({
12538
+ pageSize: pageSize,
12539
+ pageNo: current,
12540
+ platform: 'GY_ERP'
12541
+ }, data)
12542
+ }).then(function (res) {
12543
+ var _res$data = res.data,
12544
+ _res$data$productSkuL = _res$data.productSkuList,
12545
+ productSkuList = _res$data$productSkuL === void 0 ? [] : _res$data$productSkuL,
12546
+ _res$data$total = _res$data.total,
12547
+ total = _res$data$total === void 0 ? 0 : _res$data$total;
12548
+ var newProducts = productSkuList.map(function (item, index) {
12549
+ return _objectSpread2({}, item);
12550
+ });
12551
+ return {
12552
+ total: total,
12553
+ list: newProducts
12554
+ };
12555
+ });
12556
+ };
12557
+ var columns$3 = [{
12558
+ dataIndex: 'index',
12559
+ title: 'NO',
12560
+ render: function render(val, record, index) {
12561
+ return /*#__PURE__*/React__default['default'].createElement("div", {
12562
+ style: {
12563
+ width: 25
12564
+ }
12565
+ }, index + 1);
12566
+ },
12567
+ width: 80
12568
+ }, {
12569
+ dataIndex: 'specName',
12570
+ title: 'SKU名称',
12571
+ width: 250,
12572
+ ellipsis: true
12573
+ }, {
12574
+ dataIndex: 'specNo',
12575
+ title: 'SKU编码',
12576
+ width: 200,
12577
+ ellipsis: true
12578
+ }, {
12579
+ dataIndex: 'goodName',
12580
+ title: '商品名称',
12581
+ width: 250,
12582
+ ellipsis: true
12583
+ }, {
12584
+ dataIndex: 'goodShortName',
12585
+ title: "\u5546\u54C1\u7B80\u79F0",
12586
+ ellipsis: true,
12587
+ width: 250
12588
+ }, {
12589
+ dataIndex: 'goodNo',
12590
+ title: '商品编码',
12591
+ width: 200,
12592
+ ellipsis: true
12593
+ }, {
12594
+ dataIndex: 'goodPicUrl',
12595
+ title: '商品图片',
12596
+ width: 100,
12597
+ render: function render(picUrl) {
12598
+ return /*#__PURE__*/React__default['default'].createElement("img", {
12599
+ style: {
12600
+ width: '40px',
12601
+ height: '40px',
12602
+ objectFit: 'contain'
12603
+ },
12604
+ src: picUrl
12605
+ });
12606
+ }
12607
+ }, {
12608
+ dataIndex: 'brandName',
12609
+ title: '品牌名称',
12610
+ width: 200,
12611
+ ellipsis: true
12612
+ }, {
12613
+ dataIndex: 'retailPrice',
12614
+ title: "\u6807\u51C6\u552E\u4EF7",
12615
+ ellipsis: true,
12616
+ width: 100
12617
+ }, {
12618
+ dataIndex: 'costPrice',
12619
+ title: "\u6210\u672C\u4EF7",
12620
+ ellipsis: true,
12621
+ width: 100
12622
+ }];
12623
+ var GoodList$2 = function GoodList(props, ref) {
12624
+ var _useState = React.useState([]),
12625
+ _useState2 = _slicedToArray(_useState, 2),
12626
+ selectList = _useState2[0],
12627
+ setSelect = _useState2[1];
12628
+ var _useState3 = React.useState([]),
12629
+ _useState4 = _slicedToArray(_useState3, 2),
12630
+ selectIds = _useState4[0],
12631
+ setSelectIds = _useState4[1];
12632
+ React.useImperativeHandle(ref, function () {
12633
+ return {
12634
+ getSelectGoodList: function getSelectGoodList() {
12635
+ return selectList;
12636
+ }
12637
+ };
12638
+ });
12639
+ var _Form$useForm = antd.Form.useForm(),
12640
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
12641
+ form = _Form$useForm2[0];
12642
+ var _useAntdTable = ahooks.useAntdTable(getTableData$2, {
12643
+ defaultPageSize: 10,
12644
+ form: form
12645
+ }),
12646
+ tableProps = _useAntdTable.tableProps,
12647
+ search = _useAntdTable.search,
12648
+ params = _useAntdTable.params;
12649
+ var submit = search.submit,
12650
+ reset = search.reset;
12651
+ var advanceSearchForm = /*#__PURE__*/React__default['default'].createElement(antd.Form, {
12652
+ layout: "inline",
12653
+ form: form
12654
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12655
+ name: "skuName",
12656
+ style: {
12657
+ marginBottom: '12px'
12658
+ }
12659
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12660
+ placeholder: "\u5546\u54C1sku\u540D\u79F0",
12661
+ allowClear: true,
12662
+ style: {
12541
12663
  width: 150
12542
- }, {
12543
- dataIndex: 'goodsNumber',
12544
- title: "\u5546\u54C1\u6570\u91CF",
12664
+ }
12665
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12666
+ name: "skuCode",
12667
+ style: {
12668
+ marginBottom: '12px'
12669
+ }
12670
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12671
+ placeholder: "\u5546\u54C1sku\u7F16\u7801",
12672
+ allowClear: true,
12673
+ style: {
12545
12674
  width: 150
12546
- }, {
12547
- dataIndex: 'goodsPrice',
12548
- title: "\u5546\u54C1\u5355\u4EF7",
12675
+ }
12676
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12677
+ name: "goodName",
12678
+ style: {
12679
+ marginBottom: '12px'
12680
+ }
12681
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12682
+ placeholder: "\u5546\u54C1\u540D\u79F0",
12683
+ allowClear: true,
12684
+ style: {
12549
12685
  width: 150
12550
- }, {
12551
- dataIndex: 'shopPrice',
12552
- title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12686
+ }
12687
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12688
+ name: "goodNo",
12689
+ style: {
12690
+ marginBottom: '12px'
12691
+ }
12692
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12693
+ placeholder: "\u5546\u54C1\u7F16\u7801",
12694
+ allowClear: true,
12695
+ style: {
12553
12696
  width: 150
12554
- }, {
12555
- dataIndex: 'isGift',
12556
- title: "\u662F\u5426\u8D60\u54C1",
12557
- width: 150,
12558
- render: function render(val) {
12559
- return /*#__PURE__*/React__default['default'].createElement("span", null, +val ? '是' : '否');
12697
+ }
12698
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12699
+ style: {
12700
+ marginBottom: '12px'
12701
+ }
12702
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12703
+ type: "primary",
12704
+ style: {
12705
+ marginRight: '8px'
12706
+ },
12707
+ onClick: submit
12708
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12709
+ onClick: reset
12710
+ }, "\u91CD\u7F6E")));
12711
+ var rowSelection = {
12712
+ selectedRowKeys: selectIds,
12713
+ fixed: true,
12714
+ onSelect: function onSelect(record, selected) {
12715
+ if (selected) {
12716
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.specNo]));
12717
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
12718
+ } else {
12719
+ setSelectIds(selectIds.filter(function (t) {
12720
+ return t !== record.specNo;
12721
+ }));
12722
+ setSelect(selectList.filter(function (t) {
12723
+ return t.specNo !== record.specNo;
12724
+ }));
12725
+ }
12726
+ },
12727
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
12728
+ if (selected) {
12729
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
12730
+ return t.specNo;
12731
+ }))));
12732
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
12733
+ } else {
12734
+ setSelectIds(lodash.difference(selectIds, changeRows.map(function (t) {
12735
+ return t.specNo;
12736
+ })));
12737
+ var list = lodash.differenceWith(selectList, changeRows, function (arrVal, othVal) {
12738
+ return arrVal.specNo !== othVal.specNo;
12739
+ });
12740
+ setSelect(list);
12741
+ }
12742
+ }
12743
+ };
12744
+ var showTable = function showTable() {
12745
+ var handleDelete = function handleDelete(record) {
12746
+ setSelectIds(selectIds.filter(function (t) {
12747
+ return t !== record.specNo;
12748
+ }));
12749
+ setSelect(selectList.filter(function (t) {
12750
+ return t.specNo !== record.specNo;
12751
+ }));
12752
+ };
12753
+ var showColumns = [{
12754
+ dataIndex: '',
12755
+ title: "\u64CD\u4F5C",
12756
+ ellipsis: true,
12757
+ width: 100,
12758
+ render: function render(val, record) {
12759
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12760
+ type: "link",
12761
+ onClick: function onClick() {
12762
+ return handleDelete(record);
12763
+ }
12764
+ }, "\u5220\u9664");
12765
+ }
12766
+ }].concat(lodash.takeRight(columns$3, columns$3.length - 1));
12767
+ return selectList.length ? /*#__PURE__*/React__default['default'].createElement("div", {
12768
+ style: {
12769
+ width: '100%',
12770
+ maxWidth: '387px'
12771
+ }
12772
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
12773
+ columns: showColumns,
12774
+ rowKey: 'specNo',
12775
+ dataSource: selectList,
12776
+ scroll: {
12777
+ x: '100%',
12778
+ y: 250
12779
+ },
12780
+ pagination: {
12781
+ size: 'small',
12782
+ total: selectIds.length,
12783
+ pageSize: 10,
12784
+ showSizeChanger: false
12785
+ }
12786
+ })) : null;
12787
+ };
12788
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, advanceSearchForm, /*#__PURE__*/React__default['default'].createElement("div", {
12789
+ style: {
12790
+ marginTop: '4px'
12791
+ }
12792
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2({
12793
+ rowSelection: rowSelection,
12794
+ rowKey: "specNo",
12795
+ columns: columns$3,
12796
+ scroll: {
12797
+ x: '100%',
12798
+ y: 250
12799
+ }
12800
+ }, tableProps))), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
12801
+ getPopupContainer: function getPopupContainer(triggerNode) {
12802
+ return triggerNode.parentElement;
12803
+ },
12804
+ content: showTable(),
12805
+ title: "\u5DF2\u9009\u62E9".concat(selectList.length, "\u4E2A\u5546\u54C1")
12806
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12807
+ danger: true,
12808
+ type: "text"
12809
+ }, "\u5DF2\u9009".concat(selectList.length > 99 ? '99+' : selectList.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(icons.CaretUpOutlined, null))));
12810
+ };
12811
+ var GyGoodsList = /*#__PURE__*/React.forwardRef(GoodList$2);
12812
+
12813
+ var GyGoodsModal = function GyGoodsModal(props, ref) {
12814
+ React.useImperativeHandle(ref, function () {
12815
+ return {
12816
+ open: function open() {
12817
+ setVisible(true);
12818
+ }
12819
+ };
12820
+ });
12821
+ var onSubmit = props.onSubmit,
12822
+ width = props.width;
12823
+ var _useState = React.useState(false),
12824
+ _useState2 = _slicedToArray(_useState, 2),
12825
+ visible = _useState2[0],
12826
+ setVisible = _useState2[1];
12827
+ var gyGoodsListRef = React.useRef(null);
12828
+ var _onCancel = function onCancel() {
12829
+ setVisible(false);
12830
+ };
12831
+ var onOk = function onOk() {
12832
+ var _gyGoodsListRef$curre;
12833
+ var selectedList = ((_gyGoodsListRef$curre = gyGoodsListRef.current) === null || _gyGoodsListRef$curre === void 0 ? void 0 : _gyGoodsListRef$curre.getSelectGoodList()) || [];
12834
+ onSubmit(selectedList);
12835
+ _onCancel();
12836
+ };
12837
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
12838
+ title: '选择商品',
12839
+ okText: '确认',
12840
+ cancelText: '取消',
12841
+ visible: visible,
12842
+ width: width || 850,
12843
+ onCancel: function onCancel() {
12844
+ _onCancel();
12845
+ },
12846
+ onOk: onOk,
12847
+ wrapClassName: "goodModal"
12848
+ }, /*#__PURE__*/React__default['default'].createElement(GyGoodsList, {
12849
+ ref: gyGoodsListRef
12850
+ })));
12851
+ };
12852
+ var GyGoodsModal$1 = /*#__PURE__*/React.forwardRef(GyGoodsModal);
12853
+
12854
+ var getColumns = function getColumns(_ref) {
12855
+ var _ref$text = _ref.text,
12856
+ disabled = _ref.disabled,
12857
+ updateHandle = _ref.updateHandle;
12858
+ return {
12859
+ //百胜E3补发商品
12860
+ BS_E3_REISSUE_GOODS: [{
12861
+ dataIndex: 'sku',
12862
+ title: "SKU",
12863
+ width: 150
12864
+ }, {
12865
+ dataIndex: 'skuId',
12866
+ title: "SKU ID",
12867
+ width: 150
12868
+ }, {
12869
+ dataIndex: 'goodsName',
12870
+ title: "\u5546\u54C1\u540D\u79F0",
12871
+ width: 150
12872
+ }, {
12873
+ dataIndex: 'goodsShortName',
12874
+ title: "\u5546\u54C1\u7B80\u79F0",
12875
+ width: 150
12876
+ }, {
12877
+ dataIndex: 'picPath',
12878
+ title: "\u5546\u54C1\u56FE\u7247",
12879
+ width: 150,
12880
+ render: function render(val) {
12881
+ return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
12882
+ width: 60,
12883
+ src: val
12884
+ });
12885
+ }
12886
+ }, {
12887
+ dataIndex: 'goodsSn',
12888
+ title: "\u8D27\u53F7",
12889
+ width: 150
12890
+ }, {
12891
+ dataIndex: 'goodsId',
12892
+ title: "\u8D27\u53F7ID",
12893
+ width: 150
12894
+ }, {
12895
+ dataIndex: 'colorName',
12896
+ title: "\u989C\u8272\u540D\u79F0",
12897
+ width: 150
12898
+ }, {
12899
+ dataIndex: 'colorCode',
12900
+ title: "\u989C\u8272\u4EE3\u7801",
12901
+ width: 150
12902
+ }, {
12903
+ dataIndex: 'sizeName',
12904
+ title: "\u5C3A\u7801\u540D\u79F0",
12905
+ width: 150
12906
+ }, {
12907
+ dataIndex: 'sizeCode',
12908
+ title: "\u5C3A\u7801\u4EE3\u7801",
12909
+ width: 150
12910
+ }, {
12911
+ dataIndex: 'brandName',
12912
+ title: "\u54C1\u724C\u540D\u79F0",
12913
+ width: 150
12914
+ }, {
12915
+ dataIndex: 'goodsNumber',
12916
+ title: "\u5546\u54C1\u6570\u91CF",
12917
+ width: 150
12918
+ }, {
12919
+ dataIndex: 'goodsPrice',
12920
+ title: "\u5546\u54C1\u5355\u4EF7",
12921
+ width: 150
12922
+ }, {
12923
+ dataIndex: 'shopPrice',
12924
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12925
+ width: 150
12926
+ }, {
12927
+ dataIndex: 'isGift',
12928
+ title: "\u662F\u5426\u8D60\u54C1",
12929
+ width: 150,
12930
+ render: function render(val) {
12931
+ return /*#__PURE__*/React__default['default'].createElement("span", null, +val ? '是' : '否');
12560
12932
  }
12561
12933
  }],
12562
12934
  //百胜E3商品信息
@@ -12740,7 +13112,17 @@ var getColumns = function getColumns(_ref) {
12740
13112
  render: function render(val) {
12741
13113
  return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
12742
13114
  }
12743
- }],
13115
+ }]
13116
+ };
13117
+ };
13118
+
13119
+ var getColumns$1 = function getColumns(_ref) {
13120
+ var _ref$text = _ref.text,
13121
+ text = _ref$text === void 0 ? '' : _ref$text,
13122
+ disabled = _ref.disabled,
13123
+ updateHandle = _ref.updateHandle;
13124
+ return {
13125
+ //bs商品信息
12744
13126
  BS_GOODS: [{
12745
13127
  dataIndex: 'mark',
12746
13128
  title: "\u5546\u54C1\u6807\u8BB0",
@@ -12907,7 +13289,7 @@ var getWdtReissueGoodColumns = function getWdtReissueGoodColumns(_ref2) {
12907
13289
  });
12908
13290
  };
12909
13291
 
12910
- var getColumns$1 = function getColumns(_ref) {
13292
+ var getColumns$2 = function getColumns(_ref) {
12911
13293
  var _ref$text = _ref.text,
12912
13294
  text = _ref$text === void 0 ? '' : _ref$text,
12913
13295
  disabled = _ref.disabled,
@@ -13294,7 +13676,7 @@ var getColumns$1 = function getColumns(_ref) {
13294
13676
  };
13295
13677
  };
13296
13678
 
13297
- var getColumns$2 = function getColumns(_ref) {
13679
+ var getColumns$3 = function getColumns(_ref) {
13298
13680
  var _ref$text = _ref.text,
13299
13681
  text = _ref$text === void 0 ? '' : _ref$text,
13300
13682
  disabled = _ref.disabled,
@@ -13378,25 +13760,256 @@ var getColumns$2 = function getColumns(_ref) {
13378
13760
  };
13379
13761
  };
13380
13762
 
13381
- var getColumnsMap = function getColumnsMap(args) {
13382
- var _ref = args || {},
13383
- _ref$text = _ref.text,
13763
+ var isNumberOrNumberString = function isNumberOrNumberString(value) {
13764
+ if (typeof value === 'number') return true;
13765
+ if (typeof value === 'string' && !isNaN(Number(value)) && value.trim() !== '') return true;
13766
+ return false;
13767
+ };
13768
+ var getYesOrNo = function getYesOrNo(val) {
13769
+ if (kmkfUtils.isNull(val)) return null;
13770
+ return val ? '是' : '否';
13771
+ };
13772
+ var getColumns$4 = function getColumns(_ref) {
13773
+ var _ref$text = _ref.text,
13774
+ disabled = _ref.disabled,
13775
+ updateHandle = _ref.updateHandle,
13776
+ updateDataHandle = _ref.updateDataHandle;
13777
+ return {
13778
+ //管易商品信息
13779
+ GY_GOODS: [{
13780
+ dataIndex: 'goodName',
13781
+ title: "\u5546\u54C1\u540D\u79F0",
13782
+ width: 150
13783
+ }, {
13784
+ dataIndex: 'goodShortName',
13785
+ title: "\u5546\u54C1\u7B80\u79F0",
13786
+ width: 150
13787
+ }, {
13788
+ dataIndex: 'goodNo',
13789
+ title: "\u5546\u54C1\u7F16\u7801",
13790
+ width: 200
13791
+ }, {
13792
+ dataIndex: 'specName',
13793
+ title: "SKU\u540D\u79F0",
13794
+ align: 'center',
13795
+ ellipsis: true,
13796
+ width: 250
13797
+ }, {
13798
+ dataIndex: 'specNo',
13799
+ title: "SKU\u7F16\u7801",
13800
+ align: 'center',
13801
+ ellipsis: true,
13802
+ width: 150
13803
+ }, {
13804
+ dataIndex: 'qty',
13805
+ title: "\u6570\u91CF",
13806
+ width: 100,
13807
+ render: function render(val, record, index) {
13808
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13809
+ style: {
13810
+ width: 70
13811
+ },
13812
+ value: val,
13813
+ min: 1,
13814
+ precision: 0,
13815
+ onChange: function onChange(num) {
13816
+ updateDataHandle({
13817
+ qty: num,
13818
+ amount: num && isNumberOrNumberString(record.price) ? num * record.price : null,
13819
+ originAmount: num && isNumberOrNumberString(record.originPrice) ? num * record.originPrice : null
13820
+ }, index);
13821
+ }
13822
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13823
+ }
13824
+ }, {
13825
+ dataIndex: 'price',
13826
+ title: "\u5B9E\u9645\u5355\u4EF7",
13827
+ width: 150,
13828
+ render: function render(val, record, index) {
13829
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13830
+ style: {
13831
+ width: 130
13832
+ },
13833
+ value: val,
13834
+ min: 0,
13835
+ precision: 2,
13836
+ onChange: function onChange(num) {
13837
+ updateDataHandle({
13838
+ price: num,
13839
+ amount: num && isNumberOrNumberString(record.qty) ? num * record.qty : null
13840
+ }, index);
13841
+ }
13842
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13843
+ }
13844
+ }, {
13845
+ dataIndex: 'amount',
13846
+ title: "\u5B9E\u9645\u91D1\u989D",
13847
+ width: 150
13848
+ }, {
13849
+ dataIndex: 'originPrice',
13850
+ title: "\u6807\u51C6\u5355\u4EF7",
13851
+ width: 150
13852
+ }, {
13853
+ dataIndex: 'originAmount',
13854
+ title: "\u6807\u51C6\u91D1\u989D",
13855
+ width: 150
13856
+ }, {
13857
+ dataIndex: 'discountFee',
13858
+ title: "\u8BA9\u5229\u91D1\u989D",
13859
+ width: 150
13860
+ }, {
13861
+ dataIndex: 'amountAfter',
13862
+ title: "\u8BA9\u5229\u540E\u91D1\u989D",
13863
+ width: 150
13864
+ }, {
13865
+ dataIndex: 'cancel',
13866
+ title: "\u662F\u5426\u53D6\u6D88",
13867
+ width: 150,
13868
+ render: function render(val) {
13869
+ return /*#__PURE__*/React__default['default'].createElement("span", null, getYesOrNo(val));
13870
+ }
13871
+ }, {
13872
+ dataIndex: 'isGift',
13873
+ title: "\u662F\u5426\u8D60\u54C1",
13874
+ width: 150,
13875
+ render: function render(val, record, index) {
13876
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
13877
+ value: val,
13878
+ onChange: function onChange(value) {
13879
+ updateHandle(value, index, 'isGift');
13880
+ },
13881
+ options: [{
13882
+ label: '是',
13883
+ value: 1
13884
+ }, {
13885
+ label: '否',
13886
+ value: 0
13887
+ }]
13888
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, getYesOrNo(val));
13889
+ }
13890
+ }, {
13891
+ dataIndex: 'skuNote',
13892
+ title: "\u5546\u54C1\u5907\u6CE8",
13893
+ width: 150
13894
+ }].map(function (item) {
13895
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13896
+ align: 'center',
13897
+ ellipsis: true
13898
+ });
13899
+ }),
13900
+ //管易补发商品信息
13901
+ GY_REISSUE_GOODS: [{
13902
+ dataIndex: 'goodName',
13903
+ title: "\u5546\u54C1\u540D\u79F0",
13904
+ width: 150
13905
+ }, {
13906
+ dataIndex: 'goodShortName',
13907
+ title: "\u5546\u54C1\u7B80\u79F0",
13908
+ width: 150
13909
+ }, {
13910
+ dataIndex: 'goodNo',
13911
+ title: "\u5546\u54C1\u7F16\u7801",
13912
+ width: 200
13913
+ }, {
13914
+ dataIndex: 'specName',
13915
+ title: "SKU\u540D\u79F0",
13916
+ align: 'center',
13917
+ ellipsis: true,
13918
+ width: 250
13919
+ }, {
13920
+ dataIndex: 'specNo',
13921
+ title: "SKU\u7F16\u7801",
13922
+ align: 'center',
13923
+ ellipsis: true,
13924
+ width: 150
13925
+ }, {
13926
+ dataIndex: 'qty',
13927
+ title: "\u6570\u91CF",
13928
+ width: 100,
13929
+ render: function render(val, record, index) {
13930
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13931
+ style: {
13932
+ width: 70
13933
+ },
13934
+ value: val,
13935
+ min: 1,
13936
+ precision: 0,
13937
+ onChange: function onChange(num) {
13938
+ updateDataHandle({
13939
+ qty: num,
13940
+ amount: num && isNumberOrNumberString(record.price) ? num * record.price : null,
13941
+ originAmount: num && isNumberOrNumberString(record.originPrice) ? num * record.originPrice : null
13942
+ }, index);
13943
+ }
13944
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13945
+ }
13946
+ }, {
13947
+ dataIndex: 'price',
13948
+ title: "\u5B9E\u9645\u5355\u4EF7",
13949
+ width: 150,
13950
+ render: function render(val, record, index) {
13951
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
13952
+ style: {
13953
+ width: 130
13954
+ },
13955
+ value: val,
13956
+ min: 0,
13957
+ precision: 2,
13958
+ onChange: function onChange(num) {
13959
+ updateDataHandle({
13960
+ price: num,
13961
+ amount: num && isNumberOrNumberString(record.qty) ? num * record.qty : null
13962
+ }, index);
13963
+ }
13964
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
13965
+ }
13966
+ }, {
13967
+ dataIndex: 'amount',
13968
+ title: "\u5B9E\u9645\u91D1\u989D",
13969
+ width: 150
13970
+ }, {
13971
+ dataIndex: 'originPrice',
13972
+ title: "\u6807\u51C6\u5355\u4EF7",
13973
+ width: 150
13974
+ }, {
13975
+ dataIndex: 'originAmount',
13976
+ title: "\u6807\u51C6\u91D1\u989D",
13977
+ width: 150
13978
+ }, {
13979
+ dataIndex: 'isGift',
13980
+ title: "\u662F\u5426\u8D60\u54C1",
13981
+ width: 150,
13982
+ render: function render(val, record, index) {
13983
+ return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
13984
+ value: val,
13985
+ onChange: function onChange(value) {
13986
+ updateHandle(value, index, 'isGift');
13987
+ },
13988
+ options: [{
13989
+ label: '是',
13990
+ value: 1
13991
+ }, {
13992
+ label: '否',
13993
+ value: 0
13994
+ }]
13995
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, getYesOrNo(val));
13996
+ }
13997
+ }].map(function (item) {
13998
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13999
+ align: 'center',
14000
+ ellipsis: true
14001
+ });
14002
+ })
14003
+ };
14004
+ };
14005
+
14006
+ var getColumns$5 = function getColumns(_ref) {
14007
+ var _ref$text = _ref.text,
13384
14008
  text = _ref$text === void 0 ? '' : _ref$text,
13385
14009
  disabled = _ref.disabled,
13386
14010
  updateHandle = _ref.updateHandle;
13387
- return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getColumns({
13388
- text: text,
13389
- disabled: disabled,
13390
- updateHandle: updateHandle
13391
- })), getColumns$1({
13392
- text: text,
13393
- disabled: disabled,
13394
- updateHandle: updateHandle
13395
- })), getColumns$2({
13396
- text: text,
13397
- disabled: disabled,
13398
- updateHandle: updateHandle
13399
- })), {}, {
14011
+ return {
14012
+ //bs商品信息
13400
14013
  default: [{
13401
14014
  dataIndex: 'mark',
13402
14015
  title: "\u5546\u54C1\u6807\u8BB0",
@@ -13493,6 +14106,43 @@ var getColumnsMap = function getColumnsMap(args) {
13493
14106
  ellipsis: true,
13494
14107
  width: 100
13495
14108
  }]
14109
+ };
14110
+ };
14111
+
14112
+ var getColumnsMap = function getColumnsMap(args) {
14113
+ var _ref = args || {},
14114
+ _ref$text = _ref.text,
14115
+ text = _ref$text === void 0 ? '' : _ref$text,
14116
+ disabled = _ref.disabled,
14117
+ updateHandle = _ref.updateHandle,
14118
+ updateDataHandle = _ref.updateDataHandle;
14119
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getColumns$1({
14120
+ text: text,
14121
+ disabled: disabled,
14122
+ updateHandle: updateHandle
14123
+ })), getColumns({
14124
+ text: text,
14125
+ disabled: disabled,
14126
+ updateHandle: updateHandle
14127
+ })), getColumns$2({
14128
+ text: text,
14129
+ disabled: disabled,
14130
+ updateHandle: updateHandle
14131
+ })), getColumns$3({
14132
+ text: text,
14133
+ disabled: disabled,
14134
+ updateHandle: updateHandle
14135
+ })), getColumns$4({
14136
+ text: text,
14137
+ disabled: disabled,
14138
+ updateHandle: updateHandle,
14139
+ updateDataHandle: updateDataHandle
14140
+ })), {}, {
14141
+ default: getColumns$5({
14142
+ text: text,
14143
+ disabled: disabled,
14144
+ updateHandle: updateHandle
14145
+ })['default']
13496
14146
  });
13497
14147
  };
13498
14148
  var getColumnsBaseInfo = function getColumnsBaseInfo() {
@@ -13650,6 +14300,9 @@ var getButtonText = function getButtonText() {
13650
14300
  if (['WDT_REISSUE_GOODS'].includes(type)) {
13651
14301
  return '选择旺店通商品';
13652
14302
  }
14303
+ if (['GY_GOODS', 'GY_REISSUE_GOODS'].includes(type)) {
14304
+ return '选择管易ERP商品';
14305
+ }
13653
14306
  return '选择商品';
13654
14307
  };
13655
14308
  var GoodItem$1 = function GoodItem(props) {
@@ -13741,6 +14394,12 @@ var GoodItem$1 = function GoodItem(props) {
13741
14394
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
13742
14395
  }
13743
14396
  };
14397
+ var updateDataHandle = function updateDataHandle(data, index) {
14398
+ if (value === null || value === void 0 ? void 0 : value.length) {
14399
+ value[index] = _objectSpread2(_objectSpread2({}, value[index]), data);
14400
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
14401
+ }
14402
+ };
13744
14403
  var COLUMNS_MAP = function COLUMNS_MAP() {
13745
14404
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13746
14405
  var operate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
@@ -13753,11 +14412,14 @@ var GoodItem$1 = function GoodItem(props) {
13753
14412
  case 'BS_E3_GOODS':
13754
14413
  case 'BS_GOODS':
13755
14414
  case 'WLN_GOODS':
14415
+ case 'GY_GOODS':
14416
+ case 'GY_REISSUE_GOODS':
13756
14417
  {
13757
14418
  columns = getColumnsMap({
13758
14419
  text: text,
13759
14420
  disabled: disabled,
13760
- updateHandle: updateHandle
14421
+ updateHandle: updateHandle,
14422
+ updateDataHandle: updateDataHandle
13761
14423
  })[type];
13762
14424
  }
13763
14425
  break;
@@ -13783,7 +14445,8 @@ var GoodItem$1 = function GoodItem(props) {
13783
14445
  columns = getColumnsMap({
13784
14446
  text: text,
13785
14447
  disabled: disabled,
13786
- updateHandle: updateHandle
14448
+ updateHandle: updateHandle,
14449
+ updateDataHandle: updateDataHandle
13787
14450
  })['default'];
13788
14451
  }
13789
14452
  return columns;
@@ -13906,6 +14569,28 @@ var GoodItem$1 = function GoodItem(props) {
13906
14569
  canUpdateNumber: canUpdateNumber
13907
14570
  });
13908
14571
  });
14572
+ } else if (['GY_GOODS', 'GY_REISSUE_GOODS'].includes(type)) {
14573
+ newList = list.map(function (item) {
14574
+ var goodName = item.goodName,
14575
+ goodShortName = item.goodShortName,
14576
+ goodNo = item.goodNo,
14577
+ specName = item.specName,
14578
+ specNo = item.specNo,
14579
+ retailPrice = item.retailPrice;
14580
+ return _objectSpread2(_objectSpread2({}, item), {}, {
14581
+ uuid: kmkfUtils.uuid(),
14582
+ canDelete: true,
14583
+ canEdit: true,
14584
+ qty: 1,
14585
+ goodName: goodName,
14586
+ goodShortName: goodShortName,
14587
+ goodNo: goodNo,
14588
+ specName: specName,
14589
+ specNo: specNo,
14590
+ originPrice: !kmkfUtils.isNull(retailPrice) ? Number(retailPrice) : null,
14591
+ originAmount: !kmkfUtils.isNull(retailPrice) ? Number(retailPrice) : null
14592
+ });
14593
+ });
13909
14594
  } else {
13910
14595
  newList = list.map(function (item) {
13911
14596
  var goodsId = item.goodsId,
@@ -14001,6 +14686,14 @@ var GoodItem$1 = function GoodItem(props) {
14001
14686
  shopId: shopId,
14002
14687
  maxLength: maxLength,
14003
14688
  companyKey: companyKey
14689
+ }) : ['GY_GOODS', 'GY_REISSUE_GOODS'].includes(type) ? /*#__PURE__*/React__default['default'].createElement(GyGoodsModal$1, {
14690
+ ref: refModal,
14691
+ onSubmit: onSubmit,
14692
+ width: width,
14693
+ shopList: shopList,
14694
+ shopId: shopId,
14695
+ maxLength: maxLength,
14696
+ companyKey: companyKey
14004
14697
  }) : /*#__PURE__*/React__default['default'].createElement(GoodsModal$2, {
14005
14698
  ref: refModal,
14006
14699
  onSubmit: onSubmit,
@@ -14692,19 +15385,66 @@ var getBsE3OrderListSingleton = function getBsE3OrderListSingleton(orderNo) {
14692
15385
  });
14693
15386
  singletonMap$1.set(orderNo, p);
14694
15387
  }
14695
- return singletonMap$1.get(orderNo);
15388
+ return singletonMap$1.get(orderNo);
15389
+ };
15390
+ var bsE3Utils = {
15391
+ getBsE3OrderListSingleton: getBsE3OrderListSingleton
15392
+ };
15393
+
15394
+ var singletonMap$2 = new Map();
15395
+ var getGyOrderListSingleton = function getGyOrderListSingleton(orderNo) {
15396
+ if (!singletonMap$2.has(orderNo)) {
15397
+ var p = new Promise(function (resolve, reject) {
15398
+ var doReject = function doReject(err) {
15399
+ // 清空掉错误的请求记录
15400
+ singletonMap$2.delete(orderNo);
15401
+ reject(err);
15402
+ };
15403
+ extendRequest('/qy/gdfw/oms/gyOrderDetail', {
15404
+ method: 'post',
15405
+ data: {
15406
+ tid: orderNo
15407
+ }
15408
+ }).then(function (res) {
15409
+ if (res === null || res === void 0 ? void 0 : res.success) {
15410
+ var _res$data;
15411
+ if (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.length) {
15412
+ res.data.trades = kmkfUtils.filterGyOrders(res === null || res === void 0 ? void 0 : res.data, orderNo).map(function (item) {
15413
+ return _objectSpread2(_objectSpread2({}, item), {}, {
15414
+ billNo: item.code,
15415
+ billType: item.orderTypeName,
15416
+ billTag: item.tagName,
15417
+ tradeTagName: item.tradeTagName,
15418
+ deliveryState: item.deliveryState,
15419
+ deliveryStateName: kmkfUtils.GY_DELIVERY_STATE_MAPPING[item.deliveryState]
15420
+ });
15421
+ });
15422
+ }
15423
+ resolve(res.data);
15424
+ // 延迟10秒清除,保证订单的时效性
15425
+ setTimeout(function () {
15426
+ singletonMap$2.delete(orderNo);
15427
+ }, 1000 * 10);
15428
+ } else {
15429
+ doReject(res);
15430
+ }
15431
+ }).catch(doReject);
15432
+ });
15433
+ singletonMap$2.set(orderNo, p);
15434
+ }
15435
+ return singletonMap$2.get(orderNo);
14696
15436
  };
14697
- var bsE3Utils = {
14698
- getBsE3OrderListSingleton: getBsE3OrderListSingleton
15437
+ var gyUtils = {
15438
+ getGyOrderListSingleton: getGyOrderListSingleton
14699
15439
  };
14700
15440
 
14701
- var singletonMap$2 = new Map();
15441
+ var singletonMap$3 = new Map();
14702
15442
  var getOrderListSingleton = function getOrderListSingleton(orderNo) {
14703
- if (!singletonMap$2.has(orderNo)) {
15443
+ if (!singletonMap$3.has(orderNo)) {
14704
15444
  var p = new Promise(function (resolve, reject) {
14705
15445
  var doReject = function doReject(err) {
14706
15446
  // 清空掉错误的请求记录
14707
- singletonMap$2.delete(orderNo);
15447
+ singletonMap$3.delete(orderNo);
14708
15448
  reject(err);
14709
15449
  };
14710
15450
  extendRequest('/qy/gdfw/order/kmErpOrderDetail', {
@@ -14730,151 +15470,36 @@ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
14730
15470
  }
14731
15471
  // 延迟10秒清除,保证订单的时效性
14732
15472
  setTimeout(function () {
14733
- singletonMap$2.delete(orderNo);
15473
+ singletonMap$3.delete(orderNo);
14734
15474
  }, 1000 * 10);
14735
15475
  } else {
14736
15476
  doReject(data);
14737
15477
  }
14738
15478
  }).catch(doReject);
14739
15479
  });
14740
- singletonMap$2.set(orderNo, p);
15480
+ singletonMap$3.set(orderNo, p);
14741
15481
  }
14742
- return singletonMap$2.get(orderNo);
15482
+ return singletonMap$3.get(orderNo);
14743
15483
  };
14744
15484
  var kmUtils = {
14745
15485
  getOrderListSingleton: getOrderListSingleton
14746
15486
  };
14747
15487
 
14748
15488
  var columnsMap = {
14749
- BS_SYSTEM_ORDER: [{
14750
- title: '单据类型',
14751
- dataIndex: 'billType',
14752
- width: 150
14753
- }, {
14754
- title: '系统订单号',
14755
- dataIndex: 'billNo',
14756
- width: 150
14757
- }, {
14758
- title: '标签',
14759
- dataIndex: 'billTag',
14760
- width: 150
14761
- }, {
14762
- title: '主播名称',
14763
- dataIndex: 'authorName',
14764
- width: 150
14765
- }, {
14766
- title: '主播ID',
14767
- dataIndex: 'authorId',
14768
- width: 150
14769
- }
14770
- // {
14771
- // title: '直播活动',
14772
- // dataIndex: 'liveActivites',
14773
- // width: 150,
14774
- // },
14775
- ],
14776
-
15489
+ BS_SYSTEM_ORDER: kmkfUtils.BS_SYSTEM_ORDER_CONFIG.columns,
14777
15490
  KM_SYSTEM_ORDER: kmkfUtils.KM_SYSTEM_ORDER_CONFIG.columns,
14778
- WLN_SYSTEM_ORDER: [{
14779
- title: '订单类型',
14780
- dataIndex: 'billType',
14781
- width: 150
14782
- }, {
14783
- title: '系统订单号',
14784
- dataIndex: 'billNo',
14785
- width: 150
14786
- }, {
14787
- title: '标记',
14788
- dataIndex: 'billTag',
14789
- width: 150
14790
- }],
14791
- WDT_SYSTEM_ORDER: [{
14792
- title: '订单类型',
14793
- dataIndex: 'billType',
14794
- width: 150
14795
- }, {
14796
- title: '系统订单号',
14797
- dataIndex: 'billNo',
14798
- width: 150
14799
- }, {
14800
- title: '订单标签',
14801
- dataIndex: 'billTag',
14802
- width: 150
14803
- }],
14804
- BS_E3_SYSTEM_ORDER: [{
14805
- title: '系统订单号',
14806
- dataIndex: 'orderSn',
14807
- width: 150,
14808
- ellipsis: true
14809
- }, {
14810
- title: '订单状态',
14811
- dataIndex: 'orderStatus',
14812
- width: 100,
14813
- ellipsis: true,
14814
- render: function render(val) {
14815
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_ORDER_STATUS_MAP[val] || val);
14816
- }
14817
- }, {
14818
- title: '是否被拆分',
14819
- dataIndex: 'isSplit',
14820
- width: 100,
14821
- ellipsis: true,
14822
- render: function render(val) {
14823
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14824
- }
14825
- }, {
14826
- title: '是否拆分子单',
14827
- dataIndex: 'isSplitNew',
14828
- width: 100,
14829
- ellipsis: true,
14830
- render: function render(val) {
14831
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14832
- }
14833
- }, {
14834
- title: '是否被合并',
14835
- dataIndex: 'isCombine',
14836
- width: 100,
14837
- ellipsis: true,
14838
- render: function render(val) {
14839
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14840
- }
14841
- }, {
14842
- title: '是否合并新单',
14843
- dataIndex: 'isCombineNew',
14844
- width: 100,
14845
- ellipsis: true,
14846
- render: function render(val) {
14847
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14848
- }
14849
- }, {
14850
- title: '是否复制单',
14851
- dataIndex: 'isCopy',
14852
- width: 100,
14853
- ellipsis: true,
14854
- render: function render(val) {
14855
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14856
- }
14857
- }, {
14858
- title: '是否换货单',
14859
- dataIndex: 'isExchangeOrder',
14860
- width: 100,
14861
- ellipsis: true,
14862
- render: function render(val) {
14863
- return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14864
- }
14865
- }, {
14866
- title: '订单备注',
14867
- dataIndex: 'orderMsg',
14868
- width: 150,
14869
- ellipsis: true
14870
- }]
15491
+ WLN_SYSTEM_ORDER: kmkfUtils.WLN_SYSTEM_ORDER_CONFIG.columns,
15492
+ WDT_SYSTEM_ORDER: kmkfUtils.WDT_SYSTEM_ORDER_CONFIG.columns,
15493
+ BS_E3_SYSTEM_ORDER: kmkfUtils.BS_E3_SYSTEM_ORDER_CONFIG.columns,
15494
+ GY_SYSTEM_ORDER: kmkfUtils.GY_SYSTEM_ORDER_CONFIG.columns
14871
15495
  };
14872
15496
  var rowKeyMap = {
14873
15497
  BS_SYSTEM_ORDER: 'billNo',
14874
15498
  KM_SYSTEM_ORDER: 'billNo',
14875
15499
  WLN_SYSTEM_ORDER: 'billNo',
14876
15500
  WDT_SYSTEM_ORDER: 'billNo',
14877
- BS_E3_SYSTEM_ORDER: 'orderSn'
15501
+ BS_E3_SYSTEM_ORDER: 'orderSn',
15502
+ GY_SYSTEM_ORDER: 'billNo'
14878
15503
  };
14879
15504
  var index$1 = (function (props) {
14880
15505
  var value = props.value,
@@ -14896,6 +15521,9 @@ var index$1 = (function (props) {
14896
15521
  getWdtOrderList(value.orderNo);
14897
15522
  } else if (type === 'BS_E3_SYSTEM_ORDER') {
14898
15523
  getBsE3OrderList(value.orderNo);
15524
+ } else if (type === 'GY_SYSTEM_ORDER') {
15525
+ console.log('触发gy--getGyOrderList--1');
15526
+ getGyOrderList(value.orderNo);
14899
15527
  }
14900
15528
  }
14901
15529
  }, [value, type]);
@@ -15082,6 +15710,45 @@ var index$1 = (function (props) {
15082
15710
  return _ref6.apply(this, arguments);
15083
15711
  };
15084
15712
  }();
15713
+ var getGyOrderList = /*#__PURE__*/function () {
15714
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(orderNo) {
15715
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
15716
+ while (1) switch (_context6.prev = _context6.next) {
15717
+ case 0:
15718
+ gyUtils.getGyOrderListSingleton(orderNo).then(function (data) {
15719
+ var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
15720
+ return kmkfUtils.getIsPlatformCodesIncludeOrderNos(item.platformCode, orderNo);
15721
+ });
15722
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
15723
+ orders: trades,
15724
+ showOrderInfo: trades.map(function (_ref9) {
15725
+ var billNo = _ref9.billNo,
15726
+ billType = _ref9.billType,
15727
+ billTag = _ref9.billTag,
15728
+ tradeTagName = _ref9.tradeTagName,
15729
+ deliveryState = _ref9.deliveryState;
15730
+ return {
15731
+ billNo: billNo,
15732
+ billType: billType,
15733
+ billTag: billTag,
15734
+ tradeTagName: tradeTagName,
15735
+ deliveryState: deliveryState,
15736
+ deliveryStateName: kmkfUtils.GY_DELIVERY_STATE_MAPPING[deliveryState]
15737
+ };
15738
+ })
15739
+ }));
15740
+ });
15741
+ onceRef.current = false;
15742
+ case 2:
15743
+ case "end":
15744
+ return _context6.stop();
15745
+ }
15746
+ }, _callee6);
15747
+ }));
15748
+ return function getGyOrderList(_x6) {
15749
+ return _ref8.apply(this, arguments);
15750
+ };
15751
+ }();
15085
15752
  var rowSelection = {
15086
15753
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
15087
15754
  fixed: true,
@@ -15098,7 +15765,24 @@ var index$1 = (function (props) {
15098
15765
  };
15099
15766
  }
15100
15767
  };
15101
- return /*#__PURE__*/React__default['default'].createElement(antd.Table, {
15768
+ // useEffect(() => {
15769
+ // const dom = document.querySelector(
15770
+ // `.${type}_SYSTEM_ORDER_COMPONENT .ant-table-content`,
15771
+ // );
15772
+ // //解决列表出现横向滚动条时选择数据造成行内闪烁问题
15773
+ // if (
15774
+ // (value?.selectIds || []).length > 0 &&
15775
+ // dom &&
15776
+ // dom.scrollWidth > dom.clientWidth &&
15777
+ // dom.scrollLeft === 0
15778
+ // ) {
15779
+ // console.log(dom.scrollWidth > dom.clientWidth, dom.scrollLeft === 0);
15780
+ // dom.scrollLeft = 1;
15781
+ // }
15782
+ // }, [JSON.stringify(value?.selectIds || [])]);
15783
+ return /*#__PURE__*/React__default['default'].createElement("div", {
15784
+ className: "".concat(type, "_SYSTEM_ORDER_COMPONENT")
15785
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
15102
15786
  dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
15103
15787
  columns: columns,
15104
15788
  rowSelection: rowSelection,
@@ -15106,12 +15790,12 @@ var index$1 = (function (props) {
15106
15790
  size: "small",
15107
15791
  pagination: false,
15108
15792
  scroll: {
15109
- x: '100%'
15793
+ x: 'max-content'
15110
15794
  },
15111
15795
  locale: {
15112
15796
  emptyText: '暂无数据'
15113
15797
  }
15114
- });
15798
+ }));
15115
15799
  });
15116
15800
 
15117
15801
  var WlnGoods = function WlnGoods(props) {
@@ -15137,13 +15821,14 @@ var WlnGoods = function WlnGoods(props) {
15137
15821
  };
15138
15822
 
15139
15823
  var componentMap$1 = {
15140
- 'WDT_GOODS': {
15824
+ WDT_GOODS: {
15141
15825
  type: 'wdt',
15142
15826
  key: 'wdtGoods',
15143
15827
  name: '旺店通',
15144
15828
  orderNo: 'srcTid',
15145
15829
  goodDetailOrderNo: 'srcTid',
15146
15830
  eventNameMap: {
15831
+ // pubsub 事件
15147
15832
  type: 'wdtType',
15148
15833
  updateGoodsHandle: kmkfUtils.updateWdtGoodsHandle,
15149
15834
  selectListReturn: 'wdtSelectListReturn',
@@ -15161,13 +15846,14 @@ var componentMap$1 = {
15161
15846
  exchangeDeleteGood: 'wdtExchangeDeleteGood'
15162
15847
  }
15163
15848
  },
15164
- 'BS_E3_GOODS': {
15849
+ BS_E3_GOODS: {
15165
15850
  type: 'e3',
15166
15851
  key: 'bsE3Goods',
15167
15852
  name: '百胜E3',
15168
15853
  orderNo: 'dealCode',
15169
15854
  goodDetailOrderNo: 'originalDealCode',
15170
15855
  eventNameMap: {
15856
+ // pubsub 事件
15171
15857
  type: 'bsE3Type',
15172
15858
  updateGoodsHandle: kmkfUtils.updateBsE3GoodsHandle,
15173
15859
  selectListReturn: 'bsE3SelectListReturn',
@@ -15184,6 +15870,31 @@ var componentMap$1 = {
15184
15870
  returnDeleteGood: 'bsE3ReturnDeleteGood',
15185
15871
  exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
15186
15872
  }
15873
+ },
15874
+ GY_GOODS: {
15875
+ type: 'gy',
15876
+ key: 'gyGoods',
15877
+ name: '管易',
15878
+ orderNo: 'dealCode',
15879
+ goodDetailOrderNo: 'originalDealCode',
15880
+ eventNameMap: {
15881
+ // pubsub 事件
15882
+ type: 'gyType',
15883
+ updateGoodsHandle: kmkfUtils.updateGyGoodsHandle,
15884
+ selectListReturn: 'gySelectListReturn',
15885
+ selectList: 'gySelectList',
15886
+ reissueSelectList: 'gyReissueSelectList',
15887
+ reissueSelectListReturn: 'gyReissueSelectListReturn',
15888
+ reissueDeleteGood: 'gyReissueDeleteGood',
15889
+ changeShopCode: 'gyChangeShopCode',
15890
+ reissueType: 'gyReissueType',
15891
+ returnType: 'gyReturnType',
15892
+ returnSelectListReturn: 'gyReturnSelectListReturn',
15893
+ returnSelectList: 'gyReturnSelectList',
15894
+ deleteGood: 'gyDeleteGood',
15895
+ returnDeleteGood: 'gyReturnDeleteGood',
15896
+ exchangeDeleteGood: 'gyExchangeDeleteGood'
15897
+ }
15187
15898
  }
15188
15899
  };
15189
15900
  var CommonGoods = function CommonGoods(props) {
@@ -16586,15 +17297,6 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
16586
17297
  };
16587
17298
 
16588
17299
  var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
16589
- var msgTypeCh = {
16590
- ding: '钉钉',
16591
- wechat: '微信',
16592
- qq: 'QQ',
16593
- qywx: '企业微信',
16594
- YZDKH: '邮政拦截',
16595
- YT: '圆通拦截',
16596
- feishu: '飞书'
16597
- };
16598
17300
  var MsgStatus = function MsgStatus(props) {
16599
17301
  var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
16600
17302
  var _props$value = props.value,
@@ -16635,7 +17337,7 @@ var MsgStatus = function MsgStatus(props) {
16635
17337
  onClick: function onClick() {
16636
17338
  return setChangeIndex(index);
16637
17339
  }
16638
- }, msgTypeCh[key], item.ruleName);
17340
+ }, kmkfUtils.msgTypeCh[key], item.ruleName);
16639
17341
  }))) : null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
16640
17342
  showSearch: true,
16641
17343
  value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
@@ -16907,6 +17609,255 @@ var bsE3Reissue = function bsE3Reissue(props) {
16907
17609
  })));
16908
17610
  };
16909
17611
 
17612
+ var _excluded$l = ["value", "onChange", "reasonList", "disabled", "type"],
17613
+ _excluded2 = ["billNo", "billType", "billTag", "tradeTagName", "deliveryState"];
17614
+ var typeMap$3 = {
17615
+ GY_REISSUE_GOODS: {
17616
+ key: 'gyReissueGoods',
17617
+ name: '管易',
17618
+ typeName: 'gyReissueType',
17619
+ systemOrder: 'gySystemOrder',
17620
+ systemOrderNo: 'gySystemOrderNo',
17621
+ reissueSelectList: 'gyReissueSelectList',
17622
+ reissueSelectListReturn: 'gyReissueSelectListReturn',
17623
+ reissueDeleteGood: 'gyReissueDeleteGood',
17624
+ changeShopCode: 'gyChangeShopCode',
17625
+ reissueType: 'gyReissueType',
17626
+ formatDefaultField: {
17627
+ money: 'orderPrice',
17628
+ share: 'sharePrice'
17629
+ },
17630
+ getOrderList: gyUtils.getGyOrderListSingleton
17631
+ }
17632
+ };
17633
+ var GyReissue = function GyReissue(props) {
17634
+ var _value$gySystemOrder, _typeMap$type26, _typeMap$type28, _typeMap$type29, _value$typeMap$type$s5, _typeMap$type30, _typeMap$type31, _typeMap$type32;
17635
+ var value = props.value,
17636
+ onChange = props.onChange,
17637
+ _props$reasonList = props.reasonList,
17638
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
17639
+ disabled = props.disabled,
17640
+ type = props.type,
17641
+ other = _objectWithoutProperties(props, _excluded$l);
17642
+ var showModeBtn = ((value === null || value === void 0 ? void 0 : (_value$gySystemOrder = value.gySystemOrder) === null || _value$gySystemOrder === void 0 ? void 0 : _value$gySystemOrder.orders) || []).some(function (order) {
17643
+ var _order$platformCode;
17644
+ return order === null || order === void 0 ? void 0 : (_order$platformCode = order.platformCode) === null || _order$platformCode === void 0 ? void 0 : _order$platformCode.includes(';');
17645
+ });
17646
+ var getOrderFlag = React.useRef(false);
17647
+ var _useState = React.useState(false),
17648
+ _useState2 = _slicedToArray(_useState, 2),
17649
+ isStrict = _useState2[0],
17650
+ setIsStrict = _useState2[1];
17651
+ React.useEffect(function () {
17652
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
17653
+ if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$3[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.systemOrder]) === null || _value$typeMap$type$s === void 0 ? void 0 : (_value$typeMap$type$s2 = _value$typeMap$type$s.orders) === null || _value$typeMap$type$s2 === void 0 ? void 0 : _value$typeMap$type$s2.length) && (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s3 = value[(_typeMap$type2 = typeMap$3[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.systemOrder]) === null || _value$typeMap$type$s3 === void 0 ? void 0 : _value$typeMap$type$s3.orderNo)) {
17654
+ var _value$typeMap$type$s4, _typeMap$type3;
17655
+ getOrderFlag.current = true;
17656
+ getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$3[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.systemOrder]) === null || _value$typeMap$type$s4 === void 0 ? void 0 : _value$typeMap$type$s4.orderNo);
17657
+ }
17658
+ return;
17659
+ }, [value]);
17660
+ var getOrderList = /*#__PURE__*/function () {
17661
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
17662
+ var _typeMap$type4;
17663
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
17664
+ while (1) switch (_context.prev = _context.next) {
17665
+ case 0:
17666
+ (_typeMap$type4 = typeMap$3[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
17667
+ var _typeMap$type5, _typeMap$type6;
17668
+ var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
17669
+ var showOrderInfo = orders.map(function (_ref2) {
17670
+ var billNo = _ref2.billNo,
17671
+ billType = _ref2.billType,
17672
+ billTag = _ref2.billTag,
17673
+ tradeTagName = _ref2.tradeTagName,
17674
+ deliveryState = _ref2.deliveryState,
17675
+ rest = _objectWithoutProperties(_ref2, _excluded2);
17676
+ return _objectSpread2(_objectSpread2({}, rest), {}, {
17677
+ billNo: billNo,
17678
+ billType: billType,
17679
+ billTag: billTag,
17680
+ tradeTagName: tradeTagName,
17681
+ deliveryState: deliveryState,
17682
+ deliveryStateName: kmkfUtils.GY_DELIVERY_STATE_MAPPING[deliveryState]
17683
+ });
17684
+ });
17685
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$3[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$3[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
17686
+ showOrderInfo: showOrderInfo,
17687
+ orders: orders
17688
+ }))));
17689
+ });
17690
+ case 1:
17691
+ case "end":
17692
+ return _context.stop();
17693
+ }
17694
+ }, _callee);
17695
+ }));
17696
+ return function getOrderList(_x) {
17697
+ return _ref.apply(this, arguments);
17698
+ };
17699
+ }();
17700
+ var changeTypeHandle = function changeTypeHandle(val) {
17701
+ var _value$typeMap$type$t, _typeMap$type7, _typeMap$type8;
17702
+ var typeName = val === null || val === void 0 ? void 0 : val[0];
17703
+ if (typeName === (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type7 = typeMap$3[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) return;
17704
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
17705
+ var newValue = _objectSpread2({}, value);
17706
+ newValue[(_typeMap$type8 = typeMap$3[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName] = val;
17707
+ if (typeName === '1') {
17708
+ var _typeMap$type9;
17709
+ newValue[(_typeMap$type9 = typeMap$3[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = getGoodDetails({
17710
+ mode: isStrict
17711
+ });
17712
+ } else if (typeName === '2') {
17713
+ var _typeMap$type10;
17714
+ // 切换到非原单,清空列表
17715
+ newValue[(_typeMap$type10 = typeMap$3[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key] = [];
17716
+ }
17717
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17718
+ };
17719
+ var handleModeChange = function handleModeChange(mode) {
17720
+ var _value$typeMap$type$t2, _typeMap$type11, _typeMap$type12;
17721
+ var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type11 = typeMap$3[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0]) === '1';
17722
+ setIsStrict(mode);
17723
+ if (!isOriginalOrder) return;
17724
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type12 = typeMap$3[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key, getGoodDetails({
17725
+ mode: mode
17726
+ }))));
17727
+ };
17728
+ var getGoodDetails = function getGoodDetails(_ref3) {
17729
+ var _typeMap$type13, _typeMap$type14, _order$details;
17730
+ var mode = _ref3.mode,
17731
+ sysOrderNo = _ref3.sysOrderNo;
17732
+ var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$3[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrder];
17733
+ var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type14 = typeMap$3[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.systemOrderNo];
17734
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
17735
+ return order.code === systemOrderNo;
17736
+ });
17737
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$details = order.details) === null || _order$details === void 0 ? void 0 : _order$details.length) ? kmkfUtils.updateGyGoodsHandle([order]) : [];
17738
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
17739
+ return mode ? goodDetails.filter(function (goodItem) {
17740
+ return !orderNo || (orderNo || '').includes(goodItem.oid);
17741
+ }) : goodDetails;
17742
+ };
17743
+ var changeGoodHandle = function changeGoodHandle(val) {
17744
+ var _typeMap$type15;
17745
+ var newValue = _objectSpread2({}, value);
17746
+ newValue["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type15 = typeMap$3[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.key)] = (val || []).map(function (item) {
17747
+ var _typeMap$type16, _typeMap$type17;
17748
+ item["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type16 = typeMap$3[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.formatDefaultField.money)] = 0;
17749
+ item["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type17 = typeMap$3[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.share)] = 0;
17750
+ return item;
17751
+ });
17752
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17753
+ };
17754
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
17755
+ var _typeMap$type18, _value$typeMap$type$t3, _typeMap$type19, _value$typeMap$type$t4, _typeMap$type21;
17756
+ var newValue = _objectSpread2({}, value);
17757
+ newValue["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type18 = typeMap$3[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.systemOrderNo)] = val;
17758
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type19 = typeMap$3[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
17759
+ var _typeMap$type20;
17760
+ newValue["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type20 = typeMap$3[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = [];
17761
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type21 = typeMap$3[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0])) {
17762
+ var _typeMap$type22;
17763
+ newValue["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type22 = typeMap$3[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)] = getGoodDetails({
17764
+ mode: isStrict,
17765
+ sysOrderNo: val
17766
+ });
17767
+ }
17768
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17769
+ };
17770
+ var selectedGoodsChange = React.useCallback(function (skuList) {
17771
+ var _typeMap$type23, _typeMap$type24, _uniqBy, _typeMap$type25;
17772
+ var newValue = _objectSpread2({}, value);
17773
+ // 原订单商品
17774
+ var originTradeGoodList = getGoodDetails({
17775
+ mode: isStrict
17776
+ }) || [];
17777
+ // 当前选中的所有商品【包含了原订单+商品库】
17778
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type23 = typeMap$3[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)]) || [];
17779
+ newValue["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type24 = typeMap$3[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
17780
+ return skuList.includes(item.uuid);
17781
+ });
17782
+ console.log('商品发生变化', newValue["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type25 = typeMap$3[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.key)]);
17783
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
17784
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type26 = typeMap$3[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.key)], isStrict]);
17785
+ //显示选择商品按钮 原单换不显示选择商品
17786
+ var showChangeBtn = React.useMemo(function () {
17787
+ var _typeMap$type27;
17788
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$3[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]);
17789
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type28 = typeMap$3[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.systemOrderNo]]);
17790
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
17791
+ gutter: 8,
17792
+ wrap: true
17793
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
17794
+ className: "gutter-row",
17795
+ xs: {
17796
+ span: 11
17797
+ },
17798
+ sm: {
17799
+ span: 6
17800
+ }
17801
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
17802
+ style: {
17803
+ marginBottom: '8px'
17804
+ },
17805
+ disabled: disabled,
17806
+ allowClear: false,
17807
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type29 = typeMap$3[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.systemOrderNo)],
17808
+ onChange: function onChange(val) {
17809
+ return changeSystemOrderHandle(val);
17810
+ },
17811
+ placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
17812
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type30 = typeMap$3[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
17813
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
17814
+ key: item.billNo,
17815
+ value: item.billNo,
17816
+ label: item.billNo
17817
+ }, item.billNo);
17818
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
17819
+ className: "gutter-row",
17820
+ xs: {
17821
+ span: 11
17822
+ },
17823
+ sm: {
17824
+ span: 6
17825
+ }
17826
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
17827
+ style: {
17828
+ marginBottom: '8px'
17829
+ },
17830
+ disabled: disabled,
17831
+ allowClear: false,
17832
+ options: reasonList,
17833
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type31 = typeMap$3[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.typeName)],
17834
+ onChange: function onChange(val) {
17835
+ return changeTypeHandle(val);
17836
+ }
17837
+ }))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
17838
+ key: 'reissueGoods'
17839
+ }, other), {}, {
17840
+ type: type,
17841
+ disabled: disabled,
17842
+ canUpdateNumber: showChangeBtn,
17843
+ showChangeBtn: showChangeBtn,
17844
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
17845
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$3 === null || typeMap$3 === void 0 ? void 0 : (_typeMap$type32 = typeMap$3[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)],
17846
+ onChange: function onChange(val) {
17847
+ return changeGoodHandle(val);
17848
+ },
17849
+ onModeChange: handleModeChange,
17850
+ showModeBtn: showModeBtn,
17851
+ isStrict: isStrict,
17852
+ tradeGoods: {
17853
+ originDataSource: getGoodDetails({
17854
+ mode: isStrict
17855
+ }),
17856
+ selectedGoodsChange: selectedGoodsChange
17857
+ }
17858
+ })));
17859
+ };
17860
+
16910
17861
  exports.Address = ApaasAddress;
16911
17862
  exports.AliPay = AliPay;
16912
17863
  exports.ApaasAddress = Province;
@@ -16945,6 +17896,7 @@ exports.CommonSystemOrder = CommonSystemOrder;
16945
17896
  exports.ExpressLogistics = ExpressLogistics;
16946
17897
  exports.Goods = Goods;
16947
17898
  exports.GoodsTable = index$2;
17899
+ exports.GyReissue = GyReissue;
16948
17900
  exports.IdentifyAddress = IdentifyAddress;
16949
17901
  exports.Invoice = Invoice;
16950
17902
  exports.JstGoods = jstGoods;