@kmkf-fe-packages/basic-components 2.0.0-rc.0 → 2.0.0-rc.10

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, CloseCircleOutlined, CaretUpOutlined } 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, request as request$1, ExpressData, uuid, LogisticsAddressData, WdtSendData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
- import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight } from 'lodash';
6
+ import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterKmOrders, KM_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
7
+ import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty, intersection, uniqBy } 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';
@@ -917,17 +917,18 @@ function dataURLtoFile(dataurl, filename) {
917
917
  });
918
918
  }
919
919
 
920
- var css_248z$1 = ".index-module_imageBox__8zj7A {\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_imageBox__8zj7A .ant-upload-picture-card-wrapper {\n width: auto;\n}\n.index-module_imageBox__8zj7A .index-module_inputImage__3VrvC {\n width: 80px;\n height: 80px;\n border: 1px dashed #ccc;\n outline: none;\n background-color: rgba(0, 0, 0, 0);\n text-indent: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageShow__3wD4d {\n padding: 8px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo {\n width: 80px;\n height: 80px;\n position: relative;\n border-radius: 2px;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover {\n background: transparent;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover .index-module_mask__3LUIn:before {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo .index-module_delete__2cFpf {\n position: absolute;\n right: 0px;\n top: 0px;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn::before {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: all 0.3s;\n content: ' ';\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn:hover .index-module_actions__2tY_V {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 10;\n white-space: nowrap;\n transform: translate(-50%, -50%);\n opacity: 0;\n transition: all 0.3s;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V .index-module_icon__ZI-2P {\n font-size: 16px;\n color: #fff;\n padding: 0 4px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 {\n display: inline-block;\n margin-right: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA {\n width: 80px;\n height: 80px;\n border-radius: 2px;\n background: #F2F3F5;\n text-align: center;\n color: #86909C;\n padding-top: 16px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload {\n height: 80px;\n width: 80px;\n border: none;\n background-color: #F2F3F5;\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_tips__1ATcr {\n color: #4E5969;\n font-size: 12px;\n}\n";
921
- var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-module_inputImage__3VrvC","imageShow":"index-module_imageShow__3wD4d","imageWrap":"index-module_imageWrap__JkMJo","-webkit-mask":"index-module_mask__3LUIn","mask":"index-module_mask__3LUIn","delete":"index-module_delete__2cFpf","actions":"index-module_actions__2tY_V","icon":"index-module_icon__ZI-2P","imagePaste":"index-module_imagePaste__2X-K1","fakeBox":"index-module_fakeBox__2_3rA","addBtn":"index-module_addBtn__2m5lC","upload":"index-module_upload__2igU3","tips":"index-module_tips__1ATcr"};
920
+ var css_248z$1 = ".index-module_imageBox__8zj7A {\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_imageBox__8zj7A .ant-upload-picture-card-wrapper {\n width: auto;\n}\n.index-module_imageBox__8zj7A .index-module_inputImage__3VrvC {\n width: 80px;\n height: 80px;\n border: 1px dashed #ccc;\n outline: none;\n background-color: rgba(0, 0, 0, 0);\n text-indent: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageShow__3wD4d {\n padding: 8px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo {\n width: 80px;\n height: 80px;\n position: relative;\n border-radius: 2px;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover {\n background: transparent;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover .index-module_mask__3LUIn:before {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo .index-module_deleteIcon__20Wzd {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn::before {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: all 0.3s;\n content: ' ';\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn:hover .index-module_actions__2tY_V {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 10;\n white-space: nowrap;\n transform: translate(-50%, -50%);\n opacity: 0;\n transition: all 0.3s;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V .index-module_icon__ZI-2P {\n font-size: 16px;\n color: #fff;\n padding: 0 4px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 {\n display: inline-block;\n margin-right: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA {\n width: 80px;\n height: 80px;\n border-radius: 2px;\n background: #F2F3F5;\n text-align: center;\n color: #86909C;\n padding-top: 16px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload {\n height: 80px;\n width: 80px;\n border: none;\n background-color: #F2F3F5;\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_tips__1ATcr {\n color: #4E5969;\n font-size: 12px;\n}\n";
921
+ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-module_inputImage__3VrvC","imageShow":"index-module_imageShow__3wD4d","imageWrap":"index-module_imageWrap__JkMJo","-webkit-mask":"index-module_mask__3LUIn","mask":"index-module_mask__3LUIn","deleteIcon":"index-module_deleteIcon__20Wzd","actions":"index-module_actions__2tY_V","icon":"index-module_icon__ZI-2P","imagePaste":"index-module_imagePaste__2X-K1","fakeBox":"index-module_fakeBox__2_3rA","addBtn":"index-module_addBtn__2m5lC","upload":"index-module_upload__2igU3","tips":"index-module_tips__1ATcr"};
922
922
  styleInject(css_248z$1);
923
923
 
924
- var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
924
+ var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl", "platform"];
925
925
  var fn$1 = function fn() {
926
926
  return void 0;
927
927
  };
928
928
  var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
929
+ var _document;
929
930
  var _ref$maxCount = _ref.maxCount,
930
- maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
931
+ maxCount = _ref$maxCount === void 0 ? 20 : _ref$maxCount,
931
932
  _ref$maxSize = _ref.maxSize,
932
933
  maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
933
934
  _ref$uploadText = _ref.uploadText,
@@ -939,7 +940,6 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
939
940
  _ref$accept = _ref.accept,
940
941
  accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
941
942
  _ref$canPreview = _ref.canPreview,
942
- canPreview = _ref$canPreview === void 0 ? true : _ref$canPreview,
943
943
  _ref$disabled = _ref.disabled,
944
944
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
945
945
  uniqueKey = _ref.uniqueKey,
@@ -947,6 +947,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
947
947
  hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
948
948
  _ref$actionUrl = _ref.actionUrl,
949
949
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
950
+ _ref$platform = _ref.platform,
951
+ platform = _ref$platform === void 0 ? '' : _ref$platform,
950
952
  resetProps = _objectWithoutProperties(_ref, _excluded$6);
951
953
  var inputRef = useRef(null);
952
954
  var valueRef = useRef(value);
@@ -954,18 +956,13 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
954
956
  _useState2 = _slicedToArray(_useState, 2),
955
957
  uploading = _useState2[0],
956
958
  setUploading = _useState2[1];
957
- var _useState3 = useState(false),
959
+ var _useState3 = useState(true),
958
960
  _useState4 = _slicedToArray(_useState3, 2),
959
- visible = _useState4[0],
960
- setVisible = _useState4[1];
961
- var _useState5 = useState(''),
962
- _useState6 = _slicedToArray(_useState5, 2),
963
- currentPreviewImg = _useState6[0],
964
- setCurrentPreviewImg = _useState6[1];
965
- var _useState7 = useState(true),
966
- _useState8 = _slicedToArray(_useState7, 2),
967
- pasteDefaultStates = _useState8[0],
968
- setPasteDefaultStates = _useState8[1];
961
+ pasteDefaultStates = _useState4[0],
962
+ setPasteDefaultStates = _useState4[1];
963
+ var preview = platform === 'ks' ? {
964
+ getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('root')
965
+ } : true;
969
966
  useEffect(function () {
970
967
  valueRef.current = value;
971
968
  }, [value]);
@@ -1096,39 +1093,27 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1096
1093
  }));
1097
1094
  };
1098
1095
  };
1099
- var handlePreview = function handlePreview(imgUrl) {
1100
- return function () {
1101
- setCurrentPreviewImg(imgUrl);
1102
- setVisible(true);
1103
- };
1104
- };
1105
1096
  var renderImages = function renderImages(images) {
1106
- return images.map(function (image, index) {
1097
+ return /*#__PURE__*/React.createElement(Image.PreviewGroup, {
1098
+ preview: preview
1099
+ }, images.map(function (image, index) {
1107
1100
  var finalImage = "".concat(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image, "?x-oss-process=image/resize,h_60,w_60");
1101
+ var showImage = /^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image;
1108
1102
  return /*#__PURE__*/React.createElement("div", {
1109
1103
  className: styles$1.imageWrap,
1110
1104
  key: index
1111
- }, /*#__PURE__*/React.createElement("div", {
1112
- className: styles$1.mask
1113
- }, /*#__PURE__*/React.createElement("img", {
1114
- src: finalImage
1115
- }), /*#__PURE__*/React.createElement("div", {
1116
- className: styles$1.actions
1117
- }, canPreview && /*#__PURE__*/React.createElement(EyeOutlined, {
1118
- style: {
1119
- fontSize: '16px',
1120
- color: '#FFF',
1121
- marginRight: '8px'
1122
- },
1123
- onClick: handlePreview(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image)
1124
- }), /*#__PURE__*/React.createElement(DeleteOutlined, {
1125
- style: {
1126
- fontSize: '16px',
1127
- color: '#FFF'
1105
+ }, /*#__PURE__*/React.createElement(Image, {
1106
+ src: finalImage,
1107
+ preview: {
1108
+ src: showImage
1128
1109
  },
1110
+ width: '100%',
1111
+ height: '80%'
1112
+ }), /*#__PURE__*/React.createElement("div", {
1113
+ className: styles$1.deleteIcon,
1129
1114
  onClick: handleDelete(index)
1130
- }))));
1131
- });
1115
+ }, "\u5220\u9664"));
1116
+ }));
1132
1117
  };
1133
1118
  useEffect(function () {
1134
1119
  var _inputRef$current2;
@@ -1187,21 +1172,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1187
1172
  beforeUpload: beforeUpload
1188
1173
  }, resetProps), value.length >= maxCount ? null : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
1189
1174
  className: "addBtn"
1190
- }, "+"), /*#__PURE__*/React.createElement("div", null, uploadText))), /*#__PURE__*/React.createElement(Image, {
1191
- width: 0,
1192
- style: {
1193
- display: visible ? '' : 'none'
1194
- },
1195
- src: currentPreviewImg,
1196
- preview: {
1197
- visible: visible,
1198
- src: "".concat(currentPreviewImg),
1199
- onVisibleChange: function onVisibleChange(value) {
1200
- setCurrentPreviewImg('');
1201
- setVisible(value);
1202
- }
1203
- }
1204
- })));
1175
+ }, "+"), /*#__PURE__*/React.createElement("div", null, uploadText)))));
1205
1176
  };
1206
1177
  var index = /*#__PURE__*/forwardRef(ApaasUploadAsync);
1207
1178
 
@@ -6892,7 +6863,7 @@ var fn$2 = function fn() {
6892
6863
  };
6893
6864
  var ApaasUploadFile = function ApaasUploadFile(_ref) {
6894
6865
  var _ref$maxCount = _ref.maxCount,
6895
- maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
6866
+ maxCount = _ref$maxCount === void 0 ? 20 : _ref$maxCount,
6896
6867
  _ref$maxSize = _ref.maxSize,
6897
6868
  maxSize = _ref$maxSize === void 0 ? 100 : _ref$maxSize,
6898
6869
  _ref$onChange = _ref.onChange,
@@ -9592,10 +9563,29 @@ var GoodItem = function GoodItem(props) {
9592
9563
  return _ref5.apply(this, arguments);
9593
9564
  };
9594
9565
  }();
9595
- var headerList = showHeader || {
9596
- 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9597
- ]
9598
- }[type] || [];
9566
+ var headerList = useMemo(function () {
9567
+ if (!Array.isArray(showHeader)) return ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9568
+ ];
9569
+
9570
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9571
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9572
+ var dataIndexList = [];
9573
+ if (isStringArray) {
9574
+ dataIndexList = showHeader;
9575
+ } else if (isObjectArray) {
9576
+ dataIndexList = showHeader.map(function (item) {
9577
+ return item.dataIndex;
9578
+ });
9579
+ }
9580
+ return isStringArray ? showHeader : isObjectArray ? showHeader.filter(function (item) {
9581
+ return item.show !== false;
9582
+ }).map(function (item) {
9583
+ return item.dataIndex;
9584
+ }) : [] || {
9585
+ 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9586
+ ]
9587
+ }[type] || [];
9588
+ }, [showHeader]);
9599
9589
  //修改参数
9600
9590
  var handleChangeValue = function handleChangeValue(key, index) {
9601
9591
  return function (e) {
@@ -9610,35 +9600,57 @@ var GoodItem = function GoodItem(props) {
9610
9600
  };
9611
9601
  };
9612
9602
  // TODO: 目前只做了type 1的处理,其他的还是走老的文件 ./index.tsx
9613
- var goodItemAttrs = [{
9614
- isShow: headerList.includes('title'),
9615
- key: 'title',
9616
- label: '商品名称'
9617
- }, {
9618
- isShow: headerList.includes('outerId'),
9619
- key: 'outerId',
9620
- label: '商品编码'
9621
- },
9622
- // { isShow: headerList.includes('picUrl'), key: 'picUrl', label: '图片' },
9623
- {
9624
- isShow: headerList.includes('numIid'),
9625
- key: 'numIid',
9626
- label: '商品id'
9627
- }, {
9628
- isShow: changeSku && headerList.includes('skuId'),
9629
- key: 'skuId',
9630
- label: 'SKU ID'
9631
- }, {
9632
- isShow: changeSku && headerList.includes('outerSkuId'),
9633
- key: 'outerSkuId',
9634
- label: 'SKU 编码'
9635
- }, {
9636
- isShow: changeSku && headerList.includes('propertiesName'),
9637
- key: 'propertiesName',
9638
- label: 'SKU 信息'
9639
- }];
9640
- var hasPic = headerList.includes('picUrl');
9641
- var hasAttr = hasPic ? headerList.length > 1 : headerList.length > 0;
9603
+ var goodItemAttrs = useMemo(function () {
9604
+ var initList = [{
9605
+ isShow: headerList.includes('title'),
9606
+ key: 'title',
9607
+ label: '商品名称'
9608
+ }, {
9609
+ isShow: headerList.includes('outerId'),
9610
+ key: 'outerId',
9611
+ label: '商品编码'
9612
+ },
9613
+ // { isShow: headerList.includes('picUrl'), key: 'picUrl', label: '图片' },
9614
+ {
9615
+ isShow: headerList.includes('numIid'),
9616
+ key: 'numIid',
9617
+ label: '商品id'
9618
+ }, {
9619
+ isShow: changeSku && headerList.includes('skuId'),
9620
+ key: 'skuId',
9621
+ label: 'SKU ID'
9622
+ }, {
9623
+ isShow: changeSku && headerList.includes('outerSkuId'),
9624
+ key: 'outerSkuId',
9625
+ label: 'SKU 编码'
9626
+ }, {
9627
+ isShow: changeSku && headerList.includes('propertiesName'),
9628
+ key: 'propertiesName',
9629
+ label: 'SKU 信息'
9630
+ }];
9631
+ if (!Array.isArray(showHeader)) return initList;
9632
+ var newList = [];
9633
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9634
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9635
+ (isStringArray ? showHeader : isObjectArray ? showHeader.map(function (item) {
9636
+ return item.dataIndex;
9637
+ }) : []).forEach(function (dataIndex) {
9638
+ if (initList.find(function (item) {
9639
+ return item.key === dataIndex;
9640
+ })) {
9641
+ newList.push(initList.find(function (item) {
9642
+ return item.key === dataIndex;
9643
+ }));
9644
+ }
9645
+ });
9646
+ return newList;
9647
+ }, [headerList, showHeader]);
9648
+ var hasPic = useMemo(function () {
9649
+ return headerList.includes('picUrl');
9650
+ }, [headerList]);
9651
+ var hasAttr = useMemo(function () {
9652
+ return hasPic ? headerList.length > 1 : headerList.length > 0;
9653
+ }, [hasPic, headerList]);
9642
9654
  return /*#__PURE__*/React.createElement("div", null, imgList.length === 0 ? /*#__PURE__*/React.createElement("p", {
9643
9655
  className: "goods-title"
9644
9656
  }, "\u6700\u591A\u6DFB\u52A0", maxLength, "\u4E2A\u5B9D\u8D1D") : /*#__PURE__*/React.createElement("p", {
@@ -10984,13 +10996,19 @@ var jstGoods = function jstGoods(props) {
10984
10996
  _useState2 = _slicedToArray(_useState, 2),
10985
10997
  changeIndex = _useState2[0],
10986
10998
  setChangeIndex = _useState2[1]; //选中的包裹
10987
- var wdtSendOptions = WdtSendData.getInstance().wdtSendData || [];
10999
+ var sendOptions = SendDataCenter.getInstance(platformType).getSendData();
11000
+ var isSelectName = ['wdt', 'bsE3', 'km'].includes(platformType);
10988
11001
  useEffect(function () {
10989
11002
  //没有值塞个默认值
10990
11003
  if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
10991
11004
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10992
11005
  }
10993
11006
  }, [value, type]);
11007
+ useEffect(function () {
11008
+ if (changeIndex > (value === null || value === void 0 ? void 0 : value.length) - 1) {
11009
+ setChangeIndex(0);
11010
+ }
11011
+ }, value);
10994
11012
  var content = function content(item, index) {
10995
11013
  return /*#__PURE__*/React.createElement("div", {
10996
11014
  style: {
@@ -11001,7 +11019,7 @@ var jstGoods = function jstGoods(props) {
11001
11019
  style: {
11002
11020
  textAlign: 'center'
11003
11021
  }
11004
- }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
11022
+ }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F"), item.sid && /*#__PURE__*/React.createElement("span", null, "(\u7CFB\u7EDF\u5355\u53F7:", item.sid, ")")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
11005
11023
  return /*#__PURE__*/React.createElement("div", {
11006
11024
  key: index
11007
11025
  }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Image, {
@@ -11015,7 +11033,7 @@ var jstGoods = function jstGoods(props) {
11015
11033
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11016
11034
  changeOrderInfo[type] = val;
11017
11035
  changeOrderInfo['sendId'] = option.value;
11018
- if (platformType === 'wdt' && type === 'sendName') {
11036
+ if (isSelectName && type === 'sendName') {
11019
11037
  changeOrderInfo['sendSnapshotName'] = option.label;
11020
11038
  }
11021
11039
  var newList = _toConsumableArray(value);
@@ -11098,7 +11116,7 @@ var jstGoods = function jstGoods(props) {
11098
11116
  return changeInputHandle(e.target.value, 'sendId');
11099
11117
  },
11100
11118
  value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
11101
- }), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React.createElement(Select, {
11119
+ }), ['sendName', 'all'].includes(showField) && (isSelectName ? /*#__PURE__*/React.createElement(Select, {
11102
11120
  style: {
11103
11121
  minWidth: '100px',
11104
11122
  maxWidth: '180px'
@@ -11106,7 +11124,7 @@ var jstGoods = function jstGoods(props) {
11106
11124
  disabled: disabled,
11107
11125
  placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
11108
11126
  showSearch: true,
11109
- options: wdtSendOptions,
11127
+ options: sendOptions,
11110
11128
  filterOption: filterOption,
11111
11129
  value: ((_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName) || null,
11112
11130
  onChange: function onChange(value, option) {
@@ -11685,9 +11703,11 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
11685
11703
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11686
11704
 
11687
11705
  var getTableData = function getTableData(_ref, formData) {
11706
+ var _formData$brandIds;
11688
11707
  var current = _ref.current,
11689
11708
  pageSize = _ref.pageSize;
11690
11709
  var data = {
11710
+ brandIds: ((_formData$brandIds = formData.brandIds) === null || _formData$brandIds === void 0 ? void 0 : _formData$brandIds.length) ? formData.brandIds : null,
11691
11711
  skuCode: formData.skuCode || null,
11692
11712
  skuName: formData.skuName || null,
11693
11713
  goodName: formData.goodName || null,
@@ -11772,6 +11792,11 @@ var columns$1 = [{
11772
11792
  title: '商品ID',
11773
11793
  width: 200,
11774
11794
  ellipsis: true
11795
+ }, {
11796
+ dataIndex: 'brandName',
11797
+ title: '品牌名称',
11798
+ width: 200,
11799
+ ellipsis: true
11775
11800
  }, {
11776
11801
  dataIndex: 'marketPrice',
11777
11802
  title: '市场价',
@@ -11803,6 +11828,10 @@ var GoodList = function GoodList(props, ref) {
11803
11828
  _useState4 = _slicedToArray(_useState3, 2),
11804
11829
  selectIds = _useState4[0],
11805
11830
  setSelectIds = _useState4[1];
11831
+ var _useState5 = useState([]),
11832
+ _useState6 = _slicedToArray(_useState5, 2),
11833
+ brandList = _useState6[0],
11834
+ setBrandList = _useState6[1];
11806
11835
  useImperativeHandle(ref, function () {
11807
11836
  return {
11808
11837
  getSelectGoodList: function getSelectGoodList() {
@@ -11822,6 +11851,38 @@ var GoodList = function GoodList(props, ref) {
11822
11851
  params = _useAntdTable.params;
11823
11852
  var submit = search.submit,
11824
11853
  reset = search.reset;
11854
+ var setGoodBrandList = function setGoodBrandList() {
11855
+ var list = [];
11856
+ var pageNo = 0;
11857
+ var pageSize = 100;
11858
+ var getMore = function getMore() {
11859
+ extendRequest('/qy/gdfw/wdt/erp/goodBrand/list', {
11860
+ method: 'post',
11861
+ data: {
11862
+ pageSize: pageSize,
11863
+ pageNo: pageNo
11864
+ }
11865
+ }).then(function (res) {
11866
+ var _res$data2;
11867
+ if (res.success && (res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.detailList)) {
11868
+ var _res$data3, _res$data4;
11869
+ list.push.apply(list, _toConsumableArray((res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.detailList) || []));
11870
+ if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.detailList.length) === pageSize) {
11871
+ pageNo += 1;
11872
+ getMore();
11873
+ } else {
11874
+ setBrandList(list);
11875
+ }
11876
+ } else {
11877
+ reject(res);
11878
+ }
11879
+ }).catch(console.error);
11880
+ };
11881
+ getMore();
11882
+ };
11883
+ React.useEffect(function () {
11884
+ setGoodBrandList();
11885
+ }, []);
11825
11886
  var advanceSearchForm = /*#__PURE__*/React.createElement(Form, {
11826
11887
  layout: "inline",
11827
11888
  form: form
@@ -11869,6 +11930,32 @@ var GoodList = function GoodList(props, ref) {
11869
11930
  style: {
11870
11931
  width: 150
11871
11932
  }
11933
+ })), /*#__PURE__*/React.createElement(Form.Item, {
11934
+ name: "brandIds",
11935
+ style: {
11936
+ marginBottom: '12px'
11937
+ }
11938
+ }, /*#__PURE__*/React.createElement(Select, {
11939
+ mode: "multiple",
11940
+ showSearch: true,
11941
+ allowClear: true,
11942
+ filterOption: function filterOption(input, option) {
11943
+ return option.label.includes(input);
11944
+ },
11945
+ style: {
11946
+ width: 150
11947
+ },
11948
+ placeholder: "\u54C1\u724C",
11949
+ options: brandList.filter(function (item) {
11950
+ return !item.isDisabled;
11951
+ }).map(function (_ref2) {
11952
+ var value = _ref2.brandId,
11953
+ label = _ref2.brandName;
11954
+ return {
11955
+ value: value,
11956
+ label: label
11957
+ };
11958
+ })
11872
11959
  })), /*#__PURE__*/React.createElement(Form.Item, {
11873
11960
  style: {
11874
11961
  marginBottom: '12px'
@@ -12025,542 +12112,1667 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
12025
12112
  };
12026
12113
  var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
12027
12114
 
12028
- // interface GoodsItem {
12029
- // title: string;
12030
- // pic: string;
12031
- // platform: string;
12032
- // skuId: string;
12033
- // styleId: string;
12034
- // }
12035
- var GoodItem$1 = function GoodItem(props) {
12036
- var _props$value = props.value,
12037
- value = _props$value === void 0 ? [] : _props$value,
12038
- type = props.type,
12039
- onChange = props.onChange,
12040
- disabled = props.disabled,
12041
- _props$showHeader = props.showHeader,
12042
- showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
12043
- width = props.width,
12044
- _props$shopList = props.shopList,
12045
- shopList = _props$shopList === void 0 ? [] : _props$shopList,
12046
- _props$shopId = props.shopId,
12047
- shopId = _props$shopId === void 0 ? '' : _props$shopId,
12048
- _props$maxLength = props.maxLength,
12049
- maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
12050
- _props$showChangeBtn = props.showChangeBtn,
12051
- showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
12052
- _props$tableSelect = props.tableSelect,
12053
- tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
12054
- _props$selectType = props.selectType,
12055
- selectType = _props$selectType === void 0 ? '' : _props$selectType,
12056
- _props$otherOperation = props.otherOperations,
12057
- otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
12058
- _props$canUpdateNumbe = props.canUpdateNumber,
12059
- canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
12060
- shopCode = props.shopCode,
12061
- _props$companyKey = props.companyKey,
12062
- companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
12063
- onSelect = props.onSelect,
12064
- onDelete = props.onDelete;
12065
- var refModal = useRef();
12066
- var handleDelete = function handleDelete(record, index) {
12067
- onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
12068
- var newList = _toConsumableArray(value).filter(function (item, i) {
12069
- return index !== i;
12070
- });
12071
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
12115
+ var getTableData$1 = function getTableData(_ref, formData) {
12116
+ var current = _ref.current,
12117
+ pageSize = _ref.pageSize;
12118
+ var data = {
12119
+ goodNo: formData.goodNo || null,
12120
+ goodName: formData.goodName || null,
12121
+ skuCode: formData.skuCode || null,
12122
+ skuId: formData.skuId || null
12072
12123
  };
12124
+ return extendRequest('/qy/gdfw/product/product/page', {
12125
+ method: 'post',
12126
+ data: _objectSpread2({
12127
+ pageSize: pageSize,
12128
+ pageNo: current,
12129
+ platform: 'BS_E3_ERP'
12130
+ }, data)
12131
+ }).then(function (res) {
12132
+ var _res$data = res.data,
12133
+ _res$data$productSkuL = _res$data.productSkuList,
12134
+ productSkuList = _res$data$productSkuL === void 0 ? [] : _res$data$productSkuL,
12135
+ _res$data$total = _res$data.total,
12136
+ total = _res$data$total === void 0 ? 0 : _res$data$total;
12137
+ var newProducts = productSkuList.map(function (item, index) {
12138
+ return _objectSpread2(_objectSpread2({}, item), {}, {
12139
+ index: index + 1
12140
+ });
12141
+ });
12142
+ return {
12143
+ total: total,
12144
+ list: newProducts
12145
+ };
12146
+ });
12147
+ };
12148
+ var columns$2 = [{
12149
+ dataIndex: 'index',
12150
+ title: 'NO',
12151
+ render: function render(val, record, index) {
12152
+ return /*#__PURE__*/React.createElement("div", {
12153
+ style: {
12154
+ width: 25
12155
+ }
12156
+ }, index + 1);
12157
+ },
12158
+ width: 80
12159
+ }, {
12160
+ dataIndex: 'specNo',
12161
+ title: "SKU",
12162
+ ellipsis: true,
12163
+ width: 200
12164
+ }, {
12165
+ dataIndex: 'specId',
12166
+ title: "SKU ID",
12167
+ ellipsis: true,
12168
+ width: 80
12169
+ }, {
12170
+ dataIndex: 'goodName',
12171
+ title: "\u5546\u54C1\u540D\u79F0",
12172
+ ellipsis: true,
12173
+ width: 250
12174
+ }, {
12175
+ dataIndex: 'goodShortName',
12176
+ title: "\u5546\u54C1\u7B80\u79F0",
12177
+ ellipsis: true,
12178
+ width: 250
12179
+ },
12180
+ // {
12181
+ // dataIndex: 'goodPicUrl',
12182
+ // title: `商品图片`,
12183
+ // ellipsis: true,
12184
+ // width: 100,
12185
+ // render: (picUrl: string) => {
12186
+ // return (
12187
+ // <img
12188
+ // style={{
12189
+ // width: '40px',
12190
+ // height: '40px',
12191
+ // objectFit: 'contain',
12192
+ // }}
12193
+ // src={picUrl}
12194
+ // ></img>
12195
+ // );
12196
+ // },
12197
+ // },
12198
+ {
12199
+ dataIndex: 'goodNo',
12200
+ title: "\u8D27\u53F7",
12201
+ ellipsis: true,
12202
+ width: 150
12203
+ }, {
12204
+ dataIndex: 'goodId',
12205
+ title: "\u8D27\u53F7ID",
12206
+ ellipsis: true,
12207
+ width: 100
12208
+ }, {
12209
+ dataIndex: 'colorName',
12210
+ title: "\u989C\u8272\u540D\u79F0",
12211
+ ellipsis: true,
12212
+ width: 100
12213
+ }, {
12214
+ dataIndex: 'colorCode',
12215
+ title: "\u989C\u8272\u4EE3\u7801",
12216
+ ellipsis: true,
12217
+ width: 100
12218
+ }, {
12219
+ dataIndex: 'sizeName',
12220
+ title: "\u5C3A\u7801\u540D\u79F0",
12221
+ ellipsis: true,
12222
+ width: 100
12223
+ }, {
12224
+ dataIndex: 'sizeCode',
12225
+ title: "\u5C3A\u7801\u4EE3\u7801",
12226
+ ellipsis: true,
12227
+ width: 100
12228
+ }, {
12229
+ dataIndex: 'brandName',
12230
+ title: "\u54C1\u724C\u540D\u79F0",
12231
+ ellipsis: true,
12232
+ width: 100
12233
+ }, {
12234
+ dataIndex: 'marketPrice',
12235
+ title: "\u5E02\u573A\u4EF7",
12236
+ ellipsis: true,
12237
+ width: 100
12238
+ }, {
12239
+ dataIndex: 'retailPrice',
12240
+ title: "\u552E\u4EF7",
12241
+ ellipsis: true,
12242
+ width: 100
12243
+ }];
12244
+ var GoodList$1 = function GoodList(props, ref) {
12073
12245
  var _useState = useState([]),
12074
12246
  _useState2 = _slicedToArray(_useState, 2),
12075
- selectedRowKeys = _useState2[0],
12076
- setSelectedRowKeys = _useState2[1];
12077
- useEffect(function () {
12078
- setSelectedRowKeys([]);
12079
- }, [tableSelect, selectType]);
12080
- var updateHandle = function updateHandle(val, index, columnType) {
12081
- if (value === null || value === void 0 ? void 0 : value.length) {
12082
- value[index][columnType] = val;
12083
- if (type === 'WDT_RETURN_GOODS') {
12084
- if (['sharePrice', 'num'].includes(columnType)) {
12085
- var totalMoney = null;
12086
- if (columnType === 'num') {
12087
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
12088
- } else {
12089
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
12090
- }
12091
- if (totalMoney !== null) {
12092
- value[index]['returnPrice'] = totalMoney.toString();
12093
- }
12094
- }
12095
- } else if (type === 'WDT_EXCHANGE_GOODS') {
12096
- if (['price', 'num'].includes(columnType)) {
12097
- var _totalMoney = null;
12098
- if (columnType === 'num') {
12099
- _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
12100
- } else {
12101
- _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
12102
- }
12103
- if (_totalMoney !== null) {
12104
- value[index]['exchangePrice'] = _totalMoney.toString();
12105
- }
12106
- }
12247
+ selectList = _useState2[0],
12248
+ setSelect = _useState2[1];
12249
+ var _useState3 = useState([]),
12250
+ _useState4 = _slicedToArray(_useState3, 2),
12251
+ selectIds = _useState4[0],
12252
+ setSelectIds = _useState4[1];
12253
+ useImperativeHandle(ref, function () {
12254
+ return {
12255
+ getSelectGoodList: function getSelectGoodList() {
12256
+ return selectList;
12107
12257
  }
12108
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
12109
- }
12110
- };
12111
- var COLUMNS_MAP = function COLUMNS_MAP() {
12112
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12113
- return function (type) {
12114
- var columns = [];
12115
- switch (type) {
12116
- case 'WDT_REISSUE_GOODS':
12117
- case 'WDT_GOODS':
12118
- columns = [{
12119
- dataIndex: 'goodId',
12120
- title: "\u5546\u54C1ID",
12121
- align: 'center',
12122
- ellipsis: true,
12123
- width: 70
12124
- }, {
12125
- dataIndex: 'goodNo',
12126
- title: "\u5546\u54C1\u7F16\u7801",
12127
- align: 'center',
12128
- ellipsis: true,
12129
- width: 180
12130
- }, {
12131
- dataIndex: 'goodName',
12132
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12133
- align: 'center',
12134
- ellipsis: true,
12135
- width: 250
12136
- }, {
12137
- dataIndex: 'specId',
12138
- title: "".concat(text, "SKUID"),
12139
- align: 'center',
12140
- ellipsis: true,
12141
- width: 100
12142
- }, {
12143
- dataIndex: 'specNo',
12144
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12145
- align: 'center',
12146
- ellipsis: true,
12147
- width: 180
12148
- }, {
12149
- dataIndex: 'specName',
12150
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12151
- align: 'center',
12152
- ellipsis: true,
12153
- width: 250
12258
+ };
12259
+ });
12260
+ var _Form$useForm = Form.useForm(),
12261
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
12262
+ form = _Form$useForm2[0];
12263
+ var _useAntdTable = useAntdTable(getTableData$1, {
12264
+ defaultPageSize: 10,
12265
+ form: form
12266
+ }),
12267
+ tableProps = _useAntdTable.tableProps,
12268
+ search = _useAntdTable.search,
12269
+ params = _useAntdTable.params;
12270
+ var submit = search.submit,
12271
+ reset = search.reset;
12272
+ var advanceSearchForm = /*#__PURE__*/React.createElement(Form, {
12273
+ layout: "inline",
12274
+ form: form
12275
+ }, /*#__PURE__*/React.createElement(Form.Item, {
12276
+ name: "goodNo",
12277
+ style: {
12278
+ marginBottom: '12px'
12279
+ }
12280
+ }, /*#__PURE__*/React.createElement(Input, {
12281
+ placeholder: "\u5546\u54C1\u8D27\u53F7",
12282
+ allowClear: true,
12283
+ style: {
12284
+ width: 150
12285
+ }
12286
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12287
+ name: "goodName",
12288
+ style: {
12289
+ marginBottom: '12px'
12290
+ }
12291
+ }, /*#__PURE__*/React.createElement(Input, {
12292
+ placeholder: "\u5546\u54C1\u540D\u79F0",
12293
+ allowClear: true,
12294
+ style: {
12295
+ width: 150
12296
+ }
12297
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12298
+ name: "skuCode",
12299
+ style: {
12300
+ marginBottom: '12px'
12301
+ }
12302
+ }, /*#__PURE__*/React.createElement(Input, {
12303
+ placeholder: "SKU",
12304
+ allowClear: true,
12305
+ style: {
12306
+ width: 150
12307
+ }
12308
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12309
+ name: "skuId",
12310
+ style: {
12311
+ marginBottom: '12px'
12312
+ }
12313
+ }, /*#__PURE__*/React.createElement(Input, {
12314
+ placeholder: "SKU ID",
12315
+ allowClear: true,
12316
+ style: {
12317
+ width: 150
12318
+ }
12319
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12320
+ style: {
12321
+ marginBottom: '12px'
12322
+ }
12323
+ }, /*#__PURE__*/React.createElement(Button, {
12324
+ type: "primary",
12325
+ style: {
12326
+ marginRight: '8px'
12327
+ },
12328
+ onClick: submit
12329
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
12330
+ onClick: reset
12331
+ }, "\u91CD\u7F6E")));
12332
+ var rowSelection = {
12333
+ selectedRowKeys: selectIds,
12334
+ fixed: true,
12335
+ onSelect: function onSelect(record, selected) {
12336
+ if (selected) {
12337
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.specNo]));
12338
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
12339
+ } else {
12340
+ setSelectIds(selectIds.filter(function (t) {
12341
+ return t !== record.specNo;
12342
+ }));
12343
+ setSelect(selectList.filter(function (t) {
12344
+ return t.specNo !== record.specNo;
12345
+ }));
12346
+ }
12347
+ },
12348
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
12349
+ if (selected) {
12350
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
12351
+ return t.specNo;
12352
+ }))));
12353
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
12354
+ } else {
12355
+ setSelectIds(difference(selectIds, changeRows.map(function (t) {
12356
+ return t.specNo;
12357
+ })));
12358
+ var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
12359
+ return arrVal.specNo !== othVal.specNo;
12360
+ });
12361
+ setSelect(list);
12362
+ }
12363
+ }
12364
+ };
12365
+ var showTable = function showTable() {
12366
+ var handleDelete = function handleDelete(record) {
12367
+ setSelectIds(selectIds.filter(function (t) {
12368
+ return t !== record.specNo;
12369
+ }));
12370
+ setSelect(selectList.filter(function (t) {
12371
+ return t.specNo !== record.specNo;
12372
+ }));
12373
+ };
12374
+ var showColumns = [{
12375
+ dataIndex: '',
12376
+ title: "\u64CD\u4F5C",
12377
+ ellipsis: true,
12378
+ width: 100,
12379
+ render: function render(val, record) {
12380
+ return /*#__PURE__*/React.createElement(Button, {
12381
+ type: "link",
12382
+ onClick: function onClick() {
12383
+ return handleDelete(record);
12384
+ }
12385
+ }, "\u5220\u9664");
12386
+ }
12387
+ }].concat(takeRight(columns$2, columns$2.length - 1));
12388
+ return selectList.length ? /*#__PURE__*/React.createElement("div", {
12389
+ style: {
12390
+ width: '100%',
12391
+ maxWidth: '387px'
12392
+ }
12393
+ }, /*#__PURE__*/React.createElement(Table, {
12394
+ columns: showColumns,
12395
+ rowKey: 'specNo',
12396
+ dataSource: selectList,
12397
+ scroll: {
12398
+ x: '100%',
12399
+ y: 250
12400
+ },
12401
+ pagination: {
12402
+ size: 'small',
12403
+ total: selectIds.length,
12404
+ pageSize: 10,
12405
+ showSizeChanger: false
12406
+ }
12407
+ })) : null;
12408
+ };
12409
+ return /*#__PURE__*/React.createElement(React.Fragment, null, advanceSearchForm, /*#__PURE__*/React.createElement("div", {
12410
+ style: {
12411
+ marginTop: '4px'
12412
+ }
12413
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
12414
+ rowSelection: rowSelection,
12415
+ rowKey: "specNo",
12416
+ columns: columns$2,
12417
+ scroll: {
12418
+ x: '100%',
12419
+ y: 250
12420
+ }
12421
+ }, tableProps))), /*#__PURE__*/React.createElement(Popover, {
12422
+ getPopupContainer: function getPopupContainer(triggerNode) {
12423
+ return triggerNode.parentElement;
12424
+ },
12425
+ content: showTable(),
12426
+ title: "\u5DF2\u9009\u62E9".concat(selectList.length, "\u4E2A\u5546\u54C1")
12427
+ }, /*#__PURE__*/React.createElement(Button, {
12428
+ danger: true,
12429
+ type: "text"
12430
+ }, "\u5DF2\u9009".concat(selectList.length > 99 ? '99+' : selectList.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React.createElement(CaretUpOutlined, null))));
12431
+ };
12432
+ var BsE3GoodList = /*#__PURE__*/forwardRef(GoodList$1);
12433
+
12434
+ var GoodsModal$4 = function GoodsModal(props, ref) {
12435
+ useImperativeHandle(ref, function () {
12436
+ return {
12437
+ open: function open() {
12438
+ setVisible(true);
12439
+ }
12440
+ };
12441
+ });
12442
+ var onSubmit = props.onSubmit,
12443
+ width = props.width;
12444
+ var _useState = useState(false),
12445
+ _useState2 = _slicedToArray(_useState, 2),
12446
+ visible = _useState2[0],
12447
+ setVisible = _useState2[1];
12448
+ var bsE3GoodListRef = useRef(null);
12449
+ var _onCancel = function onCancel() {
12450
+ setVisible(false);
12451
+ };
12452
+ var onOk = function onOk() {
12453
+ var _bsE3GoodListRef$curr;
12454
+ var selectedList = ((_bsE3GoodListRef$curr = bsE3GoodListRef.current) === null || _bsE3GoodListRef$curr === void 0 ? void 0 : _bsE3GoodListRef$curr.getSelectGoodList()) || [];
12455
+ onSubmit(selectedList);
12456
+ _onCancel();
12457
+ };
12458
+ return /*#__PURE__*/React.createElement(React.Fragment, null, visible && /*#__PURE__*/React.createElement(Modal, {
12459
+ title: '选择商品',
12460
+ okText: '确认',
12461
+ cancelText: '取消',
12462
+ visible: visible,
12463
+ width: width || 850,
12464
+ onCancel: function onCancel() {
12465
+ _onCancel();
12466
+ },
12467
+ onOk: onOk,
12468
+ wrapClassName: "goodModal"
12469
+ }, /*#__PURE__*/React.createElement(BsE3GoodList, {
12470
+ ref: bsE3GoodListRef
12471
+ })));
12472
+ };
12473
+ var BsE3GoodsModal = /*#__PURE__*/forwardRef(GoodsModal$4);
12474
+
12475
+ var getColumns = function getColumns(_ref) {
12476
+ var _ref$text = _ref.text,
12477
+ text = _ref$text === void 0 ? '' : _ref$text,
12478
+ disabled = _ref.disabled,
12479
+ updateHandle = _ref.updateHandle;
12480
+ return {
12481
+ //百胜E3补发商品
12482
+ BS_E3_REISSUE_GOODS: [{
12483
+ dataIndex: 'sku',
12484
+ title: "SKU",
12485
+ width: 150
12486
+ }, {
12487
+ dataIndex: 'skuId',
12488
+ title: "SKU ID",
12489
+ width: 150
12490
+ }, {
12491
+ dataIndex: 'goodsName',
12492
+ title: "\u5546\u54C1\u540D\u79F0",
12493
+ width: 150
12494
+ }, {
12495
+ dataIndex: 'goodsShortName',
12496
+ title: "\u5546\u54C1\u7B80\u79F0",
12497
+ width: 150
12498
+ }, {
12499
+ dataIndex: 'picPath',
12500
+ title: "\u5546\u54C1\u56FE\u7247",
12501
+ width: 150
12502
+ }, {
12503
+ dataIndex: 'goodsSn',
12504
+ title: "\u8D27\u53F7",
12505
+ width: 150
12506
+ }, {
12507
+ dataIndex: 'goodsId',
12508
+ title: "\u8D27\u53F7ID",
12509
+ width: 150
12510
+ }, {
12511
+ dataIndex: 'colorName',
12512
+ title: "\u989C\u8272\u540D\u79F0",
12513
+ width: 150
12514
+ }, {
12515
+ dataIndex: 'colorCode',
12516
+ title: "\u989C\u8272\u4EE3\u7801",
12517
+ width: 150
12518
+ }, {
12519
+ dataIndex: 'sizeName',
12520
+ title: "\u5C3A\u7801\u540D\u79F0",
12521
+ width: 150
12522
+ }, {
12523
+ dataIndex: 'sizeCode',
12524
+ title: "\u5C3A\u7801\u4EE3\u7801",
12525
+ width: 150
12526
+ }, {
12527
+ dataIndex: 'brandName',
12528
+ title: "\u54C1\u724C\u540D\u79F0",
12529
+ width: 150
12530
+ }, {
12531
+ dataIndex: 'goodsNumber',
12532
+ title: "\u5546\u54C1\u6570\u91CF",
12533
+ width: 150
12534
+ }, {
12535
+ dataIndex: 'goodsPrice',
12536
+ title: "\u5546\u54C1\u5355\u4EF7",
12537
+ width: 150
12538
+ }, {
12539
+ dataIndex: 'shopPrice',
12540
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12541
+ width: 150
12542
+ }, {
12543
+ dataIndex: 'isGift',
12544
+ title: "\u662F\u5426\u8D60\u54C1",
12545
+ width: 150,
12546
+ render: function render(val) {
12547
+ return /*#__PURE__*/React.createElement("span", null, +val ? '是' : '否');
12548
+ }
12549
+ }],
12550
+ //百胜E3商品信息
12551
+ BS_E3_GOODS: [{
12552
+ dataIndex: 'sku',
12553
+ title: "SKU",
12554
+ align: 'center',
12555
+ ellipsis: true,
12556
+ width: 150
12557
+ }, {
12558
+ dataIndex: 'skuId',
12559
+ title: "SKU ID",
12560
+ align: 'center',
12561
+ ellipsis: true,
12562
+ width: 150
12563
+ }, {
12564
+ dataIndex: 'goodsName',
12565
+ title: "\u5546\u54C1\u540D\u79F0",
12566
+ align: 'center',
12567
+ ellipsis: true,
12568
+ width: 150
12569
+ }, {
12570
+ dataIndex: 'goodsShortName',
12571
+ title: "\u5546\u54C1\u7B80\u79F0",
12572
+ align: 'center',
12573
+ ellipsis: true,
12574
+ width: 100
12575
+ }, {
12576
+ dataIndex: 'picPath',
12577
+ title: "\u5546\u54C1\u56FE\u7247",
12578
+ align: 'center',
12579
+ ellipsis: true,
12580
+ width: 100,
12581
+ render: function render(val) {
12582
+ return /*#__PURE__*/React.createElement(Image, {
12583
+ width: 60,
12584
+ src: val
12585
+ });
12586
+ }
12587
+ }, {
12588
+ dataIndex: 'goodsSn',
12589
+ title: "\u8D27\u53F7",
12590
+ align: 'center',
12591
+ ellipsis: true,
12592
+ width: 150
12593
+ }, {
12594
+ dataIndex: 'goodsId',
12595
+ title: "\u8D27\u53F7ID",
12596
+ align: 'center',
12597
+ ellipsis: true,
12598
+ width: 150
12599
+ }, {
12600
+ dataIndex: 'colorName',
12601
+ title: "\u989C\u8272\u540D\u79F0",
12602
+ align: 'center',
12603
+ ellipsis: true,
12604
+ width: 100
12605
+ }, {
12606
+ dataIndex: 'colorCode',
12607
+ title: "\u989C\u8272\u4EE3\u7801",
12608
+ align: 'center',
12609
+ ellipsis: true,
12610
+ width: 150
12611
+ }, {
12612
+ dataIndex: 'sizeName',
12613
+ title: "\u5C3A\u7801\u540D\u79F0",
12614
+ align: 'center',
12615
+ ellipsis: true,
12616
+ width: 100
12617
+ }, {
12618
+ dataIndex: 'sizeCode',
12619
+ title: "\u5C3A\u7801\u4EE3\u7801",
12620
+ align: 'center',
12621
+ ellipsis: true,
12622
+ width: 100
12623
+ }, {
12624
+ dataIndex: 'brandName',
12625
+ title: "\u54C1\u724C\u540D\u79F0",
12626
+ align: 'center',
12627
+ ellipsis: true,
12628
+ width: 150
12629
+ }, {
12630
+ dataIndex: 'goodsNumber',
12631
+ title: "\u5546\u54C1\u6570\u91CF",
12632
+ align: 'center',
12633
+ ellipsis: true,
12634
+ width: 100,
12635
+ render: function render(val, record, index) {
12636
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12637
+ style: {
12638
+ width: 70
12639
+ },
12640
+ value: val,
12641
+ min: 1,
12642
+ precision: 0,
12643
+ onChange: function onChange(num) {
12644
+ return updateHandle(num, index, 'goodsNumber');
12645
+ }
12646
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12647
+ }
12648
+ }, {
12649
+ dataIndex: 'goodsPrice',
12650
+ title: "\u5546\u54C1\u5355\u4EF7",
12651
+ align: 'center',
12652
+ ellipsis: true,
12653
+ width: 120,
12654
+ render: function render(val, record, index) {
12655
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12656
+ style: {
12657
+ width: 70
12658
+ },
12659
+ value: val,
12660
+ min: 0,
12661
+ precision: 2,
12662
+ onChange: function onChange(num) {
12663
+ return updateHandle(num, index, 'goodsPrice');
12664
+ }
12665
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12666
+ }
12667
+ }, {
12668
+ dataIndex: 'shopPrice',
12669
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12670
+ align: 'center',
12671
+ ellipsis: true,
12672
+ width: 120
12673
+ }, {
12674
+ dataIndex: 'sharePrice',
12675
+ title: "\u5206\u644A\u4EF7",
12676
+ align: 'center',
12677
+ ellipsis: true,
12678
+ width: 120
12679
+ }, {
12680
+ dataIndex: 'sharePayment',
12681
+ title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
12682
+ align: 'center',
12683
+ ellipsis: true,
12684
+ width: 120
12685
+ }, {
12686
+ dataIndex: 'payment',
12687
+ title: "\u5B9E\u4ED8\u91D1\u989D",
12688
+ align: 'center',
12689
+ ellipsis: true,
12690
+ width: 120,
12691
+ render: function render(val, record, index) {
12692
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12693
+ style: {
12694
+ width: 70
12695
+ },
12696
+ value: val,
12697
+ min: 0,
12698
+ precision: 2,
12699
+ onChange: function onChange(num) {
12700
+ return updateHandle(num, index, 'payment');
12701
+ }
12702
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12703
+ }
12704
+ }, {
12705
+ dataIndex: 'tcSku',
12706
+ title: "\u5957\u9910SKU",
12707
+ align: 'center',
12708
+ ellipsis: true,
12709
+ width: 150
12710
+ }, {
12711
+ dataIndex: 'tcGoodsNumber',
12712
+ title: "\u5957\u9910\u5957\u6570",
12713
+ align: 'center',
12714
+ ellipsis: true,
12715
+ width: 100
12716
+ }, {
12717
+ dataIndex: 'taoCanSingleSl',
12718
+ title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
12719
+ align: 'center',
12720
+ ellipsis: true,
12721
+ width: 100
12722
+ }, {
12723
+ dataIndex: 'isGift',
12724
+ title: "\u662F\u5426\u8D60\u54C1",
12725
+ align: 'center',
12726
+ ellipsis: true,
12727
+ width: 100,
12728
+ render: function render(val) {
12729
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
12730
+ }
12731
+ }],
12732
+ BS_GOODS: [{
12733
+ dataIndex: 'mark',
12734
+ title: "\u5546\u54C1\u6807\u8BB0",
12735
+ align: 'center',
12736
+ ellipsis: true,
12737
+ width: 70,
12738
+ render: function render(val, record, index) {
12739
+ return /*#__PURE__*/React.createElement(Select, {
12740
+ options: [{
12741
+ label: '是',
12742
+ value: '是'
12154
12743
  }, {
12155
- dataIndex: 'orderPrice',
12156
- title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
12157
- align: 'center',
12158
- ellipsis: true,
12159
- width: 100
12744
+ label: '',
12745
+ value: '否'
12746
+ }],
12747
+ disabled: disabled,
12748
+ value: val,
12749
+ onChange: function onChange(val) {
12750
+ return updateHandle(val, index, 'mark');
12751
+ }
12752
+ });
12753
+ }
12754
+ }, {
12755
+ dataIndex: 'skuName',
12756
+ title: "".concat(text, "sku\u540D\u79F0"),
12757
+ align: 'center',
12758
+ ellipsis: true,
12759
+ width: 250
12760
+ }, {
12761
+ dataIndex: 'sku',
12762
+ title: "".concat(text, "sku\u7F16\u7801"),
12763
+ align: 'center',
12764
+ ellipsis: true,
12765
+ width: 100
12766
+ }, {
12767
+ dataIndex: 'name',
12768
+ title: "".concat(text, "\u540D\u79F0"),
12769
+ align: 'center',
12770
+ ellipsis: true,
12771
+ width: 250
12772
+ }, {
12773
+ dataIndex: 'pic',
12774
+ title: "\u56FE\u7247",
12775
+ align: 'center',
12776
+ ellipsis: true,
12777
+ width: 100,
12778
+ render: function render(val) {
12779
+ return /*#__PURE__*/React.createElement(Image, {
12780
+ width: 60,
12781
+ src: val
12782
+ });
12783
+ }
12784
+ }, {
12785
+ dataIndex: 'code',
12786
+ title: "".concat(text, "\u7F16\u7801"),
12787
+ align: 'center',
12788
+ ellipsis: true,
12789
+ width: 100
12790
+ }, {
12791
+ dataIndex: 'money',
12792
+ title: "\u5B9E\u4ED8\u91D1\u989D",
12793
+ align: 'center',
12794
+ ellipsis: true,
12795
+ width: 100
12796
+ }, {
12797
+ dataIndex: 'number',
12798
+ title: "".concat(text, "\u6570\u91CF"),
12799
+ align: 'center',
12800
+ ellipsis: true,
12801
+ width: 100,
12802
+ render: function render(val, record, index) {
12803
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12804
+ style: {
12805
+ width: 70
12806
+ },
12807
+ value: val,
12808
+ min: 1,
12809
+ precision: 0,
12810
+ onChange: function onChange(num) {
12811
+ return updateHandle(num, index, 'number');
12812
+ }
12813
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12814
+ }
12815
+ }, {
12816
+ dataIndex: 'share',
12817
+ title: "\u5206\u644A\u4EF7",
12818
+ align: 'center',
12819
+ ellipsis: true,
12820
+ width: 70
12821
+ }, {
12822
+ dataIndex: 'type',
12823
+ title: "\u8D60\u54C1\u7C7B\u578B",
12824
+ align: 'center',
12825
+ ellipsis: true,
12826
+ width: 100
12827
+ }, {
12828
+ dataIndex: 'batch',
12829
+ title: "\u6279\u6B21\u53F7",
12830
+ align: 'center',
12831
+ ellipsis: true,
12832
+ width: 100
12833
+ }, {
12834
+ dataIndex: 'expireDate',
12835
+ title: "\u6709\u6548\u671F",
12836
+ align: 'center',
12837
+ ellipsis: true,
12838
+ width: 100
12839
+ }]
12840
+ };
12841
+ };
12842
+
12843
+ var renderGiftType = function renderGiftType(val) {
12844
+ var giftTypeMap = {
12845
+ 0: '非赠品',
12846
+ 1: '自动赠送',
12847
+ 2: '手工赠送',
12848
+ 3: '回购自动送赠品',
12849
+ 4: '前N有礼送赠品',
12850
+ 6: '天猫优仓赠品',
12851
+ 7: '淘宝CRM会员送赠'
12852
+ };
12853
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12854
+ };
12855
+ var renderFieldMap = {
12856
+ num: function num(_ref) {
12857
+ var disabled = _ref.disabled,
12858
+ updateHandle = _ref.updateHandle;
12859
+ return function (val, record, index) {
12860
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12861
+ style: {
12862
+ width: 70
12863
+ },
12864
+ value: val,
12865
+ min: 1,
12866
+ precision: 0,
12867
+ onChange: function onChange(num) {
12868
+ return updateHandle(num, index, 'num');
12869
+ }
12870
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12871
+ };
12872
+ },
12873
+ giftType: function giftType() {
12874
+ return renderGiftType;
12875
+ }
12876
+ };
12877
+ var getWdtReissueGoodColumns = function getWdtReissueGoodColumns(_ref2) {
12878
+ var disabled = _ref2.disabled,
12879
+ updateHandle = _ref2.updateHandle,
12880
+ operate = _ref2.operate;
12881
+ return getColumnsMap()['WDT_REISSUE_GOODS'].map(function (item) {
12882
+ var newItem = _objectSpread2({
12883
+ align: 'center',
12884
+ ellipsis: true
12885
+ }, item);
12886
+ if (operate && (renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex])) {
12887
+ return _objectSpread2(_objectSpread2({}, newItem), {}, {
12888
+ render: renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex]({
12889
+ disabled: disabled,
12890
+ updateHandle: updateHandle
12891
+ })
12892
+ });
12893
+ }
12894
+ return newItem;
12895
+ });
12896
+ };
12897
+
12898
+ var getColumns$1 = function getColumns(_ref) {
12899
+ var _ref$text = _ref.text,
12900
+ text = _ref$text === void 0 ? '' : _ref$text,
12901
+ disabled = _ref.disabled,
12902
+ updateHandle = _ref.updateHandle;
12903
+ return {
12904
+ //旺店通补发商品信息
12905
+ WDT_REISSUE_GOODS: [{
12906
+ dataIndex: 'goodId',
12907
+ title: "\u5546\u54C1ID",
12908
+ width: 120
12909
+ }, {
12910
+ dataIndex: 'goodNo',
12911
+ title: "\u5546\u54C1\u7F16\u7801",
12912
+ width: 200
12913
+ }, {
12914
+ dataIndex: 'goodName',
12915
+ title: "\u5546\u54C1\u540D\u79F0",
12916
+ width: 200
12917
+ }, {
12918
+ dataIndex: 'specId',
12919
+ title: "SKUID",
12920
+ width: 150
12921
+ }, {
12922
+ dataIndex: 'specNo',
12923
+ title: "\u5546\u54C1SKU\u7F16\u7801",
12924
+ width: 200
12925
+ }, {
12926
+ dataIndex: 'specName',
12927
+ title: "\u5546\u54C1SKU\u540D\u79F0",
12928
+ width: 250
12929
+ }, {
12930
+ dataIndex: 'orderPrice',
12931
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
12932
+ width: 200
12933
+ }, {
12934
+ dataIndex: 'num',
12935
+ title: "\u6570\u91CF",
12936
+ width: 100
12937
+ }, {
12938
+ dataIndex: 'sharePrice',
12939
+ title: "\u5206\u644A\u4EF7",
12940
+ width: 150
12941
+ }, {
12942
+ dataIndex: 'giftType',
12943
+ title: "\u8D60\u54C1\u65B9\u5F0F",
12944
+ width: 100,
12945
+ render: renderGiftType
12946
+ }],
12947
+ //旺店通商品信息
12948
+ WDT_GOODS: [{
12949
+ dataIndex: 'goodId',
12950
+ title: "\u5546\u54C1ID",
12951
+ align: 'center',
12952
+ ellipsis: true,
12953
+ width: 70
12954
+ }, {
12955
+ dataIndex: 'goodNo',
12956
+ title: "\u5546\u54C1\u7F16\u7801",
12957
+ align: 'center',
12958
+ ellipsis: true,
12959
+ width: 180
12960
+ }, {
12961
+ dataIndex: 'goodName',
12962
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12963
+ align: 'center',
12964
+ ellipsis: true,
12965
+ width: 250
12966
+ }, {
12967
+ dataIndex: 'specId',
12968
+ title: "".concat(text, "SKUID"),
12969
+ align: 'center',
12970
+ ellipsis: true,
12971
+ width: 100
12972
+ }, {
12973
+ dataIndex: 'specNo',
12974
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12975
+ align: 'center',
12976
+ ellipsis: true,
12977
+ width: 180
12978
+ }, {
12979
+ dataIndex: 'specName',
12980
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12981
+ align: 'center',
12982
+ ellipsis: true,
12983
+ width: 250
12984
+ }, {
12985
+ dataIndex: 'orderPrice',
12986
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
12987
+ align: 'center',
12988
+ ellipsis: true,
12989
+ width: 100
12990
+ }, {
12991
+ dataIndex: 'num',
12992
+ title: "".concat(text, "\u6570\u91CF"),
12993
+ align: 'center',
12994
+ ellipsis: true,
12995
+ width: 100,
12996
+ render: function render(val, record, index) {
12997
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12998
+ style: {
12999
+ width: 70
13000
+ },
13001
+ value: val,
13002
+ min: 1,
13003
+ precision: 0,
13004
+ onChange: function onChange(num) {
13005
+ return updateHandle(num, index, 'num');
13006
+ }
13007
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13008
+ }
13009
+ }, {
13010
+ dataIndex: 'sharePrice',
13011
+ title: "\u5206\u644A\u4EF7",
13012
+ align: 'center',
13013
+ ellipsis: true,
13014
+ width: 70
13015
+ }, {
13016
+ dataIndex: 'giftType',
13017
+ title: "\u8D60\u54C1\u65B9\u5F0F",
13018
+ align: 'center',
13019
+ ellipsis: true,
13020
+ width: 100,
13021
+ render: function render(val) {
13022
+ var giftTypeMap = {
13023
+ 0: '非赠品',
13024
+ 1: '自动赠送',
13025
+ 2: '手工赠送',
13026
+ 3: '回购自动送赠品',
13027
+ 4: '前N有礼送赠品',
13028
+ 6: '天猫优仓赠品',
13029
+ 7: '淘宝CRM会员送赠'
13030
+ };
13031
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
13032
+ }
13033
+ }],
13034
+ //旺店通退货商品信息
13035
+ WDT_RETURN_GOODS: [{
13036
+ dataIndex: 'goodId',
13037
+ title: "\u5546\u54C1ID",
13038
+ align: 'center',
13039
+ ellipsis: true,
13040
+ width: 70
13041
+ }, {
13042
+ dataIndex: 'goodNo',
13043
+ title: "\u5546\u54C1\u7F16\u7801",
13044
+ align: 'center',
13045
+ ellipsis: true,
13046
+ width: 180
13047
+ }, {
13048
+ dataIndex: 'goodName',
13049
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13050
+ align: 'center',
13051
+ ellipsis: true,
13052
+ width: 250
13053
+ }, {
13054
+ dataIndex: 'specId',
13055
+ title: "".concat(text, "SKUID"),
13056
+ align: 'center',
13057
+ ellipsis: true,
13058
+ width: 100
13059
+ }, {
13060
+ dataIndex: 'specNo',
13061
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
13062
+ align: 'center',
13063
+ ellipsis: true,
13064
+ width: 180
13065
+ }, {
13066
+ dataIndex: 'specName',
13067
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13068
+ align: 'center',
13069
+ ellipsis: true,
13070
+ width: 250
13071
+ }, {
13072
+ dataIndex: 'num',
13073
+ title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
13074
+ align: 'center',
13075
+ ellipsis: true,
13076
+ width: 100,
13077
+ render: function render(val, record, index) {
13078
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13079
+ style: {
13080
+ width: 70
13081
+ },
13082
+ value: val,
13083
+ min: 1,
13084
+ precision: 0,
13085
+ onChange: function onChange(num) {
13086
+ return updateHandle(num, index, 'num');
13087
+ }
13088
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13089
+ }
13090
+ }, {
13091
+ dataIndex: 'sharePrice',
13092
+ title: "\u5206\u644A\u4EF7",
13093
+ align: 'center',
13094
+ ellipsis: true,
13095
+ width: 80,
13096
+ render: function render(val, record, index) {
13097
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13098
+ style: {
13099
+ width: 70
13100
+ },
13101
+ value: val,
13102
+ min: 0,
13103
+ onChange: function onChange(value) {
13104
+ return updateHandle(value, index, 'sharePrice');
13105
+ }
13106
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13107
+ }
13108
+ }, {
13109
+ dataIndex: 'returnPrice',
13110
+ title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
13111
+ align: 'center',
13112
+ ellipsis: true,
13113
+ width: 100
13114
+ }, {
13115
+ dataIndex: 'giftType',
13116
+ title: "\u8D60\u54C1\u65B9\u5F0F",
13117
+ align: 'center',
13118
+ ellipsis: true,
13119
+ width: 100,
13120
+ render: function render(val) {
13121
+ var giftTypeMap = {
13122
+ 0: '非赠品',
13123
+ 1: '自动赠送',
13124
+ 2: '手工赠送',
13125
+ 3: '回购自动送赠品',
13126
+ 4: '前N有礼送赠品',
13127
+ 6: '天猫优仓赠品',
13128
+ 7: '淘宝CRM会员送赠'
13129
+ };
13130
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
13131
+ }
13132
+ }, {
13133
+ dataIndex: 'type',
13134
+ title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
13135
+ align: 'center',
13136
+ ellipsis: true,
13137
+ width: 100,
13138
+ render: function render(val, record, index) {
13139
+ var options = [{
13140
+ label: '单品',
13141
+ value: '1'
13142
+ }, {
13143
+ label: '组合装',
13144
+ value: '2'
13145
+ }];
13146
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
13147
+ style: {
13148
+ width: 70
13149
+ },
13150
+ options: options,
13151
+ value: val,
13152
+ onChange: function onChange(value) {
13153
+ return updateHandle(value, index, 'type');
13154
+ }
13155
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13156
+ }
13157
+ }],
13158
+ //旺店通换出商品信息
13159
+ WDT_EXCHANGE_GOODS: [{
13160
+ dataIndex: 'goodId',
13161
+ title: "\u5546\u54C1ID",
13162
+ align: 'center',
13163
+ ellipsis: true,
13164
+ width: 70
13165
+ }, {
13166
+ dataIndex: 'goodNo',
13167
+ title: "\u5546\u54C1\u7F16\u7801",
13168
+ align: 'center',
13169
+ ellipsis: true,
13170
+ width: 180
13171
+ }, {
13172
+ dataIndex: 'goodName',
13173
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13174
+ align: 'center',
13175
+ ellipsis: true,
13176
+ width: 250
13177
+ }, {
13178
+ dataIndex: 'specId',
13179
+ title: "".concat(text, "SKUID"),
13180
+ align: 'center',
13181
+ ellipsis: true,
13182
+ width: 100
13183
+ }, {
13184
+ dataIndex: 'specNo',
13185
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
13186
+ align: 'center',
13187
+ ellipsis: true,
13188
+ width: 180
13189
+ }, {
13190
+ dataIndex: 'specName',
13191
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13192
+ align: 'center',
13193
+ ellipsis: true,
13194
+ width: 250
13195
+ }, {
13196
+ dataIndex: 'num',
13197
+ title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
13198
+ align: 'center',
13199
+ ellipsis: true,
13200
+ width: 100,
13201
+ render: function render(val, record, index) {
13202
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13203
+ style: {
13204
+ width: 70
13205
+ },
13206
+ value: val,
13207
+ min: 1,
13208
+ precision: 0,
13209
+ onChange: function onChange(num) {
13210
+ return updateHandle(num, index, 'num');
13211
+ }
13212
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13213
+ }
13214
+ }, {
13215
+ dataIndex: 'price',
13216
+ title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
13217
+ align: 'center',
13218
+ ellipsis: true,
13219
+ width: 100,
13220
+ render: function render(val, record, index) {
13221
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13222
+ style: {
13223
+ width: 70
13224
+ },
13225
+ value: val,
13226
+ min: 0,
13227
+ onChange: function onChange(value) {
13228
+ return updateHandle(value, index, 'price');
13229
+ }
13230
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13231
+ }
13232
+ }, {
13233
+ dataIndex: 'exchangePrice',
13234
+ title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
13235
+ align: 'center',
13236
+ ellipsis: true,
13237
+ width: 100
13238
+ }, {
13239
+ dataIndex: 'giftType',
13240
+ title: "\u8D60\u54C1\u65B9\u5F0F",
13241
+ align: 'center',
13242
+ ellipsis: true,
13243
+ width: 100,
13244
+ render: function render(val) {
13245
+ var giftTypeMap = {
13246
+ 0: '非赠品',
13247
+ 1: '自动赠送',
13248
+ 2: '手工赠送',
13249
+ 3: '回购自动送赠品',
13250
+ 4: '前N有礼送赠品',
13251
+ 6: '天猫优仓赠品',
13252
+ 7: '淘宝CRM会员送赠'
13253
+ };
13254
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
13255
+ }
13256
+ }, {
13257
+ dataIndex: 'type',
13258
+ title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
13259
+ align: 'center',
13260
+ ellipsis: true,
13261
+ width: 100,
13262
+ render: function render(val, record, index) {
13263
+ var options = [{
13264
+ label: '单品',
13265
+ value: '1'
13266
+ }, {
13267
+ label: '组合装',
13268
+ value: '2'
13269
+ }];
13270
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
13271
+ style: {
13272
+ width: 70
13273
+ },
13274
+ options: options,
13275
+ value: val,
13276
+ onChange: function onChange(value) {
13277
+ return updateHandle(value, index, 'type');
13278
+ }
13279
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13280
+ }
13281
+ }]
13282
+ };
13283
+ };
13284
+
13285
+ var getColumns$2 = function getColumns(_ref) {
13286
+ var _ref$text = _ref.text,
13287
+ text = _ref$text === void 0 ? '' : _ref$text,
13288
+ disabled = _ref.disabled,
13289
+ updateHandle = _ref.updateHandle;
13290
+ return {
13291
+ //万里牛商品信息
13292
+ WLN_GOODS: [{
13293
+ dataIndex: 'skuName',
13294
+ title: "".concat(text, "sku\u540D\u79F0"),
13295
+ align: 'center',
13296
+ ellipsis: true,
13297
+ width: 250
13298
+ }, {
13299
+ dataIndex: 'sku',
13300
+ title: "".concat(text, "sku\u7F16\u7801"),
13301
+ align: 'center',
13302
+ ellipsis: true,
13303
+ width: 100
13304
+ }, {
13305
+ dataIndex: 'name',
13306
+ title: "".concat(text, "\u540D\u79F0"),
13307
+ align: 'center',
13308
+ ellipsis: true,
13309
+ width: 250
13310
+ }, {
13311
+ dataIndex: 'pic',
13312
+ title: "\u56FE\u7247",
13313
+ align: 'center',
13314
+ ellipsis: true,
13315
+ width: 100,
13316
+ render: function render(val) {
13317
+ return /*#__PURE__*/React.createElement(Image, {
13318
+ width: 60,
13319
+ src: val
13320
+ });
13321
+ }
13322
+ }, {
13323
+ dataIndex: 'code',
13324
+ title: "".concat(text, "\u7F16\u7801"),
13325
+ align: 'center',
13326
+ ellipsis: true,
13327
+ width: 100
13328
+ }, {
13329
+ dataIndex: 'money',
13330
+ title: "\u5B9E\u4ED8\u91D1\u989D",
13331
+ align: 'center',
13332
+ ellipsis: true,
13333
+ width: 100
13334
+ }, {
13335
+ dataIndex: 'number',
13336
+ title: "".concat(text, "\u6570\u91CF"),
13337
+ align: 'center',
13338
+ ellipsis: true,
13339
+ width: 100,
13340
+ render: function render(val, record, index) {
13341
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13342
+ style: {
13343
+ width: 70
13344
+ },
13345
+ value: val,
13346
+ min: 1,
13347
+ precision: 0,
13348
+ onChange: function onChange(num) {
13349
+ return updateHandle(num, index, 'number');
13350
+ }
13351
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13352
+ }
13353
+ }, {
13354
+ dataIndex: 'share',
13355
+ title: "\u5206\u644A\u4EF7",
13356
+ align: 'center',
13357
+ ellipsis: true,
13358
+ width: 70
13359
+ }, {
13360
+ dataIndex: 'type',
13361
+ title: "\u8D60\u54C1\u7C7B\u578B",
13362
+ align: 'center',
13363
+ ellipsis: true,
13364
+ width: 100
13365
+ }]
13366
+ };
13367
+ };
13368
+
13369
+ var getColumnsMap = function getColumnsMap(args) {
13370
+ var _ref = args || {},
13371
+ _ref$text = _ref.text,
13372
+ text = _ref$text === void 0 ? '' : _ref$text,
13373
+ disabled = _ref.disabled,
13374
+ updateHandle = _ref.updateHandle;
13375
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getColumns({
13376
+ text: text,
13377
+ disabled: disabled,
13378
+ updateHandle: updateHandle
13379
+ })), getColumns$1({
13380
+ text: text,
13381
+ disabled: disabled,
13382
+ updateHandle: updateHandle
13383
+ })), getColumns$2({
13384
+ text: text,
13385
+ disabled: disabled,
13386
+ updateHandle: updateHandle
13387
+ })), {}, {
13388
+ default: [{
13389
+ dataIndex: 'mark',
13390
+ title: "\u5546\u54C1\u6807\u8BB0",
13391
+ align: 'center',
13392
+ ellipsis: true,
13393
+ width: 70,
13394
+ render: function render(val, record, index) {
13395
+ return /*#__PURE__*/React.createElement(Select, {
13396
+ options: [{
13397
+ label: '是',
13398
+ value: '是'
12160
13399
  }, {
12161
- dataIndex: 'num',
12162
- title: "".concat(text, "\u6570\u91CF"),
12163
- align: 'center',
12164
- ellipsis: true,
12165
- width: 100,
12166
- render: function render(val, record, index) {
12167
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12168
- style: {
12169
- width: 70
12170
- },
12171
- value: val,
12172
- min: 1,
12173
- precision: 0,
12174
- onChange: function onChange(num) {
12175
- return updateHandle(num, index, 'num');
12176
- }
12177
- }) : /*#__PURE__*/React.createElement("span", null, val);
12178
- }
13400
+ label: '',
13401
+ value: '否'
13402
+ }],
13403
+ disabled: disabled,
13404
+ value: val,
13405
+ onChange: function onChange(val) {
13406
+ return updateHandle(val, index, 'mark');
13407
+ }
13408
+ });
13409
+ }
13410
+ }, {
13411
+ dataIndex: 'skuName',
13412
+ title: "".concat(text, "sku\u540D\u79F0"),
13413
+ align: 'center',
13414
+ ellipsis: true,
13415
+ width: 250
13416
+ }, {
13417
+ dataIndex: 'sku',
13418
+ title: "".concat(text, "sku\u7F16\u7801"),
13419
+ align: 'center',
13420
+ ellipsis: true,
13421
+ width: 100
13422
+ }, {
13423
+ dataIndex: 'name',
13424
+ title: "".concat(text, "\u540D\u79F0"),
13425
+ align: 'center',
13426
+ ellipsis: true,
13427
+ width: 250
13428
+ }, {
13429
+ dataIndex: 'pic',
13430
+ title: "\u56FE\u7247",
13431
+ align: 'center',
13432
+ ellipsis: true,
13433
+ width: 100,
13434
+ render: function render(val) {
13435
+ return /*#__PURE__*/React.createElement(Image, {
13436
+ width: 60,
13437
+ src: val
13438
+ });
13439
+ }
13440
+ }, {
13441
+ dataIndex: 'code',
13442
+ title: "".concat(text, "\u7F16\u7801"),
13443
+ align: 'center',
13444
+ ellipsis: true,
13445
+ width: 100
13446
+ }, {
13447
+ dataIndex: 'money',
13448
+ title: "\u5B9E\u4ED8\u91D1\u989D",
13449
+ align: 'center',
13450
+ ellipsis: true,
13451
+ width: 100
13452
+ }, {
13453
+ dataIndex: 'number',
13454
+ title: "".concat(text, "\u6570\u91CF"),
13455
+ align: 'center',
13456
+ ellipsis: true,
13457
+ width: 100,
13458
+ render: function render(val, record, index) {
13459
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13460
+ style: {
13461
+ width: 70
12179
13462
  },
12180
- // {
12181
- // dataIndex: 'actualNum',
12182
- // title: `${text}实发数量`,
12183
- // align: 'center',
12184
- // ellipsis: true,
12185
- // width: 100,
12186
- // },
13463
+ value: val,
13464
+ min: 1,
13465
+ precision: 0,
13466
+ onChange: function onChange(num) {
13467
+ return updateHandle(num, index, 'number');
13468
+ }
13469
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13470
+ }
13471
+ }, {
13472
+ dataIndex: 'share',
13473
+ title: "\u5206\u644A\u4EF7",
13474
+ align: 'center',
13475
+ ellipsis: true,
13476
+ width: 70
13477
+ }, {
13478
+ dataIndex: 'type',
13479
+ title: "\u8D60\u54C1\u7C7B\u578B",
13480
+ align: 'center',
13481
+ ellipsis: true,
13482
+ width: 100
13483
+ }]
13484
+ });
13485
+ };
13486
+ var getColumnsBaseInfo = function getColumnsBaseInfo() {
13487
+ var clone_columnsMap = cloneDeep(getColumnsMap());
13488
+ var newColumns = {};
13489
+ Object.keys(clone_columnsMap).forEach(function (key) {
13490
+ newColumns[key] = clone_columnsMap[key].map(function (col) {
13491
+ return {
13492
+ title: col.title,
13493
+ dataIndex: col.dataIndex
13494
+ };
13495
+ });
13496
+ });
13497
+ return newColumns;
13498
+ };
13499
+ var columnsBaseInfoMap = getColumnsBaseInfo();
13500
+
13501
+ var renderFieldMap$1 = {
13502
+ goodsNumber: function goodsNumber(_ref) {
13503
+ var disabled = _ref.disabled,
13504
+ updateHandle = _ref.updateHandle;
13505
+ return function (val, record, index) {
13506
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13507
+ style: {
13508
+ width: 70
13509
+ },
13510
+ value: val,
13511
+ min: 1,
13512
+ precision: 0,
13513
+ onChange: function onChange(num) {
13514
+ return updateHandle(num, index, 'goodsNumber');
13515
+ }
13516
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13517
+ };
13518
+ },
13519
+ goodsPrice: function goodsPrice(_ref2) {
13520
+ var disabled = _ref2.disabled,
13521
+ updateHandle = _ref2.updateHandle;
13522
+ return function (val, record, index) {
13523
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13524
+ style: {
13525
+ width: 70
13526
+ },
13527
+ value: val,
13528
+ min: 0,
13529
+ onChange: function onChange(value) {
13530
+ return updateHandle(value, index, 'goodsPrice');
13531
+ }
13532
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13533
+ };
13534
+ },
13535
+ isGift: function isGift(_ref3) {
13536
+ var disabled = _ref3.disabled,
13537
+ updateHandle = _ref3.updateHandle;
13538
+ return function (val, record, index) {
13539
+ var options = [{
13540
+ label: '是',
13541
+ value: 1
13542
+ }, {
13543
+ label: '否',
13544
+ value: 0
13545
+ }];
13546
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
13547
+ style: {
13548
+ width: 70
13549
+ },
13550
+ options: options,
13551
+ value: val,
13552
+ onChange: function onChange(value) {
13553
+ return updateHandle(value, index, 'isGift');
13554
+ },
13555
+ getPopupContainer: function getPopupContainer() {
13556
+ return document.getElementById('bsE3ReissueGoods');
13557
+ }
13558
+ }) : /*#__PURE__*/React.createElement("span", null, +val ? '是' : '否');
13559
+ };
13560
+ }
13561
+ };
13562
+ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
13563
+ var disabled = _ref4.disabled,
13564
+ updateHandle = _ref4.updateHandle,
13565
+ operate = _ref4.operate;
13566
+ return getColumnsMap()['BS_E3_REISSUE_GOODS'].map(function (item) {
13567
+ var newItem = _objectSpread2({
13568
+ align: 'center',
13569
+ ellipsis: true
13570
+ }, item);
13571
+ if (operate && (renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex])) {
13572
+ return _objectSpread2(_objectSpread2({}, newItem), {}, {
13573
+ render: renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex]({
13574
+ disabled: disabled,
13575
+ updateHandle: updateHandle
13576
+ })
13577
+ });
13578
+ }
13579
+ return newItem;
13580
+ });
13581
+ };
13582
+
13583
+ var MAIN_FIELD = 'uuid';
13584
+ var SelectTradeGoods = function SelectTradeGoods(_ref) {
13585
+ var columns = _ref.columns,
13586
+ dataSource = _ref.dataSource,
13587
+ selectedRowKeys = _ref.selectedRowKeys,
13588
+ onChangeSelectedKeys = _ref.onChangeSelectedKeys;
13589
+ var _useState = useState(false),
13590
+ _useState2 = _slicedToArray(_useState, 2),
13591
+ tradeGoodsVisible = _useState2[0],
13592
+ setTradeGoodsVisible = _useState2[1];
13593
+ var openModal = function openModal() {
13594
+ return setTradeGoodsVisible(true);
13595
+ };
13596
+ var closeModal = function closeModal() {
13597
+ return setTradeGoodsVisible(false);
13598
+ };
13599
+ var currentTradeOriginGoods = intersection(dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
13600
+ return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
13601
+ }), selectedRowKeys);
13602
+ var unCurrentTradeOriginGoods = difference(selectedRowKeys, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
13603
+ return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
13604
+ }));
13605
+ var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
13606
+ console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
13607
+ onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
13608
+ };
13609
+ var rowSelection = {
13610
+ selectedRowKeys: selectedRowKeys,
13611
+ onChange: handleChangeSelectedKeys
13612
+ };
13613
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
13614
+ type: "link",
13615
+ onClick: openModal
13616
+ }, "\u9009\u62E9\u8BA2\u5355\u5546\u54C1"), /*#__PURE__*/React.createElement(Modal, {
13617
+ title: "\u8BA2\u5355\u5546\u54C1",
13618
+ visible: tradeGoodsVisible,
13619
+ footer: null,
13620
+ onCancel: closeModal
13621
+ }, /*#__PURE__*/React.createElement(Table, {
13622
+ rowKey: MAIN_FIELD,
13623
+ rowSelection: rowSelection,
13624
+ columns: columns,
13625
+ dataSource: dataSource,
13626
+ pagination: false,
13627
+ scroll: {
13628
+ x: 500,
13629
+ y: 500
13630
+ }
13631
+ }), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/", dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, ")")));
13632
+ };
13633
+ var getButtonText = function getButtonText() {
13634
+ var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13635
+ if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
13636
+ return '选择百胜ERP商品';
13637
+ }
13638
+ if (['WDT_REISSUE_GOODS'].includes(type)) {
13639
+ return '选择旺店通商品';
13640
+ }
13641
+ return '选择商品';
13642
+ };
13643
+ var GoodItem$1 = function GoodItem(props) {
13644
+ var _props$value = props.value,
13645
+ value = _props$value === void 0 ? [] : _props$value,
13646
+ type = props.type,
13647
+ onChange = props.onChange,
13648
+ disabled = props.disabled,
13649
+ _props$showHeader = props.showHeader,
13650
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
13651
+ width = props.width,
13652
+ _props$shopList = props.shopList,
13653
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
13654
+ _props$shopId = props.shopId,
13655
+ shopId = _props$shopId === void 0 ? '' : _props$shopId,
13656
+ _props$maxLength = props.maxLength,
13657
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
13658
+ _props$showChangeBtn = props.showChangeBtn,
13659
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
13660
+ _props$showModeBtn = props.showModeBtn,
13661
+ showModeBtn = _props$showModeBtn === void 0 ? false : _props$showModeBtn,
13662
+ _props$isStrict = props.isStrict,
13663
+ isStrict = _props$isStrict === void 0 ? false : _props$isStrict,
13664
+ _props$tableSelect = props.tableSelect,
13665
+ tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
13666
+ _props$selectType = props.selectType,
13667
+ selectType = _props$selectType === void 0 ? '' : _props$selectType,
13668
+ _props$otherOperation = props.otherOperations,
13669
+ otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
13670
+ _props$canUpdateNumbe = props.canUpdateNumber,
13671
+ canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
13672
+ shopCode = props.shopCode,
13673
+ _props$companyKey = props.companyKey,
13674
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
13675
+ onSelect = props.onSelect,
13676
+ onDelete = props.onDelete,
13677
+ onModeChange = props.onModeChange,
13678
+ tradeGoods = props.tradeGoods;
13679
+ var refModal = useRef();
13680
+ console.debug('表格数据', value);
13681
+ var handleDelete = function handleDelete(record, index) {
13682
+ onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
13683
+ var newList = _toConsumableArray(value).filter(function (item, i) {
13684
+ return index !== i;
13685
+ });
13686
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
13687
+ };
13688
+ var _useState3 = useState([]),
13689
+ _useState4 = _slicedToArray(_useState3, 2),
13690
+ selectedRowKeys = _useState4[0],
13691
+ setSelectedRowKeys = _useState4[1];
13692
+ useEffect(function () {
13693
+ setSelectedRowKeys([]);
13694
+ }, [tableSelect, selectType]);
13695
+ // TODO: 商品订单中以选中商品
13696
+ var selectedGoods = useMemo(function () {
13697
+ return value === null || value === void 0 ? void 0 : value.map(function (v) {
13698
+ return v === null || v === void 0 ? void 0 : v[MAIN_FIELD];
13699
+ });
13700
+ }, [value]);
13701
+ var updateHandle = function updateHandle(val, index, columnType) {
13702
+ if (value === null || value === void 0 ? void 0 : value.length) {
13703
+ value[index][columnType] = val;
13704
+ if (type === 'WDT_RETURN_GOODS') {
13705
+ if (['sharePrice', 'num'].includes(columnType)) {
13706
+ var totalMoney = null;
13707
+ if (columnType === 'num') {
13708
+ totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
13709
+ } else {
13710
+ totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
13711
+ }
13712
+ if (totalMoney !== null) {
13713
+ value[index]['returnPrice'] = totalMoney.toString();
13714
+ }
13715
+ }
13716
+ } else if (type === 'WDT_EXCHANGE_GOODS') {
13717
+ if (['price', 'num'].includes(columnType)) {
13718
+ var _totalMoney = null;
13719
+ if (columnType === 'num') {
13720
+ _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
13721
+ } else {
13722
+ _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
13723
+ }
13724
+ if (_totalMoney !== null) {
13725
+ value[index]['exchangePrice'] = _totalMoney.toString();
13726
+ }
13727
+ }
13728
+ }
13729
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
13730
+ }
13731
+ };
13732
+ var COLUMNS_MAP = function COLUMNS_MAP() {
13733
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13734
+ var operate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
13735
+ return function (type) {
13736
+ var columns = [];
13737
+ switch (type) {
13738
+ case 'WDT_GOODS':
13739
+ case 'WDT_RETURN_GOODS':
13740
+ case 'WDT_EXCHANGE_GOODS':
13741
+ case 'BS_E3_GOODS':
13742
+ case 'BS_GOODS':
13743
+ case 'WLN_GOODS':
12187
13744
  {
12188
- dataIndex: 'sharePrice',
12189
- title: "\u5206\u644A\u4EF7",
12190
- align: 'center',
12191
- ellipsis: true,
12192
- width: 70
12193
- }, {
12194
- dataIndex: 'giftType',
12195
- title: "\u8D60\u54C1\u65B9\u5F0F",
12196
- align: 'center',
12197
- ellipsis: true,
12198
- width: 100,
12199
- render: function render(val) {
12200
- var giftTypeMap = {
12201
- 0: '非赠品',
12202
- 1: '自动赠送',
12203
- 2: '手工赠送',
12204
- 3: '回购自动送赠品',
12205
- 4: '前N有礼送赠品',
12206
- 6: '天猫优仓赠品',
12207
- 7: '淘宝CRM会员送赠'
12208
- };
12209
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12210
- }
12211
- }];
13745
+ columns = getColumnsMap({
13746
+ text: text,
13747
+ disabled: disabled,
13748
+ updateHandle: updateHandle
13749
+ })[type];
13750
+ }
12212
13751
  break;
12213
- case 'WDT_RETURN_GOODS':
13752
+ case 'WDT_REISSUE_GOODS':
12214
13753
  {
12215
- columns = [{
12216
- dataIndex: 'goodId',
12217
- title: "\u5546\u54C1ID",
12218
- align: 'center',
12219
- ellipsis: true,
12220
- width: 70
12221
- }, {
12222
- dataIndex: 'goodNo',
12223
- title: "\u5546\u54C1\u7F16\u7801",
12224
- align: 'center',
12225
- ellipsis: true,
12226
- width: 180
12227
- }, {
12228
- dataIndex: 'goodName',
12229
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12230
- align: 'center',
12231
- ellipsis: true,
12232
- width: 250
12233
- }, {
12234
- dataIndex: 'specId',
12235
- title: "".concat(text, "SKUID"),
12236
- align: 'center',
12237
- ellipsis: true,
12238
- width: 100
12239
- }, {
12240
- dataIndex: 'specNo',
12241
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12242
- align: 'center',
12243
- ellipsis: true,
12244
- width: 180
12245
- }, {
12246
- dataIndex: 'specName',
12247
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12248
- align: 'center',
12249
- ellipsis: true,
12250
- width: 250
12251
- }, {
12252
- dataIndex: 'num',
12253
- title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
12254
- align: 'center',
12255
- ellipsis: true,
12256
- width: 100,
12257
- render: function render(val, record, index) {
12258
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12259
- style: {
12260
- width: 70
12261
- },
12262
- value: val,
12263
- min: 1,
12264
- precision: 0,
12265
- onChange: function onChange(num) {
12266
- return updateHandle(num, index, 'num');
12267
- }
12268
- }) : /*#__PURE__*/React.createElement("span", null, val);
12269
- }
12270
- }, {
12271
- dataIndex: 'sharePrice',
12272
- title: "\u5206\u644A\u4EF7",
12273
- align: 'center',
12274
- ellipsis: true,
12275
- width: 80,
12276
- render: function render(val, record, index) {
12277
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12278
- style: {
12279
- width: 70
12280
- },
12281
- value: val,
12282
- min: 0,
12283
- onChange: function onChange(value) {
12284
- return updateHandle(value, index, 'sharePrice');
12285
- }
12286
- }) : /*#__PURE__*/React.createElement("span", null, val);
12287
- }
12288
- }, {
12289
- dataIndex: 'returnPrice',
12290
- title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
12291
- align: 'center',
12292
- ellipsis: true,
12293
- width: 100
12294
- }, {
12295
- dataIndex: 'giftType',
12296
- title: "\u8D60\u54C1\u65B9\u5F0F",
12297
- align: 'center',
12298
- ellipsis: true,
12299
- width: 100,
12300
- render: function render(val) {
12301
- var giftTypeMap = {
12302
- 0: '非赠品',
12303
- 1: '自动赠送',
12304
- 2: '手工赠送',
12305
- 3: '回购自动送赠品',
12306
- 4: '前N有礼送赠品',
12307
- 6: '天猫优仓赠品',
12308
- 7: '淘宝CRM会员送赠'
12309
- };
12310
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12311
- }
12312
- }, {
12313
- dataIndex: 'type',
12314
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12315
- align: 'center',
12316
- ellipsis: true,
12317
- width: 100,
12318
- render: function render(val, record, index) {
12319
- var options = [{
12320
- label: '单品',
12321
- value: '1'
12322
- }, {
12323
- label: '组合装',
12324
- value: '2'
12325
- }];
12326
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
12327
- style: {
12328
- width: 70
12329
- },
12330
- options: options,
12331
- value: val,
12332
- onChange: function onChange(value) {
12333
- return updateHandle(value, index, 'type');
12334
- }
12335
- }) : /*#__PURE__*/React.createElement("span", null, val);
12336
- }
12337
- }];
13754
+ columns = getWdtReissueGoodColumns({
13755
+ disabled: disabled,
13756
+ updateHandle: updateHandle,
13757
+ operate: operate
13758
+ });
12338
13759
  }
12339
13760
  break;
12340
- case 'WDT_EXCHANGE_GOODS':
13761
+ case 'BS_E3_REISSUE_GOODS':
12341
13762
  {
12342
- columns = [{
12343
- dataIndex: 'goodId',
12344
- title: "\u5546\u54C1ID",
12345
- align: 'center',
12346
- ellipsis: true,
12347
- width: 70
12348
- }, {
12349
- dataIndex: 'goodNo',
12350
- title: "\u5546\u54C1\u7F16\u7801",
12351
- align: 'center',
12352
- ellipsis: true,
12353
- width: 180
12354
- }, {
12355
- dataIndex: 'goodName',
12356
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12357
- align: 'center',
12358
- ellipsis: true,
12359
- width: 250
12360
- }, {
12361
- dataIndex: 'specId',
12362
- title: "".concat(text, "SKUID"),
12363
- align: 'center',
12364
- ellipsis: true,
12365
- width: 100
12366
- }, {
12367
- dataIndex: 'specNo',
12368
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12369
- align: 'center',
12370
- ellipsis: true,
12371
- width: 180
12372
- }, {
12373
- dataIndex: 'specName',
12374
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12375
- align: 'center',
12376
- ellipsis: true,
12377
- width: 250
12378
- }, {
12379
- dataIndex: 'num',
12380
- title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
12381
- align: 'center',
12382
- ellipsis: true,
12383
- width: 100,
12384
- render: function render(val, record, index) {
12385
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12386
- style: {
12387
- width: 70
12388
- },
12389
- value: val,
12390
- min: 1,
12391
- precision: 0,
12392
- onChange: function onChange(num) {
12393
- return updateHandle(num, index, 'num');
12394
- }
12395
- }) : /*#__PURE__*/React.createElement("span", null, val);
12396
- }
12397
- }, {
12398
- dataIndex: 'price',
12399
- title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
12400
- align: 'center',
12401
- ellipsis: true,
12402
- width: 100,
12403
- render: function render(val, record, index) {
12404
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12405
- style: {
12406
- width: 70
12407
- },
12408
- value: val,
12409
- min: 0,
12410
- onChange: function onChange(value) {
12411
- return updateHandle(value, index, 'price');
12412
- }
12413
- }) : /*#__PURE__*/React.createElement("span", null, val);
12414
- }
12415
- }, {
12416
- dataIndex: 'exchangePrice',
12417
- title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
12418
- align: 'center',
12419
- ellipsis: true,
12420
- width: 100
12421
- }, {
12422
- dataIndex: 'giftType',
12423
- title: "\u8D60\u54C1\u65B9\u5F0F",
12424
- align: 'center',
12425
- ellipsis: true,
12426
- width: 100,
12427
- render: function render(val) {
12428
- var giftTypeMap = {
12429
- 0: '非赠品',
12430
- 1: '自动赠送',
12431
- 2: '手工赠送',
12432
- 3: '回购自动送赠品',
12433
- 4: '前N有礼送赠品',
12434
- 6: '天猫优仓赠品',
12435
- 7: '淘宝CRM会员送赠'
12436
- };
12437
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12438
- }
12439
- }, {
12440
- dataIndex: 'type',
12441
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12442
- align: 'center',
12443
- ellipsis: true,
12444
- width: 100,
12445
- render: function render(val, record, index) {
12446
- var options = [{
12447
- label: '单品',
12448
- value: '1'
12449
- }, {
12450
- label: '组合装',
12451
- value: '2'
12452
- }];
12453
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
12454
- style: {
12455
- width: 70
12456
- },
12457
- options: options,
12458
- value: val,
12459
- onChange: function onChange(value) {
12460
- return updateHandle(value, index, 'type');
12461
- }
12462
- }) : /*#__PURE__*/React.createElement("span", null, val);
12463
- }
12464
- }];
13763
+ columns = getBsE3ReissueGoodColumns({
13764
+ disabled: disabled,
13765
+ updateHandle: updateHandle,
13766
+ operate: operate
13767
+ });
12465
13768
  }
12466
13769
  break;
12467
13770
  default:
12468
- columns = [{
12469
- dataIndex: 'mark',
12470
- title: "\u5546\u54C1\u6807\u8BB0",
12471
- align: 'center',
12472
- ellipsis: true,
12473
- width: 70,
12474
- render: function render(val, record, index) {
12475
- return /*#__PURE__*/React.createElement(Select, {
12476
- options: [{
12477
- label: '是',
12478
- value: '是'
12479
- }, {
12480
- label: '否',
12481
- value: '否'
12482
- }],
12483
- disabled: disabled,
12484
- value: val,
12485
- onChange: function onChange(val) {
12486
- return updateHandle(val, index, 'mark');
12487
- }
12488
- });
12489
- }
12490
- }, {
12491
- dataIndex: 'skuName',
12492
- title: "".concat(text, "sku\u540D\u79F0"),
12493
- align: 'center',
12494
- ellipsis: true,
12495
- width: 250
12496
- }, {
12497
- dataIndex: 'sku',
12498
- title: "".concat(text, "sku\u7F16\u7801"),
12499
- align: 'center',
12500
- ellipsis: true,
12501
- width: 100
12502
- }, {
12503
- dataIndex: 'name',
12504
- title: "".concat(text, "\u540D\u79F0"),
12505
- align: 'center',
12506
- ellipsis: true,
12507
- width: 250
12508
- }, {
12509
- dataIndex: 'pic',
12510
- title: "\u56FE\u7247",
12511
- align: 'center',
12512
- ellipsis: true,
12513
- width: 100,
12514
- render: function render(val) {
12515
- return /*#__PURE__*/React.createElement(Image, {
12516
- width: 60,
12517
- src: val
12518
- });
12519
- }
12520
- }, {
12521
- dataIndex: 'code',
12522
- title: "".concat(text, "\u7F16\u7801"),
12523
- align: 'center',
12524
- ellipsis: true,
12525
- width: 100
12526
- }, {
12527
- dataIndex: 'money',
12528
- title: "\u5B9E\u4ED8\u91D1\u989D",
12529
- align: 'center',
12530
- ellipsis: true,
12531
- width: 100
12532
- }, {
12533
- dataIndex: 'number',
12534
- title: "".concat(text, "\u6570\u91CF"),
12535
- align: 'center',
12536
- ellipsis: true,
12537
- width: 100,
12538
- render: function render(val, record, index) {
12539
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12540
- style: {
12541
- width: 70
12542
- },
12543
- value: val,
12544
- min: 1,
12545
- precision: 0,
12546
- onChange: function onChange(num) {
12547
- return updateHandle(num, index, 'number');
12548
- }
12549
- }) : /*#__PURE__*/React.createElement("span", null, val);
12550
- }
12551
- }, {
12552
- dataIndex: 'share',
12553
- title: "\u5206\u644A\u4EF7",
12554
- align: 'center',
12555
- ellipsis: true,
12556
- width: 70
12557
- }, {
12558
- dataIndex: 'type',
12559
- title: "\u8D60\u54C1\u7C7B\u578B",
12560
- align: 'center',
12561
- ellipsis: true,
12562
- width: 100
12563
- }];
13771
+ columns = getColumnsMap({
13772
+ text: text,
13773
+ disabled: disabled,
13774
+ updateHandle: updateHandle
13775
+ })['default'];
12564
13776
  }
12565
13777
  return columns;
12566
13778
  };
@@ -12572,6 +13784,24 @@ var GoodItem$1 = function GoodItem(props) {
12572
13784
  return COLUMNS_INFO(type);
12573
13785
  };
12574
13786
  var newColumns = useMemo(function () {
13787
+ var initBaseInfoColumns = GOODS_INFO_COLUMNS();
13788
+ var baseInfoColumns = [];
13789
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
13790
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
13791
+ if (isStringArray) {
13792
+ baseInfoColumns = initBaseInfoColumns.filter(function (col) {
13793
+ return showHeader.includes(col.dataIndex);
13794
+ });
13795
+ } else if (isObjectArray) {
13796
+ baseInfoColumns = showHeader.filter(function (col) {
13797
+ return col.show !== false;
13798
+ }).map(function (col) {
13799
+ var currentCol = initBaseInfoColumns.find(function (item) {
13800
+ return item.dataIndex === col.dataIndex;
13801
+ });
13802
+ return currentCol ? currentCol : undefined;
13803
+ }).filter(Boolean);
13804
+ }
12575
13805
  var columnList = [{
12576
13806
  dataIndex: '',
12577
13807
  title: '序号',
@@ -12581,9 +13811,7 @@ var GoodItem$1 = function GoodItem(props) {
12581
13811
  render: function render(val, record, index) {
12582
13812
  return /*#__PURE__*/React.createElement("span", null, index + 1);
12583
13813
  }
12584
- }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
12585
- return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
12586
- })));
13814
+ }].concat(_toConsumableArray(baseInfoColumns));
12587
13815
  if (!disabled) {
12588
13816
  columnList.push({
12589
13817
  dataIndex: '',
@@ -12603,6 +13831,19 @@ var GoodItem$1 = function GoodItem(props) {
12603
13831
  }
12604
13832
  return columnList;
12605
13833
  }, [showHeader, value, disabled]);
13834
+ var orderColumns = useMemo(function () {
13835
+ var columns = COLUMNS_MAP('', false)(type);
13836
+ return [{
13837
+ dataIndex: '',
13838
+ title: '序号',
13839
+ align: 'center',
13840
+ ellipsis: true,
13841
+ width: 50,
13842
+ render: function render(val, record, index) {
13843
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
13844
+ }
13845
+ }].concat(_toConsumableArray(columns));
13846
+ }, []);
12606
13847
  var onSubmit = function onSubmit(list) {
12607
13848
  var newList = [];
12608
13849
  if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
@@ -12619,6 +13860,40 @@ var GoodItem$1 = function GoodItem(props) {
12619
13860
  }
12620
13861
  return item;
12621
13862
  });
13863
+ } else if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
13864
+ newList = list.map(function (item) {
13865
+ var specNo = item.specNo,
13866
+ specId = item.specId,
13867
+ goodName = item.goodName,
13868
+ goodShortName = item.goodShortName,
13869
+ goodPicUrl = item.goodPicUrl,
13870
+ goodNo = item.goodNo,
13871
+ goodId = item.goodId,
13872
+ retailPrice = item.retailPrice;
13873
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13874
+ sku: specNo,
13875
+ skuId: specId,
13876
+ goodsName: goodName,
13877
+ goodsShortName: goodShortName,
13878
+ picPath: goodPicUrl,
13879
+ goodsSn: goodNo,
13880
+ goodsId: goodId,
13881
+ goodsPrice: retailPrice,
13882
+ shopPrice: retailPrice,
13883
+ sharePayment: '',
13884
+ sharePrice: '',
13885
+ payment: '',
13886
+ tcSku: '',
13887
+ tcGoodsNumber: '',
13888
+ taoCanSingleSl: '',
13889
+ isGift: '',
13890
+ uuid: uuid(),
13891
+ canDelete: true,
13892
+ canEdit: true,
13893
+ goodsNumber: 1,
13894
+ canUpdateNumber: canUpdateNumber
13895
+ });
13896
+ });
12622
13897
  } else {
12623
13898
  newList = list.map(function (item) {
12624
13899
  var goodsId = item.goodsId,
@@ -12661,6 +13936,9 @@ var GoodItem$1 = function GoodItem(props) {
12661
13936
  fixed: true,
12662
13937
  onChange: onSelectChange
12663
13938
  };
13939
+ var handleCheckboxChange = function handleCheckboxChange(e) {
13940
+ onModeChange === null || onModeChange === void 0 ? void 0 : onModeChange(e.target.checked);
13941
+ };
12664
13942
  var tableConfig = useMemo(function () {
12665
13943
  var params = {};
12666
13944
  if (tableSelect) {
@@ -12672,10 +13950,18 @@ var GoodItem$1 = function GoodItem(props) {
12672
13950
  style: {
12673
13951
  float: 'right'
12674
13952
  }
12675
- }, /*#__PURE__*/React.createElement(Button, {
13953
+ }, showModeBtn && /*#__PURE__*/React.createElement(Checkbox, {
13954
+ checked: isStrict,
13955
+ onChange: handleCheckboxChange
13956
+ }, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !isEmpty(tradeGoods) && /*#__PURE__*/React.createElement(SelectTradeGoods, {
13957
+ columns: orderColumns,
13958
+ dataSource: tradeGoods.originDataSource,
13959
+ selectedRowKeys: selectedGoods,
13960
+ onChangeSelectedKeys: tradeGoods.selectedGoodsChange
13961
+ }), /*#__PURE__*/React.createElement(Button, {
12676
13962
  type: "link",
12677
13963
  onClick: handleChangeGoods
12678
- }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
13964
+ }, getButtonText(type)), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
12679
13965
  columns: newColumns,
12680
13966
  dataSource: value,
12681
13967
  rowKey: 'uuid',
@@ -12695,6 +13981,14 @@ var GoodItem$1 = function GoodItem(props) {
12695
13981
  shopId: shopId,
12696
13982
  maxLength: maxLength,
12697
13983
  companyKey: companyKey
13984
+ }) : ['BS_E3_REISSUE_GOODS', 'BS_E3_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(BsE3GoodsModal, {
13985
+ ref: refModal,
13986
+ onSubmit: onSubmit,
13987
+ width: width,
13988
+ shopList: shopList,
13989
+ shopId: shopId,
13990
+ maxLength: maxLength,
13991
+ companyKey: companyKey
12698
13992
  }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
12699
13993
  ref: refModal,
12700
13994
  onSubmit: onSubmit,
@@ -13314,19 +14608,261 @@ var BsReturnGoods = function BsReturnGoods(props) {
13314
14608
  })));
13315
14609
  };
13316
14610
 
13317
- var columnsNameMap = {
13318
- BS_SYSTEM_ORDER: {
13319
- typeName: '单据类型',
13320
- tagName: '标签'
13321
- },
13322
- WLN_SYSTEM_ORDER: {
13323
- typeName: '订单类型',
13324
- tagName: '标记'
13325
- },
13326
- WDT_SYSTEM_ORDER: {
13327
- typeName: '订单类型',
13328
- tagName: '订单标签'
14611
+ var singletonMap = new Map();
14612
+ var getWdtOrderListSingleton = function getWdtOrderListSingleton(orderNo) {
14613
+ if (!singletonMap.has(orderNo)) {
14614
+ var p = new Promise(function (resolve, reject) {
14615
+ var doReject = function doReject(err) {
14616
+ // 清空掉错误的请求记录
14617
+ singletonMap.delete(orderNo);
14618
+ reject(err);
14619
+ };
14620
+ extendRequest('/qy/gdfw/order/wdtOrderDetail', {
14621
+ method: 'post',
14622
+ data: {
14623
+ billNo: orderNo
14624
+ }
14625
+ }).then(function (data) {
14626
+ if (data === null || data === void 0 ? void 0 : data.success) {
14627
+ var _data$data, _data$data$trades;
14628
+ if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$trades = _data$data.trades) === null || _data$data$trades === void 0 ? void 0 : _data$data$trades.length) {
14629
+ data.data.trades = filterWdtOrders(data === null || data === void 0 ? void 0 : data.data, orderNo).map(function (item) {
14630
+ return _objectSpread2(_objectSpread2({}, item), {}, {
14631
+ billNo: item.tradeNo,
14632
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
14633
+ billTag: item.tagName
14634
+ });
14635
+ });
14636
+ }
14637
+ resolve(data.data);
14638
+ // 延迟10秒清除,保证订单的时效性
14639
+ setTimeout(function () {
14640
+ singletonMap.delete(orderNo);
14641
+ }, 1000 * 10);
14642
+ } else {
14643
+ doReject(data);
14644
+ }
14645
+ }).catch(doReject);
14646
+ });
14647
+ singletonMap.set(orderNo, p);
14648
+ }
14649
+ return singletonMap.get(orderNo);
14650
+ };
14651
+ var wdtUtils = {
14652
+ getWdtOrderListSingleton: getWdtOrderListSingleton
14653
+ };
14654
+
14655
+ var singletonMap$1 = new Map();
14656
+ var getBsE3OrderListSingleton = function getBsE3OrderListSingleton(orderNo) {
14657
+ if (!singletonMap$1.has(orderNo)) {
14658
+ var p = new Promise(function (resolve, reject) {
14659
+ var doReject = function doReject(err) {
14660
+ // 清空掉错误的请求记录
14661
+ // singletonMap.delete(orderNo);
14662
+ reject(err);
14663
+ };
14664
+ extendRequest('/qy/gdfw/order/bse3OrderDetail', {
14665
+ method: 'post',
14666
+ data: {
14667
+ billNo: orderNo
14668
+ }
14669
+ }).then(function (data) {
14670
+ if (data === null || data === void 0 ? void 0 : data.success) {
14671
+ var _data$data, _data$data$orderList;
14672
+ if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$orderList = _data$data.orderList) === null || _data$data$orderList === void 0 ? void 0 : _data$data$orderList.length) {
14673
+ data.data.orderList = filterBsE3Orders(data === null || data === void 0 ? void 0 : data.data, orderNo);
14674
+ }
14675
+ resolve(data.data);
14676
+ } else {
14677
+ doReject(data);
14678
+ }
14679
+ }).catch(doReject);
14680
+ });
14681
+ singletonMap$1.set(orderNo, p);
14682
+ }
14683
+ return singletonMap$1.get(orderNo);
14684
+ };
14685
+ var bsE3Utils = {
14686
+ getBsE3OrderListSingleton: getBsE3OrderListSingleton
14687
+ };
14688
+
14689
+ var singletonMap$2 = new Map();
14690
+ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
14691
+ if (!singletonMap$2.has(orderNo)) {
14692
+ var p = new Promise(function (resolve, reject) {
14693
+ var doReject = function doReject(err) {
14694
+ // 清空掉错误的请求记录
14695
+ singletonMap$2.delete(orderNo);
14696
+ reject(err);
14697
+ };
14698
+ extendRequest('/qy/gdfw/order/kmErpOrderDetail', {
14699
+ method: 'post',
14700
+ data: {
14701
+ tid: orderNo
14702
+ }
14703
+ }).then(function (data) {
14704
+ if (data === null || data === void 0 ? void 0 : data.success) {
14705
+ var _data$data, _data$data$orderDetai;
14706
+ if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$orderDetai = _data$data.orderDetailDtoList) === null || _data$data$orderDetai === void 0 ? void 0 : _data$data$orderDetai.length) {
14707
+ var list = filterKmOrders(data === null || data === void 0 ? void 0 : data.data, orderNo).map(function (item) {
14708
+ return _objectSpread2(_objectSpread2({}, item), {}, {
14709
+ billNo: item.sid,
14710
+ sysStatus: item.sysStatus,
14711
+ billType: item.type,
14712
+ billTag: item.tags
14713
+ });
14714
+ });
14715
+ resolve(list);
14716
+ } else {
14717
+ resolve([]);
14718
+ }
14719
+ // 延迟10秒清除,保证订单的时效性
14720
+ setTimeout(function () {
14721
+ singletonMap$2.delete(orderNo);
14722
+ }, 1000 * 10);
14723
+ } else {
14724
+ doReject(data);
14725
+ }
14726
+ }).catch(doReject);
14727
+ });
14728
+ singletonMap$2.set(orderNo, p);
14729
+ }
14730
+ return singletonMap$2.get(orderNo);
14731
+ };
14732
+ var kmUtils = {
14733
+ getOrderListSingleton: getOrderListSingleton
14734
+ };
14735
+
14736
+ var columnsMap = {
14737
+ BS_SYSTEM_ORDER: [{
14738
+ title: '单据类型',
14739
+ dataIndex: 'billType',
14740
+ width: 150
14741
+ }, {
14742
+ title: '系统订单号',
14743
+ dataIndex: 'billNo',
14744
+ width: 150
14745
+ }, {
14746
+ title: '标签',
14747
+ dataIndex: 'billTag',
14748
+ width: 150
14749
+ }, {
14750
+ title: '主播名称',
14751
+ dataIndex: 'authorName',
14752
+ width: 150
14753
+ }, {
14754
+ title: '主播ID',
14755
+ dataIndex: 'authorId',
14756
+ width: 150
13329
14757
  }
14758
+ // {
14759
+ // title: '直播活动',
14760
+ // dataIndex: 'liveActivites',
14761
+ // width: 150,
14762
+ // },
14763
+ ],
14764
+
14765
+ KM_SYSTEM_ORDER: KM_SYSTEM_ORDER_CONFIG.columns,
14766
+ WLN_SYSTEM_ORDER: [{
14767
+ title: '订单类型',
14768
+ dataIndex: 'billType',
14769
+ width: 150
14770
+ }, {
14771
+ title: '系统订单号',
14772
+ dataIndex: 'billNo',
14773
+ width: 150
14774
+ }, {
14775
+ title: '标记',
14776
+ dataIndex: 'billTag',
14777
+ width: 150
14778
+ }],
14779
+ WDT_SYSTEM_ORDER: [{
14780
+ title: '订单类型',
14781
+ dataIndex: 'billType',
14782
+ width: 150
14783
+ }, {
14784
+ title: '系统订单号',
14785
+ dataIndex: 'billNo',
14786
+ width: 150
14787
+ }, {
14788
+ title: '订单标签',
14789
+ dataIndex: 'billTag',
14790
+ width: 150
14791
+ }],
14792
+ BS_E3_SYSTEM_ORDER: [{
14793
+ title: '系统订单号',
14794
+ dataIndex: 'orderSn',
14795
+ width: 150,
14796
+ ellipsis: true
14797
+ }, {
14798
+ title: '订单状态',
14799
+ dataIndex: 'orderStatus',
14800
+ width: 100,
14801
+ ellipsis: true,
14802
+ render: function render(val) {
14803
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_ORDER_STATUS_MAP[val] || val);
14804
+ }
14805
+ }, {
14806
+ title: '是否被拆分',
14807
+ dataIndex: 'isSplit',
14808
+ width: 100,
14809
+ ellipsis: true,
14810
+ render: function render(val) {
14811
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14812
+ }
14813
+ }, {
14814
+ title: '是否拆分子单',
14815
+ dataIndex: 'isSplitNew',
14816
+ width: 100,
14817
+ ellipsis: true,
14818
+ render: function render(val) {
14819
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14820
+ }
14821
+ }, {
14822
+ title: '是否被合并',
14823
+ dataIndex: 'isCombine',
14824
+ width: 100,
14825
+ ellipsis: true,
14826
+ render: function render(val) {
14827
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14828
+ }
14829
+ }, {
14830
+ title: '是否合并新单',
14831
+ dataIndex: 'isCombineNew',
14832
+ width: 100,
14833
+ ellipsis: true,
14834
+ render: function render(val) {
14835
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14836
+ }
14837
+ }, {
14838
+ title: '是否复制单',
14839
+ dataIndex: 'isCopy',
14840
+ width: 100,
14841
+ ellipsis: true,
14842
+ render: function render(val) {
14843
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14844
+ }
14845
+ }, {
14846
+ title: '是否换货单',
14847
+ dataIndex: 'isExchangeOrder',
14848
+ width: 100,
14849
+ ellipsis: true,
14850
+ render: function render(val) {
14851
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14852
+ }
14853
+ }, {
14854
+ title: '订单备注',
14855
+ dataIndex: 'orderMsg',
14856
+ width: 150,
14857
+ ellipsis: true
14858
+ }]
14859
+ };
14860
+ var rowKeyMap = {
14861
+ BS_SYSTEM_ORDER: 'billNo',
14862
+ KM_SYSTEM_ORDER: 'billNo',
14863
+ WLN_SYSTEM_ORDER: 'billNo',
14864
+ WDT_SYSTEM_ORDER: 'billNo',
14865
+ BS_E3_SYSTEM_ORDER: 'orderSn'
13330
14866
  };
13331
14867
  var index$1 = (function (props) {
13332
14868
  var value = props.value,
@@ -13340,25 +14876,19 @@ var index$1 = (function (props) {
13340
14876
  onceRef.current = true;
13341
14877
  if (type === 'BS_SYSTEM_ORDER') {
13342
14878
  getOrderList(value.orderNo);
14879
+ } else if (type === 'KM_SYSTEM_ORDER') {
14880
+ getKmOrderList(value.orderNo);
13343
14881
  } else if (type === 'WLN_SYSTEM_ORDER') {
13344
14882
  getWlnOrderList(value.orderNo);
13345
14883
  } else if (type === 'WDT_SYSTEM_ORDER') {
13346
14884
  getWdtOrderList(value.orderNo);
14885
+ } else if (type === 'BS_E3_SYSTEM_ORDER') {
14886
+ getBsE3OrderList(value.orderNo);
13347
14887
  }
13348
14888
  }
13349
14889
  }, [value, type]);
13350
14890
  var columns = useMemo(function () {
13351
- var _columnsNameMap$type, _columnsNameMap$type2;
13352
- return [{
13353
- dataIndex: 'billType',
13354
- title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type = columnsNameMap[type]) === null || _columnsNameMap$type === void 0 ? void 0 : _columnsNameMap$type.typeName
13355
- }, {
13356
- dataIndex: 'billNo',
13357
- title: '系统订单号'
13358
- }, {
13359
- dataIndex: 'billTag',
13360
- title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type2 = columnsNameMap[type]) === null || _columnsNameMap$type2 === void 0 ? void 0 : _columnsNameMap$type2.tagName
13361
- }];
14891
+ return columnsMap[type] || [];
13362
14892
  }, [type]);
13363
14893
  var getOrderList = /*#__PURE__*/function () {
13364
14894
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
@@ -13384,11 +14914,15 @@ var index$1 = (function (props) {
13384
14914
  return {
13385
14915
  billNo: item.billNo,
13386
14916
  billType: item.billType,
13387
- billTag: item.billTag
14917
+ billTag: item.billTag,
14918
+ authorName: item.authorName,
14919
+ authorId: item.authorId
14920
+ // liveActivites: item.liveActivites,
13388
14921
  };
13389
14922
  })
13390
14923
  }));
13391
14924
  }
14925
+
13392
14926
  onceRef.current = false;
13393
14927
  case 7:
13394
14928
  case "end":
@@ -13448,58 +14982,92 @@ var index$1 = (function (props) {
13448
14982
  }();
13449
14983
  var getWdtOrderList = /*#__PURE__*/function () {
13450
14984
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
13451
- var _yield$request3, success, data, trades;
13452
14985
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
13453
14986
  while (1) switch (_context3.prev = _context3.next) {
13454
14987
  case 0:
13455
- _context3.next = 2;
13456
- return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13457
- method: 'post',
13458
- data: {
13459
- billNo: orderNo
13460
- }
14988
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14989
+ var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
14990
+ return (item.srcTid || '').split(',').includes(orderNo);
14991
+ });
14992
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14993
+ orders: trades,
14994
+ showOrderInfo: trades.map(function (_ref4) {
14995
+ var billNo = _ref4.billNo,
14996
+ billType = _ref4.billType,
14997
+ billTag = _ref4.billTag;
14998
+ return {
14999
+ billNo: billNo,
15000
+ billType: billType,
15001
+ billTag: billTag
15002
+ };
15003
+ })
15004
+ }));
15005
+ });
15006
+ onceRef.current = false;
15007
+ case 2:
15008
+ case "end":
15009
+ return _context3.stop();
15010
+ }
15011
+ }, _callee3);
15012
+ }));
15013
+ return function getWdtOrderList(_x3) {
15014
+ return _ref3.apply(this, arguments);
15015
+ };
15016
+ }();
15017
+ var getBsE3OrderList = /*#__PURE__*/function () {
15018
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderNo) {
15019
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
15020
+ while (1) switch (_context4.prev = _context4.next) {
15021
+ case 0:
15022
+ bsE3Utils.getBsE3OrderListSingleton(orderNo).then(function (data) {
15023
+ var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
15024
+ return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
15025
+ });
15026
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
15027
+ orders: trades,
15028
+ showOrderInfo: trades
15029
+ }));
13461
15030
  });
15031
+ onceRef.current = false;
13462
15032
  case 2:
13463
- _yield$request3 = _context3.sent;
13464
- success = _yield$request3.success;
13465
- data = _yield$request3.data;
13466
- if (success) {
13467
- trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
13468
- return (item.srcTid || '').split(',').includes(orderNo);
13469
- }).map(function (item) {
13470
- if (Array.isArray(item.goodDetails)) {
13471
- item.goodDetails = item.goodDetails.filter(function (good) {
13472
- return good.srcTid === orderNo;
13473
- });
13474
- }
13475
- return item;
13476
- });
13477
- _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13478
- orders: trades.map(function (item) {
13479
- return _objectSpread2(_objectSpread2({}, item), {}, {
13480
- billNo: item.tradeNo,
13481
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13482
- billTag: item.tagName
13483
- });
13484
- }),
13485
- showOrderInfo: trades.map(function (item) {
15033
+ case "end":
15034
+ return _context4.stop();
15035
+ }
15036
+ }, _callee4);
15037
+ }));
15038
+ return function getBsE3OrderList(_x4) {
15039
+ return _ref5.apply(this, arguments);
15040
+ };
15041
+ }();
15042
+ var getKmOrderList = /*#__PURE__*/function () {
15043
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(orderNo) {
15044
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
15045
+ while (1) switch (_context5.prev = _context5.next) {
15046
+ case 0:
15047
+ kmUtils.getOrderListSingleton(orderNo).then(function (trades) {
15048
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
15049
+ orders: trades,
15050
+ showOrderInfo: trades.map(function (_ref7) {
15051
+ var billNo = _ref7.billNo,
15052
+ billType = _ref7.billType,
15053
+ billTag = _ref7.billTag;
13486
15054
  return {
13487
- billNo: item.tradeNo,
13488
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13489
- billTag: item.tagName
15055
+ billNo: billNo,
15056
+ billType: billType,
15057
+ billTag: billTag
13490
15058
  };
13491
15059
  })
13492
15060
  }));
13493
- }
15061
+ });
13494
15062
  onceRef.current = false;
13495
- case 7:
15063
+ case 2:
13496
15064
  case "end":
13497
- return _context3.stop();
15065
+ return _context5.stop();
13498
15066
  }
13499
- }, _callee3);
15067
+ }, _callee5);
13500
15068
  }));
13501
- return function getWdtOrderList(_x3) {
13502
- return _ref3.apply(this, arguments);
15069
+ return function getKmOrderList(_x5) {
15070
+ return _ref6.apply(this, arguments);
13503
15071
  };
13504
15072
  }();
13505
15073
  var rowSelection = {
@@ -13522,7 +15090,7 @@ var index$1 = (function (props) {
13522
15090
  dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
13523
15091
  columns: columns,
13524
15092
  rowSelection: rowSelection,
13525
- rowKey: 'billNo',
15093
+ rowKey: rowKeyMap[type] || 'billNo',
13526
15094
  size: "small",
13527
15095
  pagination: false,
13528
15096
  scroll: {
@@ -13561,8 +15129,11 @@ var componentMap$1 = {
13561
15129
  type: 'wdt',
13562
15130
  key: 'wdtGoods',
13563
15131
  name: '旺店通',
15132
+ orderNo: 'srcTid',
15133
+ goodDetailOrderNo: 'srcTid',
13564
15134
  eventNameMap: {
13565
15135
  type: 'wdtType',
15136
+ updateGoodsHandle: updateWdtGoodsHandle,
13566
15137
  selectListReturn: 'wdtSelectListReturn',
13567
15138
  selectList: 'wdtSelectList',
13568
15139
  reissueSelectList: 'wdtReissueSelectList',
@@ -13577,6 +15148,30 @@ var componentMap$1 = {
13577
15148
  returnDeleteGood: 'wdtReturnDeleteGood',
13578
15149
  exchangeDeleteGood: 'wdtExchangeDeleteGood'
13579
15150
  }
15151
+ },
15152
+ 'BS_E3_GOODS': {
15153
+ type: 'e3',
15154
+ key: 'bsE3Goods',
15155
+ name: '百胜E3',
15156
+ orderNo: 'dealCode',
15157
+ goodDetailOrderNo: 'originalDealCode',
15158
+ eventNameMap: {
15159
+ type: 'bsE3Type',
15160
+ updateGoodsHandle: updateBsE3GoodsHandle,
15161
+ selectListReturn: 'bsE3SelectListReturn',
15162
+ selectList: 'bsE3SelectList',
15163
+ reissueSelectList: 'bsE3ReissueSelectList',
15164
+ reissueSelectListReturn: 'bsE3ReissueSelectListReturn',
15165
+ reissueDeleteGood: 'bsE3ReissueDeleteGood',
15166
+ changeShopCode: 'bsE3ChangeShopCode',
15167
+ reissueType: 'bsE3ReissueType',
15168
+ returnType: 'bsE3ReturnType',
15169
+ returnSelectListReturn: 'bsE3ReturnSelectListReturn',
15170
+ returnSelectList: 'bsE3ReturnSelectList',
15171
+ deleteGood: 'bsE3DeleteGood',
15172
+ returnDeleteGood: 'bsE3ReturnDeleteGood',
15173
+ exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
15174
+ }
13580
15175
  }
13581
15176
  };
13582
15177
  var CommonGoods = function CommonGoods(props) {
@@ -13585,6 +15180,13 @@ var CommonGoods = function CommonGoods(props) {
13585
15180
  disabled = props.disabled,
13586
15181
  onChange = props.onChange,
13587
15182
  compType = props.type;
15183
+ console.log('value?.orders', value === null || value === void 0 ? void 0 : value.orders);
15184
+ // 合并单订单会包含","
15185
+ var showModeBtn = !['BS_E3_GOODS'].includes(compType) && ((value === null || value === void 0 ? void 0 : value.orders) || []).some(function (order) {
15186
+ var _order$componentMap$c;
15187
+ return order === null || order === void 0 ? void 0 : (_order$componentMap$c = order[componentMap$1[compType].orderNo]) === null || _order$componentMap$c === void 0 ? void 0 : _order$componentMap$c.includes(',');
15188
+ });
15189
+ var getOrderFlag = useRef(false);
13588
15190
  var _useState = useState(false),
13589
15191
  _useState2 = _slicedToArray(_useState, 2),
13590
15192
  tableSelect = _useState2[0],
@@ -13592,8 +15194,36 @@ var CommonGoods = function CommonGoods(props) {
13592
15194
  var withInfo = useRef(null);
13593
15195
  var valueRef = useRef(null);
13594
15196
  useEffect(function () {
15197
+ var _value$orders;
13595
15198
  valueRef.current = value;
15199
+ if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo)) {
15200
+ getOrderFlag.current = true;
15201
+ compType.indexOf('WDT') > -1 && getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
15202
+ }
13596
15203
  }, [value]);
15204
+ var getWdtOrderList = /*#__PURE__*/function () {
15205
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
15206
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
15207
+ while (1) switch (_context.prev = _context.next) {
15208
+ case 0:
15209
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
15210
+ var orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (trade) {
15211
+ return (value.selectIds || []).includes(trade.tradeNo);
15212
+ });
15213
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
15214
+ orders: orders
15215
+ }));
15216
+ });
15217
+ case 1:
15218
+ case "end":
15219
+ return _context.stop();
15220
+ }
15221
+ }, _callee);
15222
+ }));
15223
+ return function getWdtOrderList(_x) {
15224
+ return _ref.apply(this, arguments);
15225
+ };
15226
+ }();
13597
15227
  useEffect(function () {
13598
15228
  pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
13599
15229
  if (disabled) return;
@@ -13651,7 +15281,7 @@ var CommonGoods = function CommonGoods(props) {
13651
15281
  });
13652
15282
  pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
13653
15283
  // console.log(data);
13654
- onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
15284
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
13655
15285
  shopCode: data.shopCode
13656
15286
  }));
13657
15287
  });
@@ -13691,6 +15321,24 @@ var CommonGoods = function CommonGoods(props) {
13691
15321
  var changeHandle = function changeHandle(list) {
13692
15322
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
13693
15323
  };
15324
+ var handleModeChange = function handleModeChange(isStrict) {
15325
+ // isStrict 是否只展示当前平台订单商品
15326
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({
15327
+ isStrict: isStrict
15328
+ }, componentMap$1[compType].key, getGoodDetails({
15329
+ mode: isStrict
15330
+ }))));
15331
+ };
15332
+ var getGoodDetails = function getGoodDetails(_ref2) {
15333
+ var mode = _ref2.mode;
15334
+ var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
15335
+ var goodDetails = updateHandle(value.orders || []);
15336
+ var orderNo = value.orderNo;
15337
+ return mode ? goodDetails.filter(function (goodItem) {
15338
+ var _componentMap$compTyp;
15339
+ return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp = componentMap$1[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.goodDetailOrderNo]) === orderNo;
15340
+ }) : goodDetails;
15341
+ };
13694
15342
  return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13695
15343
  key: componentMap$1[compType].key
13696
15344
  }, props), {}, {
@@ -13707,7 +15355,10 @@ var CommonGoods = function CommonGoods(props) {
13707
15355
  },
13708
15356
  onChange: function onChange(val) {
13709
15357
  return changeHandle(val);
13710
- }
15358
+ },
15359
+ onModeChange: handleModeChange,
15360
+ showModeBtn: showModeBtn,
15361
+ isStrict: value === null || value === void 0 ? void 0 : value.isStrict
13711
15362
  }));
13712
15363
  };
13713
15364
 
@@ -13974,8 +15625,8 @@ var typeMap$1 = {
13974
15625
  key: 'wdtReissueGoods',
13975
15626
  name: '旺店通',
13976
15627
  typeName: 'wdtReissueType',
13977
- wdtSystemOrder: 'wdtSystemOrder',
13978
- wdtSystemOrderNo: 'wdtSystemOrderNo',
15628
+ systemOrder: 'wdtSystemOrder',
15629
+ systemOrderNo: 'wdtSystemOrderNo',
13979
15630
  reissueSelectList: 'wdtReissueSelectList',
13980
15631
  reissueSelectListReturn: 'wdtReissueSelectListReturn',
13981
15632
  reissueDeleteGood: 'wdtReissueDeleteGood',
@@ -13984,11 +15635,12 @@ var typeMap$1 = {
13984
15635
  formatDefaultField: {
13985
15636
  money: 'orderPrice',
13986
15637
  share: 'sharePrice'
13987
- }
15638
+ },
15639
+ getOrderList: wdtUtils.getWdtOrderListSingleton
13988
15640
  }
13989
15641
  };
13990
15642
  var wdtReissue = function wdtReissue(props) {
13991
- var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type10, _typeMap$type26, _typeMap$type27, _value$typeMap$type$w2, _typeMap$type28, _typeMap$type29, _typeMap$type30;
15643
+ var _value$wdtSystemOrder, _typeMap$type26, _typeMap$type28, _typeMap$type29, _value$typeMap$type$s5, _typeMap$type30, _typeMap$type31, _typeMap$type32;
13992
15644
  var value = props.value,
13993
15645
  onChange = props.onChange,
13994
15646
  _props$reasonList = props.reasonList,
@@ -13996,177 +15648,187 @@ var wdtReissue = function wdtReissue(props) {
13996
15648
  disabled = props.disabled,
13997
15649
  type = props.type,
13998
15650
  other = _objectWithoutProperties(props, _excluded$g);
13999
- var valueRef = useRef({});
14000
- useEffect(function () {
14001
- var _typeMap$type, _typeMap$type4;
14002
- valueRef.current = value;
14003
- pubsub.subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
14004
- if (disabled) return;
14005
- if (value) {
14006
- var _typeMap$type2, _typeMap$type3;
14007
- var newValue = _objectSpread2({}, value);
14008
- newValue["".concat((_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.key)].filter(function (item) {
14009
- return item.sku !== data;
14010
- });
14011
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14012
- }
14013
- });
14014
- pubsub.subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
14015
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14016
- shopCode: data.shopCode
14017
- }));
14018
- });
14019
- }, [value, disabled]);
15651
+ var showModeBtn = ((value === null || value === void 0 ? void 0 : (_value$wdtSystemOrder = value.wdtSystemOrder) === null || _value$wdtSystemOrder === void 0 ? void 0 : _value$wdtSystemOrder.orders) || []).some(function (order) {
15652
+ var _order$srcTid;
15653
+ return order === null || order === void 0 ? void 0 : (_order$srcTid = order.srcTid) === null || _order$srcTid === void 0 ? void 0 : _order$srcTid.includes(',');
15654
+ });
15655
+ var getOrderFlag = useRef(false);
15656
+ var _useState = useState(false),
15657
+ _useState2 = _slicedToArray(_useState, 2),
15658
+ isStrict = _useState2[0],
15659
+ setIsStrict = _useState2[1];
14020
15660
  useEffect(function () {
14021
- var _value$orders, _value$showOrderInfo;
14022
- if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
14023
- if (type === 'WDT_SYSTEM_ORDER') {
14024
- getWdtOrderList(value.orderNo);
14025
- }
15661
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
15662
+ if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$1[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$1[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)) {
15663
+ var _value$typeMap$type$s4, _typeMap$type3;
15664
+ getOrderFlag.current = true;
15665
+ getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$1[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);
14026
15666
  }
14027
15667
  return;
14028
15668
  }, [value]);
14029
- useEffect(function () {
14030
- var _typeMap$type5;
14031
- var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.wdtSystemOrderNo];
14032
- if (wdtSystemOrderNo) {
14033
- var _value$typeMap$type$t, _typeMap$type6;
14034
- if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
14035
- getGoodItems(wdtSystemOrderNo);
14036
- }
14037
- }
14038
- return;
14039
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
14040
- useEffect(function () {
14041
- var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
14042
- var typeName = value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0];
14043
- var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.wdtSystemOrderNo];
14044
- if (['1'].includes(typeName)) {
14045
- wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
14046
- } else if (['2'].includes(typeName)) {
14047
- var newValue = _objectSpread2({}, value);
14048
- // newValue[`${typeMap?.[type]?.key}`] = [];
14049
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14050
- }
14051
- return;
14052
- }, [value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]]);
14053
- var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
14054
- var _value$typeMap$type$w, _typeMap$type11, _ref;
14055
- var orders = value === null || value === void 0 ? void 0 : (_value$typeMap$type$w = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.wdtSystemOrder]) === null || _value$typeMap$type$w === void 0 ? void 0 : _value$typeMap$type$w.orders;
14056
- var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
14057
- return orderItem.billNo === wdtSystemOrderNo;
14058
- });
14059
- if (order) {
14060
- var _typeMap$type12, _order$goodDetails;
14061
- var newValue = _objectSpread2({}, value);
14062
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
14063
- var _typeMap$type13, _typeMap$type14;
14064
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.formatDefaultField.money)] = 0;
14065
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.share)] = 0;
14066
- item.canUpdateNumber = true;
14067
- return item;
14068
- });
14069
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14070
- }
14071
- };
14072
- var getWdtOrderList = /*#__PURE__*/function () {
14073
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
14074
- var _yield$request, success, data, _typeMap$type15, _typeMap$type16, orders, showOrderInfo;
15669
+ // useEffect(() => {
15670
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
15671
+ // if (systemOrderNo) {
15672
+ // if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
15673
+ // onChange?.({
15674
+ // ...value,
15675
+ // [typeMap[type]?.key]: getGoodDetails({
15676
+ // mode: isStrict
15677
+ // })
15678
+ // })
15679
+ // }
15680
+ // }
15681
+ // return;
15682
+ // }, [value?.[typeMap[type]?.systemOrderNo]]);
15683
+ // const getWdtOrderList = async (orderNo: string) => {
15684
+ // wdtUtils.getWdtOrderListSingleton(orderNo).then(data => {
15685
+ // const orders = data?.trades || [];
15686
+ // const showOrderInfo = orders.map(({ billNo, billType, billTag }: any) => {
15687
+ // return { billNo, billType, billTag }
15688
+ // });
15689
+ // onChange({
15690
+ // ...value,
15691
+ // [typeMap[type]?.systemOrder]: {
15692
+ // ...value[typeMap[type]?.systemOrder],
15693
+ // showOrderInfo,
15694
+ // orders,
15695
+ // },
15696
+ // });
15697
+ // })
15698
+ // };
15699
+ var getOrderList = /*#__PURE__*/function () {
15700
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
15701
+ var _typeMap$type4;
14075
15702
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14076
15703
  while (1) switch (_context.prev = _context.next) {
14077
15704
  case 0:
14078
- _context.next = 2;
14079
- return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
14080
- method: 'post',
14081
- data: {
14082
- billNo: orderNo
14083
- }
14084
- });
14085
- case 2:
14086
- _yield$request = _context.sent;
14087
- success = _yield$request.success;
14088
- data = _yield$request.data;
14089
- if (success) {
14090
- orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
14091
- return _objectSpread2(_objectSpread2({}, item), {}, {
14092
- billNo: item.tradeNo,
14093
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
14094
- billTag: item.tagName
14095
- });
14096
- });
14097
- showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
15705
+ (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
15706
+ var _typeMap$type5, _typeMap$type6;
15707
+ var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
15708
+ var showOrderInfo = orders.map(function (_ref2) {
15709
+ var billNo = _ref2.billNo,
15710
+ billType = _ref2.billType,
15711
+ billTag = _ref2.billTag;
14098
15712
  return {
14099
- billNo: item.tradeNo,
14100
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
14101
- billTag: item.tagName
15713
+ billNo: billNo,
15714
+ billType: billType,
15715
+ billTag: billTag
14102
15716
  };
14103
15717
  });
14104
- onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.wdtSystemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.wdtSystemOrder]), {}, {
15718
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
14105
15719
  showOrderInfo: showOrderInfo,
14106
15720
  orders: orders
14107
15721
  }))));
14108
- }
14109
- case 6:
15722
+ });
15723
+ case 1:
14110
15724
  case "end":
14111
15725
  return _context.stop();
14112
15726
  }
14113
15727
  }, _callee);
14114
15728
  }));
14115
- return function getWdtOrderList(_x) {
14116
- return _ref2.apply(this, arguments);
15729
+ return function getOrderList(_x) {
15730
+ return _ref.apply(this, arguments);
14117
15731
  };
14118
15732
  }();
14119
15733
  var changeTypeHandle = function changeTypeHandle(val) {
14120
- var _typeMap$type17, _typeMap$type18;
15734
+ var _value$typeMap$type$t, _typeMap$type7, _typeMap$type8;
15735
+ var typeName = val === null || val === void 0 ? void 0 : val[0];
15736
+ if (typeName === (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type7 = typeMap$1[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;
15737
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
14121
15738
  var newValue = _objectSpread2({}, value);
14122
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.typeName)] = val;
14123
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.key)] = [];
15739
+ newValue[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName] = val;
15740
+ if (typeName === '1') {
15741
+ var _typeMap$type9;
15742
+ newValue[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = getGoodDetails({
15743
+ mode: isStrict
15744
+ });
15745
+ } else if (typeName === '2') {
15746
+ var _typeMap$type10;
15747
+ // 切换到非原单,清空列表
15748
+ newValue[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key] = [];
15749
+ }
14124
15750
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14125
- valueRef.current = newValue;
14126
- // if (['2'].includes(val[0])) {
14127
- // onChange?.(newValue);
14128
- // valueRef.current = newValue;
14129
- // }
14130
- // pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
14131
- // val: val[0],
14132
- // goodValue: newValue,
14133
- // });
14134
15751
  };
14135
-
15752
+ var handleModeChange = function handleModeChange(mode) {
15753
+ var _value$typeMap$type$t2, _typeMap$type11, _typeMap$type12;
15754
+ var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type11 = typeMap$1[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';
15755
+ setIsStrict(mode);
15756
+ if (!isOriginalOrder) return;
15757
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key, getGoodDetails({
15758
+ mode: mode
15759
+ }))));
15760
+ };
15761
+ var getGoodDetails = function getGoodDetails(_ref3) {
15762
+ var _typeMap$type13, _typeMap$type14, _order$goodDetails;
15763
+ var mode = _ref3.mode,
15764
+ sysOrderNo = _ref3.sysOrderNo;
15765
+ var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrder];
15766
+ var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.systemOrderNo];
15767
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
15768
+ return order.tradeNo === systemOrderNo;
15769
+ });
15770
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.length) ? updateWdtGoodsHandle([order]) : [];
15771
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
15772
+ return mode ? goodDetails.filter(function (goodItem) {
15773
+ return !orderNo || goodItem.srcTid === orderNo;
15774
+ }) : goodDetails;
15775
+ };
14136
15776
  var changeGoodHandle = function changeGoodHandle(val) {
14137
- var _typeMap$type19;
15777
+ var _typeMap$type15;
14138
15778
  var newValue = _objectSpread2({}, value);
14139
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = (val || []).map(function (item) {
14140
- var _typeMap$type20, _typeMap$type21;
14141
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.formatDefaultField.money)] = 0;
14142
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.formatDefaultField.share)] = 0;
15779
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.key)] = (val || []).map(function (item) {
15780
+ var _typeMap$type16, _typeMap$type17;
15781
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.formatDefaultField.money)] = 0;
15782
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.share)] = 0;
14143
15783
  return item;
14144
15784
  });
14145
15785
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14146
15786
  };
14147
15787
  var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
14148
- var _typeMap$type22, _value$typeMap$type$t4, _typeMap$type23;
15788
+ var _typeMap$type18, _value$typeMap$type$t3, _typeMap$type19, _value$typeMap$type$t4, _typeMap$type21;
14149
15789
  var newValue = _objectSpread2({}, value);
14150
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.wdtSystemOrderNo)] = val;
14151
- if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0])) {
14152
- var _typeMap$type24;
14153
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)] = [];
15790
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.systemOrderNo)] = val;
15791
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type19 = typeMap$1[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])) {
15792
+ var _typeMap$type20;
15793
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = [];
15794
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type21 = typeMap$1[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])) {
15795
+ var _typeMap$type22;
15796
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)] = getGoodDetails({
15797
+ mode: isStrict,
15798
+ sysOrderNo: val
15799
+ });
14154
15800
  }
14155
15801
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14156
15802
  };
15803
+ var selectedGoodsChange = useCallback(function (skuList) {
15804
+ var _typeMap$type23, _typeMap$type24, _uniqBy, _typeMap$type25;
15805
+ var newValue = _objectSpread2({}, value);
15806
+ // 原订单商品
15807
+ var originTradeGoodList = getGoodDetails({
15808
+ mode: isStrict
15809
+ }) || [];
15810
+ // 当前选中的所有商品【包含了原订单+商品库】
15811
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)]) || [];
15812
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
15813
+ return skuList.includes(item.uuid);
15814
+ });
15815
+ console.log('商品发生变化', newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.key)]);
15816
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
15817
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.key)], isStrict]);
14157
15818
  //显示选择商品按钮 原单换不显示选择商品
14158
15819
  var showChangeBtn = useMemo(function () {
14159
- var _typeMap$type25;
14160
- return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]);
14161
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo]]);
15820
+ var _typeMap$type27;
15821
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]);
15822
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.systemOrderNo]]);
14162
15823
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
14163
- gutter: 8
15824
+ gutter: 8,
15825
+ wrap: true
14164
15826
  }, /*#__PURE__*/React.createElement(Col, {
14165
15827
  className: "gutter-row",
14166
15828
  xs: {
14167
15829
  span: 11
14168
15830
  },
14169
- md: {
15831
+ sm: {
14170
15832
  span: 6
14171
15833
  }
14172
15834
  }, /*#__PURE__*/React.createElement(Select, {
@@ -14175,12 +15837,12 @@ var wdtReissue = function wdtReissue(props) {
14175
15837
  },
14176
15838
  disabled: disabled,
14177
15839
  allowClear: false,
14178
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.wdtSystemOrderNo)],
15840
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.systemOrderNo)],
14179
15841
  onChange: function onChange(val) {
14180
15842
  return changeSystemOrderHandle(val);
14181
15843
  },
14182
15844
  placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
14183
- }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$w2 = value[(_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.wdtSystemOrder]) === null || _value$typeMap$type$w2 === void 0 ? void 0 : _value$typeMap$type$w2.showOrderInfo) || []).map(function (item) {
15845
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type30 = typeMap$1[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) {
14184
15846
  return /*#__PURE__*/React.createElement(Select.Option, {
14185
15847
  key: item.billNo,
14186
15848
  value: item.billNo,
@@ -14191,7 +15853,7 @@ var wdtReissue = function wdtReissue(props) {
14191
15853
  xs: {
14192
15854
  span: 11
14193
15855
  },
14194
- md: {
15856
+ sm: {
14195
15857
  span: 6
14196
15858
  }
14197
15859
  }, /*#__PURE__*/React.createElement(Cascader, {
@@ -14201,7 +15863,7 @@ var wdtReissue = function wdtReissue(props) {
14201
15863
  disabled: disabled,
14202
15864
  allowClear: false,
14203
15865
  options: reasonList,
14204
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.typeName)],
15866
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type31 = typeMap$1[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.typeName)],
14205
15867
  onChange: function onChange(val) {
14206
15868
  return changeTypeHandle(val);
14207
15869
  }
@@ -14213,9 +15875,18 @@ var wdtReissue = function wdtReissue(props) {
14213
15875
  canUpdateNumber: showChangeBtn,
14214
15876
  showChangeBtn: showChangeBtn,
14215
15877
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
14216
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type30 = typeMap$1[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.key)],
15878
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type32 = typeMap$1[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)],
14217
15879
  onChange: function onChange(val) {
14218
15880
  return changeGoodHandle(val);
15881
+ },
15882
+ onModeChange: handleModeChange,
15883
+ showModeBtn: showModeBtn,
15884
+ isStrict: isStrict,
15885
+ tradeGoods: {
15886
+ originDataSource: getGoodDetails({
15887
+ mode: isStrict
15888
+ }),
15889
+ selectedGoodsChange: selectedGoodsChange
14219
15890
  }
14220
15891
  })));
14221
15892
  };
@@ -14226,7 +15897,7 @@ styleInject(css_248z$a);
14226
15897
  var TabPane$1 = Tabs.TabPane;
14227
15898
  var Option$2 = Select.Option;
14228
15899
  var Search$1 = Input.Search;
14229
- var GoodsModal$4 = function GoodsModal(props) {
15900
+ var GoodsModal$5 = function GoodsModal(props) {
14230
15901
  var onSubmit = props.onSubmit,
14231
15902
  _onCancel = props.onCancel,
14232
15903
  visible = props.visible,
@@ -14677,7 +16348,7 @@ var Goods$1 = function Goods(props, ref) {
14677
16348
  };
14678
16349
  return /*#__PURE__*/React.createElement("div", {
14679
16350
  className: "goodsBox"
14680
- }, /*#__PURE__*/React.createElement(GoodsModal$4, {
16351
+ }, /*#__PURE__*/React.createElement(GoodsModal$5, {
14681
16352
  visible: visible,
14682
16353
  onSubmit: onSubmit,
14683
16354
  type: type,
@@ -14990,4 +16661,238 @@ var CalculationInput = function CalculationInput(props) {
14990
16661
  }, config === null || config === void 0 ? void 0 : config.unit));
14991
16662
  };
14992
16663
 
14993
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
16664
+ var _excluded$k = ["value", "onChange", "reasonList", "disabled", "type"];
16665
+ var typeMap$2 = {
16666
+ BS_E3_REISSUE_GOODS: {
16667
+ key: 'bsE3ReissueGoods',
16668
+ typeName: 'bsE3ReissueType',
16669
+ systemOrder: 'bsE3SystemOrder',
16670
+ systemOrderNo: 'bsE3SystemOrderNo',
16671
+ getOrderList: bsE3Utils.getBsE3OrderListSingleton
16672
+ }
16673
+ };
16674
+ var bsE3Reissue = function bsE3Reissue(props) {
16675
+ var _typeMap$type21, _typeMap$type24, _typeMap$type25, _value$typeMap$type$s5, _typeMap$type26, _typeMap$type27, _typeMap$type28;
16676
+ var value = props.value,
16677
+ onChange = props.onChange,
16678
+ _props$reasonList = props.reasonList,
16679
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
16680
+ disabled = props.disabled,
16681
+ type = props.type,
16682
+ other = _objectWithoutProperties(props, _excluded$k);
16683
+ var getOrderFlag = useRef(false);
16684
+ var _useState = useState(false),
16685
+ _useState2 = _slicedToArray(_useState, 2),
16686
+ isStrict = _useState2[0],
16687
+ setIsStrict = _useState2[1];
16688
+ // TODO: 在修改场景下手动获取一次订单详情中数据
16689
+ useEffect(function () {
16690
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
16691
+ if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$2[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$2[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)) {
16692
+ var _value$typeMap$type$s4, _typeMap$type3;
16693
+ getOrderFlag.current = true;
16694
+ getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$2[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);
16695
+ }
16696
+ return;
16697
+ }, [value]);
16698
+ // useEffect(() => {
16699
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
16700
+ // if (systemOrderNo) {
16701
+ // if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
16702
+ // onChange?.({
16703
+ // ...value,
16704
+ // [typeMap[type]?.key]: getGoodDetails({
16705
+ // mode: isStrict
16706
+ // })
16707
+ // })
16708
+ // }
16709
+ // }
16710
+ // return;
16711
+ // }, [value?.[typeMap[type]?.systemOrderNo]]);
16712
+ var getOrderList = /*#__PURE__*/function () {
16713
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
16714
+ var _typeMap$type4;
16715
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
16716
+ while (1) switch (_context.prev = _context.next) {
16717
+ case 0:
16718
+ (_typeMap$type4 = typeMap$2[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
16719
+ var _typeMap$type5, _typeMap$type6;
16720
+ var orders = (data === null || data === void 0 ? void 0 : data.orderList) || [];
16721
+ var showOrderInfo = orders.map(function (_ref2) {
16722
+ var orderSn = _ref2.orderSn;
16723
+ return {
16724
+ billNo: orderSn
16725
+ };
16726
+ });
16727
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$2[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$2[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
16728
+ showOrderInfo: showOrderInfo,
16729
+ orders: orders
16730
+ }))));
16731
+ });
16732
+ case 1:
16733
+ case "end":
16734
+ return _context.stop();
16735
+ }
16736
+ }, _callee);
16737
+ }));
16738
+ return function getOrderList(_x) {
16739
+ return _ref.apply(this, arguments);
16740
+ };
16741
+ }();
16742
+ var changeTypeHandle = function changeTypeHandle(val) {
16743
+ var _typeMap$type7;
16744
+ var typeName = val === null || val === void 0 ? void 0 : val[0];
16745
+ // if (typeName === value?.[typeMap[type]?.typeName]?.[0]) return
16746
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
16747
+ var newValue = _objectSpread2({}, value);
16748
+ newValue[(_typeMap$type7 = typeMap$2[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName] = val;
16749
+ if (typeName === '1') {
16750
+ var _typeMap$type8;
16751
+ newValue[(_typeMap$type8 = typeMap$2[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.key] = getGoodDetails({
16752
+ mode: isStrict
16753
+ });
16754
+ } else if (typeName === '2') {
16755
+ var _typeMap$type9;
16756
+ // 切换到非原单,清空列表
16757
+ newValue[(_typeMap$type9 = typeMap$2[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = [];
16758
+ }
16759
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16760
+ };
16761
+ var handleModeChange = function handleModeChange(mode) {
16762
+ var _value$typeMap$type$t, _typeMap$type10, _typeMap$type11;
16763
+ var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type10 = typeMap$2[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0]) === '1';
16764
+ setIsStrict(mode);
16765
+ if (!isOriginalOrder) return;
16766
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type11 = typeMap$2[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.key, getGoodDetails({
16767
+ mode: mode
16768
+ }))));
16769
+ };
16770
+ var getGoodDetails = function getGoodDetails(_ref3) {
16771
+ var _typeMap$type12, _typeMap$type13, _order$orderDetailGet;
16772
+ var mode = _ref3.mode,
16773
+ sysOrderNo = _ref3.sysOrderNo;
16774
+ var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type12 = typeMap$2[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.systemOrder];
16775
+ var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$2[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrderNo];
16776
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
16777
+ return order.orderSn === systemOrderNo;
16778
+ });
16779
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$orderDetailGet = order.orderDetailGets) === null || _order$orderDetailGet === void 0 ? void 0 : _order$orderDetailGet.length) ? updateBsE3GoodsHandle([order]) : [];
16780
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
16781
+ return mode ? goodDetails.filter(function (goodItem) {
16782
+ return !orderNo || goodItem.originalOrderSn === orderNo;
16783
+ }) : goodDetails;
16784
+ };
16785
+ var changeGoodHandle = function changeGoodHandle(val) {
16786
+ var _typeMap$type14;
16787
+ var newValue = _objectSpread2({}, value);
16788
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type14 = typeMap$2[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key)] = val || [];
16789
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16790
+ };
16791
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
16792
+ var _typeMap$type15, _value$typeMap$type$t2, _typeMap$type16, _value$typeMap$type$t3, _typeMap$type18;
16793
+ var newValue = _objectSpread2({}, value);
16794
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type15 = typeMap$2[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.systemOrderNo)] = val;
16795
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type16 = typeMap$2[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
16796
+ var _typeMap$type17;
16797
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type17 = typeMap$2[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.key)] = [];
16798
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type18 = typeMap$2[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
16799
+ var _typeMap$type19;
16800
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = getGoodDetails({
16801
+ mode: isStrict,
16802
+ sysOrderNo: val
16803
+ });
16804
+ }
16805
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16806
+ };
16807
+ //显示选择商品按钮 原单换不显示选择商品
16808
+ var showChangeBtn = useMemo(function () {
16809
+ var _typeMap$type20;
16810
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.systemOrderNo]);
16811
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo]]);
16812
+ var selectedGoodsChange = useCallback(function (skuList) {
16813
+ var _typeMap$type22, _typeMap$type23, _uniqBy;
16814
+ var newValue = _objectSpread2({}, value);
16815
+ // 原订单商品
16816
+ var originTradeGoodList = getGoodDetails({
16817
+ mode: isStrict
16818
+ }) || [];
16819
+ // 当前选中的所有商品【包含了原订单+商品库】
16820
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)]) || [];
16821
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
16822
+ return skuList.includes(item.uuid);
16823
+ });
16824
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16825
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)], isStrict]);
16826
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
16827
+ gutter: 8,
16828
+ wrap: true,
16829
+ id: "bsE3ReissueGoods"
16830
+ }, /*#__PURE__*/React.createElement(Col, {
16831
+ className: "gutter-row",
16832
+ xs: {
16833
+ span: 11
16834
+ },
16835
+ sm: {
16836
+ span: 6
16837
+ }
16838
+ }, /*#__PURE__*/React.createElement(Select, {
16839
+ style: {
16840
+ marginBottom: '8px'
16841
+ },
16842
+ disabled: disabled,
16843
+ allowClear: false,
16844
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderNo)],
16845
+ onChange: function onChange(val) {
16846
+ return changeSystemOrderHandle(val);
16847
+ },
16848
+ placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
16849
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
16850
+ return /*#__PURE__*/React.createElement(Select.Option, {
16851
+ key: item.billNo,
16852
+ value: item.billNo,
16853
+ label: item.billNo
16854
+ }, item.billNo);
16855
+ }))), /*#__PURE__*/React.createElement(Col, {
16856
+ className: "gutter-row",
16857
+ xs: {
16858
+ span: 11
16859
+ },
16860
+ sm: {
16861
+ span: 6
16862
+ }
16863
+ }, /*#__PURE__*/React.createElement(Cascader, {
16864
+ style: {
16865
+ marginBottom: '8px'
16866
+ },
16867
+ disabled: disabled,
16868
+ allowClear: false,
16869
+ options: reasonList,
16870
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.typeName)],
16871
+ onChange: function onChange(val) {
16872
+ return changeTypeHandle(val);
16873
+ }
16874
+ }))), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
16875
+ key: 'reissueGoods'
16876
+ }, other), {}, {
16877
+ type: type,
16878
+ disabled: disabled,
16879
+ canUpdateNumber: showChangeBtn,
16880
+ showChangeBtn: showChangeBtn,
16881
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
16882
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type28 = typeMap$2[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.key)],
16883
+ onChange: function onChange(val) {
16884
+ return changeGoodHandle(val);
16885
+ },
16886
+ onModeChange: handleModeChange,
16887
+ showModeBtn: false,
16888
+ isStrict: isStrict,
16889
+ tradeGoods: {
16890
+ originDataSource: getGoodDetails({
16891
+ mode: isStrict
16892
+ }),
16893
+ selectedGoodsChange: selectedGoodsChange
16894
+ }
16895
+ })));
16896
+ };
16897
+
16898
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap };