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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -929,8 +929,8 @@ function dataURLtoFile(dataurl, filename) {
929
929
  });
930
930
  }
931
931
 
932
- 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";
933
- 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"};
932
+ 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";
933
+ 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"};
934
934
  styleInject(css_248z$1);
935
935
 
936
936
  var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
@@ -951,7 +951,6 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
951
951
  _ref$accept = _ref.accept,
952
952
  accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
953
953
  _ref$canPreview = _ref.canPreview,
954
- canPreview = _ref$canPreview === void 0 ? true : _ref$canPreview,
955
954
  _ref$disabled = _ref.disabled,
956
955
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
957
956
  uniqueKey = _ref.uniqueKey,
@@ -966,18 +965,10 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
966
965
  _useState2 = _slicedToArray(_useState, 2),
967
966
  uploading = _useState2[0],
968
967
  setUploading = _useState2[1];
969
- var _useState3 = React.useState(false),
968
+ var _useState3 = React.useState(true),
970
969
  _useState4 = _slicedToArray(_useState3, 2),
971
- visible = _useState4[0],
972
- setVisible = _useState4[1];
973
- var _useState5 = React.useState(''),
974
- _useState6 = _slicedToArray(_useState5, 2),
975
- currentPreviewImg = _useState6[0],
976
- setCurrentPreviewImg = _useState6[1];
977
- var _useState7 = React.useState(true),
978
- _useState8 = _slicedToArray(_useState7, 2),
979
- pasteDefaultStates = _useState8[0],
980
- setPasteDefaultStates = _useState8[1];
970
+ pasteDefaultStates = _useState4[0],
971
+ setPasteDefaultStates = _useState4[1];
981
972
  React.useEffect(function () {
982
973
  valueRef.current = value;
983
974
  }, [value]);
@@ -1108,39 +1099,25 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1108
1099
  }));
1109
1100
  };
1110
1101
  };
1111
- var handlePreview = function handlePreview(imgUrl) {
1112
- return function () {
1113
- setCurrentPreviewImg(imgUrl);
1114
- setVisible(true);
1115
- };
1116
- };
1117
1102
  var renderImages = function renderImages(images) {
1118
- return images.map(function (image, index) {
1103
+ return /*#__PURE__*/React__default['default'].createElement(antd.Image.PreviewGroup, null, images.map(function (image, index) {
1119
1104
  var finalImage = "".concat(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image, "?x-oss-process=image/resize,h_60,w_60");
1105
+ var showImage = /^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image;
1120
1106
  return /*#__PURE__*/React__default['default'].createElement("div", {
1121
1107
  className: styles$1.imageWrap,
1122
1108
  key: index
1123
- }, /*#__PURE__*/React__default['default'].createElement("div", {
1124
- className: styles$1.mask
1125
- }, /*#__PURE__*/React__default['default'].createElement("img", {
1126
- src: finalImage
1127
- }), /*#__PURE__*/React__default['default'].createElement("div", {
1128
- className: styles$1.actions
1129
- }, canPreview && /*#__PURE__*/React__default['default'].createElement(icons.EyeOutlined, {
1130
- style: {
1131
- fontSize: '16px',
1132
- color: '#FFF',
1133
- marginRight: '8px'
1134
- },
1135
- onClick: handlePreview(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image)
1136
- }), /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, {
1137
- style: {
1138
- fontSize: '16px',
1139
- color: '#FFF'
1109
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Image, {
1110
+ src: finalImage,
1111
+ preview: {
1112
+ src: showImage
1140
1113
  },
1114
+ width: '100%',
1115
+ height: '80%'
1116
+ }), /*#__PURE__*/React__default['default'].createElement("div", {
1117
+ className: styles$1.deleteIcon,
1141
1118
  onClick: handleDelete(index)
1142
- }))));
1143
- });
1119
+ }, "\u5220\u9664"));
1120
+ }));
1144
1121
  };
1145
1122
  React.useEffect(function () {
1146
1123
  var _inputRef$current2;
@@ -1199,21 +1176,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1199
1176
  beforeUpload: beforeUpload
1200
1177
  }, resetProps), value.length >= maxCount ? null : /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("span", {
1201
1178
  className: "addBtn"
1202
- }, "+"), /*#__PURE__*/React__default['default'].createElement("div", null, uploadText))), /*#__PURE__*/React__default['default'].createElement(antd.Image, {
1203
- width: 0,
1204
- style: {
1205
- display: visible ? '' : 'none'
1206
- },
1207
- src: currentPreviewImg,
1208
- preview: {
1209
- visible: visible,
1210
- src: "".concat(currentPreviewImg),
1211
- onVisibleChange: function onVisibleChange(value) {
1212
- setCurrentPreviewImg('');
1213
- setVisible(value);
1214
- }
1215
- }
1216
- })));
1179
+ }, "+"), /*#__PURE__*/React__default['default'].createElement("div", null, uploadText)))));
1217
1180
  };
1218
1181
  var index = /*#__PURE__*/React.forwardRef(ApaasUploadAsync);
1219
1182
 
@@ -10996,7 +10959,7 @@ var jstGoods = function jstGoods(props) {
10996
10959
  _useState2 = _slicedToArray(_useState, 2),
10997
10960
  changeIndex = _useState2[0],
10998
10961
  setChangeIndex = _useState2[1]; //选中的包裹
10999
- var wdtSendOptions = kmkfUtils.WdtSendData.getInstance().wdtSendData || [];
10962
+ var sendOptions = kmkfUtils.SendDataCenter.getInstance(platformType).getSendData();
11000
10963
  React.useEffect(function () {
11001
10964
  //没有值塞个默认值
11002
10965
  if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
@@ -11027,7 +10990,7 @@ var jstGoods = function jstGoods(props) {
11027
10990
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11028
10991
  changeOrderInfo[type] = val;
11029
10992
  changeOrderInfo['sendId'] = option.value;
11030
- if (platformType === 'wdt' && type === 'sendName') {
10993
+ if ((platformType === 'wdt' || platformType === 'bsE3') && type === 'sendName') {
11031
10994
  changeOrderInfo['sendSnapshotName'] = option.label;
11032
10995
  }
11033
10996
  var newList = _toConsumableArray(value);
@@ -11110,7 +11073,7 @@ var jstGoods = function jstGoods(props) {
11110
11073
  return changeInputHandle(e.target.value, 'sendId');
11111
11074
  },
11112
11075
  value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
11113
- }), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
11076
+ }), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' || platformType === 'bsE3' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
11114
11077
  style: {
11115
11078
  minWidth: '100px',
11116
11079
  maxWidth: '180px'
@@ -11118,7 +11081,7 @@ var jstGoods = function jstGoods(props) {
11118
11081
  disabled: disabled,
11119
11082
  placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
11120
11083
  showSearch: true,
11121
- options: wdtSendOptions,
11084
+ options: sendOptions,
11122
11085
  filterOption: filterOption,
11123
11086
  value: ((_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName) || null,
11124
11087
  onChange: function onChange(value, option) {
@@ -11697,9 +11660,11 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
11697
11660
  var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
11698
11661
 
11699
11662
  var getTableData = function getTableData(_ref, formData) {
11663
+ var _formData$brandIds;
11700
11664
  var current = _ref.current,
11701
11665
  pageSize = _ref.pageSize;
11702
11666
  var data = {
11667
+ brandIds: ((_formData$brandIds = formData.brandIds) === null || _formData$brandIds === void 0 ? void 0 : _formData$brandIds.length) ? formData.brandIds : null,
11703
11668
  skuCode: formData.skuCode || null,
11704
11669
  skuName: formData.skuName || null,
11705
11670
  goodName: formData.goodName || null,
@@ -11784,6 +11749,11 @@ var columns$1 = [{
11784
11749
  title: '商品ID',
11785
11750
  width: 200,
11786
11751
  ellipsis: true
11752
+ }, {
11753
+ dataIndex: 'brandName',
11754
+ title: '品牌名称',
11755
+ width: 200,
11756
+ ellipsis: true
11787
11757
  }, {
11788
11758
  dataIndex: 'marketPrice',
11789
11759
  title: '市场价',
@@ -11815,6 +11785,10 @@ var GoodList = function GoodList(props, ref) {
11815
11785
  _useState4 = _slicedToArray(_useState3, 2),
11816
11786
  selectIds = _useState4[0],
11817
11787
  setSelectIds = _useState4[1];
11788
+ var _useState5 = React.useState([]),
11789
+ _useState6 = _slicedToArray(_useState5, 2),
11790
+ brandList = _useState6[0],
11791
+ setBrandList = _useState6[1];
11818
11792
  React.useImperativeHandle(ref, function () {
11819
11793
  return {
11820
11794
  getSelectGoodList: function getSelectGoodList() {
@@ -11834,6 +11808,38 @@ var GoodList = function GoodList(props, ref) {
11834
11808
  params = _useAntdTable.params;
11835
11809
  var submit = search.submit,
11836
11810
  reset = search.reset;
11811
+ var setGoodBrandList = function setGoodBrandList() {
11812
+ var list = [];
11813
+ var pageNo = 0;
11814
+ var pageSize = 100;
11815
+ var getMore = function getMore() {
11816
+ extendRequest('/qy/gdfw/wdt/erp/goodBrand/list', {
11817
+ method: 'post',
11818
+ data: {
11819
+ pageSize: pageSize,
11820
+ pageNo: pageNo
11821
+ }
11822
+ }).then(function (res) {
11823
+ var _res$data2;
11824
+ if (res.success && (res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.detailList)) {
11825
+ var _res$data3, _res$data4;
11826
+ 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) || []));
11827
+ if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.detailList.length) === pageSize) {
11828
+ pageNo += 1;
11829
+ getMore();
11830
+ } else {
11831
+ setBrandList(list);
11832
+ }
11833
+ } else {
11834
+ lodash.reject(res);
11835
+ }
11836
+ }).catch(console.error);
11837
+ };
11838
+ getMore();
11839
+ };
11840
+ React__default['default'].useEffect(function () {
11841
+ setGoodBrandList();
11842
+ }, []);
11837
11843
  var advanceSearchForm = /*#__PURE__*/React__default['default'].createElement(antd.Form, {
11838
11844
  layout: "inline",
11839
11845
  form: form
@@ -11881,6 +11887,32 @@ var GoodList = function GoodList(props, ref) {
11881
11887
  style: {
11882
11888
  width: 150
11883
11889
  }
11890
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
11891
+ name: "brandIds",
11892
+ style: {
11893
+ marginBottom: '12px'
11894
+ }
11895
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
11896
+ mode: "multiple",
11897
+ showSearch: true,
11898
+ allowClear: true,
11899
+ filterOption: function filterOption(input, option) {
11900
+ return option.label.includes(input);
11901
+ },
11902
+ style: {
11903
+ width: 150
11904
+ },
11905
+ placeholder: "\u54C1\u724C",
11906
+ options: brandList.filter(function (item) {
11907
+ return !item.isDisabled;
11908
+ }).map(function (_ref2) {
11909
+ var value = _ref2.brandId,
11910
+ label = _ref2.brandName;
11911
+ return {
11912
+ value: value,
11913
+ label: label
11914
+ };
11915
+ })
11884
11916
  })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
11885
11917
  style: {
11886
11918
  marginBottom: '12px'
@@ -12037,107 +12069,664 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
12037
12069
  };
12038
12070
  var WdtGoodsModal = /*#__PURE__*/React.forwardRef(GoodsModal$3);
12039
12071
 
12040
- // interface GoodsItem {
12041
- // title: string;
12042
- // pic: string;
12043
- // platform: string;
12044
- // skuId: string;
12045
- // styleId: string;
12046
- // }
12047
- var GoodItem$1 = function GoodItem(props) {
12048
- var _props$value = props.value,
12049
- value = _props$value === void 0 ? [] : _props$value,
12050
- type = props.type,
12051
- onChange = props.onChange,
12052
- disabled = props.disabled,
12053
- _props$showHeader = props.showHeader,
12054
- showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
12055
- width = props.width,
12056
- _props$shopList = props.shopList,
12057
- shopList = _props$shopList === void 0 ? [] : _props$shopList,
12058
- _props$shopId = props.shopId,
12059
- shopId = _props$shopId === void 0 ? '' : _props$shopId,
12060
- _props$maxLength = props.maxLength,
12061
- maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
12062
- _props$showChangeBtn = props.showChangeBtn,
12063
- showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
12064
- _props$tableSelect = props.tableSelect,
12065
- tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
12066
- _props$selectType = props.selectType,
12067
- selectType = _props$selectType === void 0 ? '' : _props$selectType,
12068
- _props$otherOperation = props.otherOperations,
12069
- otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
12070
- _props$canUpdateNumbe = props.canUpdateNumber,
12071
- canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
12072
- shopCode = props.shopCode,
12073
- _props$companyKey = props.companyKey,
12074
- companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
12075
- onSelect = props.onSelect,
12076
- onDelete = props.onDelete;
12077
- var refModal = React.useRef();
12078
- var handleDelete = function handleDelete(record, index) {
12079
- onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
12080
- var newList = _toConsumableArray(value).filter(function (item, i) {
12081
- return index !== i;
12082
- });
12083
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
12072
+ var getTableData$1 = function getTableData(_ref, formData) {
12073
+ var current = _ref.current,
12074
+ pageSize = _ref.pageSize;
12075
+ var data = {
12076
+ goodNo: formData.goodNo || null,
12077
+ goodName: formData.goodName || null,
12078
+ skuCode: formData.skuCode || null,
12079
+ skuId: formData.skuId || null
12084
12080
  };
12081
+ return extendRequest('/qy/gdfw/product/product/page', {
12082
+ method: 'post',
12083
+ data: _objectSpread2({
12084
+ pageSize: pageSize,
12085
+ pageNo: current,
12086
+ platform: 'BS_E3_ERP'
12087
+ }, data)
12088
+ }).then(function (res) {
12089
+ var _res$data = res.data,
12090
+ _res$data$productSkuL = _res$data.productSkuList,
12091
+ productSkuList = _res$data$productSkuL === void 0 ? [] : _res$data$productSkuL,
12092
+ _res$data$total = _res$data.total,
12093
+ total = _res$data$total === void 0 ? 0 : _res$data$total;
12094
+ var newProducts = productSkuList.map(function (item, index) {
12095
+ return _objectSpread2(_objectSpread2({}, item), {}, {
12096
+ index: index + 1
12097
+ });
12098
+ });
12099
+ return {
12100
+ total: total,
12101
+ list: newProducts
12102
+ };
12103
+ });
12104
+ };
12105
+ var columns$2 = [{
12106
+ dataIndex: 'index',
12107
+ title: 'NO',
12108
+ render: function render(val, record, index) {
12109
+ return /*#__PURE__*/React__default['default'].createElement("div", {
12110
+ style: {
12111
+ width: 25
12112
+ }
12113
+ }, index + 1);
12114
+ },
12115
+ width: 80
12116
+ }, {
12117
+ dataIndex: 'specNo',
12118
+ title: "SKU",
12119
+ ellipsis: true,
12120
+ width: 200
12121
+ }, {
12122
+ dataIndex: 'specId',
12123
+ title: "SKU ID",
12124
+ ellipsis: true,
12125
+ width: 80
12126
+ }, {
12127
+ dataIndex: 'goodName',
12128
+ title: "\u5546\u54C1\u540D\u79F0",
12129
+ ellipsis: true,
12130
+ width: 250
12131
+ }, {
12132
+ dataIndex: 'goodShortName',
12133
+ title: "\u5546\u54C1\u7B80\u79F0",
12134
+ ellipsis: true,
12135
+ width: 250
12136
+ },
12137
+ // {
12138
+ // dataIndex: 'goodPicUrl',
12139
+ // title: `商品图片`,
12140
+ // ellipsis: true,
12141
+ // width: 100,
12142
+ // render: (picUrl: string) => {
12143
+ // return (
12144
+ // <img
12145
+ // style={{
12146
+ // width: '40px',
12147
+ // height: '40px',
12148
+ // objectFit: 'contain',
12149
+ // }}
12150
+ // src={picUrl}
12151
+ // ></img>
12152
+ // );
12153
+ // },
12154
+ // },
12155
+ {
12156
+ dataIndex: 'goodNo',
12157
+ title: "\u8D27\u53F7",
12158
+ ellipsis: true,
12159
+ width: 150
12160
+ }, {
12161
+ dataIndex: 'goodId',
12162
+ title: "\u8D27\u53F7ID",
12163
+ ellipsis: true,
12164
+ width: 100
12165
+ }, {
12166
+ dataIndex: 'colorName',
12167
+ title: "\u989C\u8272\u540D\u79F0",
12168
+ ellipsis: true,
12169
+ width: 100
12170
+ }, {
12171
+ dataIndex: 'colorCode',
12172
+ title: "\u989C\u8272\u4EE3\u7801",
12173
+ ellipsis: true,
12174
+ width: 100
12175
+ }, {
12176
+ dataIndex: 'sizeName',
12177
+ title: "\u5C3A\u7801\u540D\u79F0",
12178
+ ellipsis: true,
12179
+ width: 100
12180
+ }, {
12181
+ dataIndex: 'sizeCode',
12182
+ title: "\u5C3A\u7801\u4EE3\u7801",
12183
+ ellipsis: true,
12184
+ width: 100
12185
+ }, {
12186
+ dataIndex: 'brandName',
12187
+ title: "\u54C1\u724C\u540D\u79F0",
12188
+ ellipsis: true,
12189
+ width: 100
12190
+ }, {
12191
+ dataIndex: 'marketPrice',
12192
+ title: "\u5E02\u573A\u4EF7",
12193
+ ellipsis: true,
12194
+ width: 100
12195
+ }, {
12196
+ dataIndex: 'retailPrice',
12197
+ title: "\u552E\u4EF7",
12198
+ ellipsis: true,
12199
+ width: 100
12200
+ }];
12201
+ var GoodList$1 = function GoodList(props, ref) {
12085
12202
  var _useState = React.useState([]),
12086
12203
  _useState2 = _slicedToArray(_useState, 2),
12087
- selectedRowKeys = _useState2[0],
12088
- setSelectedRowKeys = _useState2[1];
12089
- React.useEffect(function () {
12090
- setSelectedRowKeys([]);
12091
- }, [tableSelect, selectType]);
12092
- var updateHandle = function updateHandle(val, index, columnType) {
12093
- if (value === null || value === void 0 ? void 0 : value.length) {
12094
- value[index][columnType] = val;
12095
- if (type === 'WDT_RETURN_GOODS') {
12096
- if (['sharePrice', 'num'].includes(columnType)) {
12097
- var totalMoney = null;
12098
- if (columnType === 'num') {
12099
- totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].sharePrice));
12100
- } else {
12101
- totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
12102
- }
12103
- if (totalMoney !== null) {
12104
- value[index]['returnPrice'] = totalMoney.toString();
12105
- }
12106
- }
12107
- } else if (type === 'WDT_EXCHANGE_GOODS') {
12108
- if (['price', 'num'].includes(columnType)) {
12109
- var _totalMoney = null;
12110
- if (columnType === 'num') {
12111
- _totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].price));
12112
- } else {
12113
- _totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
12114
- }
12115
- if (_totalMoney !== null) {
12116
- value[index]['exchangePrice'] = _totalMoney.toString();
12117
- }
12118
- }
12204
+ selectList = _useState2[0],
12205
+ setSelect = _useState2[1];
12206
+ var _useState3 = React.useState([]),
12207
+ _useState4 = _slicedToArray(_useState3, 2),
12208
+ selectIds = _useState4[0],
12209
+ setSelectIds = _useState4[1];
12210
+ React.useImperativeHandle(ref, function () {
12211
+ return {
12212
+ getSelectGoodList: function getSelectGoodList() {
12213
+ return selectList;
12119
12214
  }
12120
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
12215
+ };
12216
+ });
12217
+ var _Form$useForm = antd.Form.useForm(),
12218
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
12219
+ form = _Form$useForm2[0];
12220
+ var _useAntdTable = ahooks.useAntdTable(getTableData$1, {
12221
+ defaultPageSize: 10,
12222
+ form: form
12223
+ }),
12224
+ tableProps = _useAntdTable.tableProps,
12225
+ search = _useAntdTable.search,
12226
+ params = _useAntdTable.params;
12227
+ var submit = search.submit,
12228
+ reset = search.reset;
12229
+ var advanceSearchForm = /*#__PURE__*/React__default['default'].createElement(antd.Form, {
12230
+ layout: "inline",
12231
+ form: form
12232
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12233
+ name: "goodNo",
12234
+ style: {
12235
+ marginBottom: '12px'
12121
12236
  }
12122
- };
12123
- var COLUMNS_MAP = function COLUMNS_MAP() {
12124
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12125
- return function (type) {
12126
- var columns = [];
12127
- switch (type) {
12128
- case 'WDT_REISSUE_GOODS':
12129
- case 'WDT_GOODS':
12130
- columns = [{
12131
- dataIndex: 'goodId',
12132
- title: "\u5546\u54C1ID",
12133
- align: 'center',
12134
- ellipsis: true,
12135
- width: 70
12136
- }, {
12137
- dataIndex: 'goodNo',
12138
- title: "\u5546\u54C1\u7F16\u7801",
12139
- align: 'center',
12140
- ellipsis: true,
12237
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12238
+ placeholder: "\u5546\u54C1\u8D27\u53F7",
12239
+ allowClear: true,
12240
+ style: {
12241
+ width: 150
12242
+ }
12243
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12244
+ name: "goodName",
12245
+ style: {
12246
+ marginBottom: '12px'
12247
+ }
12248
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12249
+ placeholder: "\u5546\u54C1\u540D\u79F0",
12250
+ allowClear: true,
12251
+ style: {
12252
+ width: 150
12253
+ }
12254
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12255
+ name: "skuCode",
12256
+ style: {
12257
+ marginBottom: '12px'
12258
+ }
12259
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12260
+ placeholder: "SKU",
12261
+ allowClear: true,
12262
+ style: {
12263
+ width: 150
12264
+ }
12265
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12266
+ name: "skuId",
12267
+ style: {
12268
+ marginBottom: '12px'
12269
+ }
12270
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
12271
+ placeholder: "SKU ID",
12272
+ allowClear: true,
12273
+ style: {
12274
+ width: 150
12275
+ }
12276
+ })), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
12277
+ style: {
12278
+ marginBottom: '12px'
12279
+ }
12280
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12281
+ type: "primary",
12282
+ style: {
12283
+ marginRight: '8px'
12284
+ },
12285
+ onClick: submit
12286
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12287
+ onClick: reset
12288
+ }, "\u91CD\u7F6E")));
12289
+ var rowSelection = {
12290
+ selectedRowKeys: selectIds,
12291
+ fixed: true,
12292
+ onSelect: function onSelect(record, selected) {
12293
+ if (selected) {
12294
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.specNo]));
12295
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
12296
+ } else {
12297
+ setSelectIds(selectIds.filter(function (t) {
12298
+ return t !== record.specNo;
12299
+ }));
12300
+ setSelect(selectList.filter(function (t) {
12301
+ return t.specNo !== record.specNo;
12302
+ }));
12303
+ }
12304
+ },
12305
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
12306
+ if (selected) {
12307
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
12308
+ return t.specNo;
12309
+ }))));
12310
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
12311
+ } else {
12312
+ setSelectIds(lodash.difference(selectIds, changeRows.map(function (t) {
12313
+ return t.specNo;
12314
+ })));
12315
+ var list = lodash.differenceWith(selectList, changeRows, function (arrVal, othVal) {
12316
+ return arrVal.specNo !== othVal.specNo;
12317
+ });
12318
+ setSelect(list);
12319
+ }
12320
+ }
12321
+ };
12322
+ var showTable = function showTable() {
12323
+ var handleDelete = function handleDelete(record) {
12324
+ setSelectIds(selectIds.filter(function (t) {
12325
+ return t !== record.specNo;
12326
+ }));
12327
+ setSelect(selectList.filter(function (t) {
12328
+ return t.specNo !== record.specNo;
12329
+ }));
12330
+ };
12331
+ var showColumns = [{
12332
+ dataIndex: '',
12333
+ title: "\u64CD\u4F5C",
12334
+ ellipsis: true,
12335
+ width: 100,
12336
+ render: function render(val, record) {
12337
+ return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12338
+ type: "link",
12339
+ onClick: function onClick() {
12340
+ return handleDelete(record);
12341
+ }
12342
+ }, "\u5220\u9664");
12343
+ }
12344
+ }].concat(lodash.takeRight(columns$2, columns$2.length - 1));
12345
+ return selectList.length ? /*#__PURE__*/React__default['default'].createElement("div", {
12346
+ style: {
12347
+ width: '100%',
12348
+ maxWidth: '387px'
12349
+ }
12350
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
12351
+ columns: showColumns,
12352
+ rowKey: 'specNo',
12353
+ dataSource: selectList,
12354
+ scroll: {
12355
+ x: '100%',
12356
+ y: 250
12357
+ },
12358
+ pagination: {
12359
+ size: 'small',
12360
+ total: selectIds.length,
12361
+ pageSize: 10,
12362
+ showSizeChanger: false
12363
+ }
12364
+ })) : null;
12365
+ };
12366
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, advanceSearchForm, /*#__PURE__*/React__default['default'].createElement("div", {
12367
+ style: {
12368
+ marginTop: '4px'
12369
+ }
12370
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2({
12371
+ rowSelection: rowSelection,
12372
+ rowKey: "specNo",
12373
+ columns: columns$2,
12374
+ scroll: {
12375
+ x: '100%',
12376
+ y: 250
12377
+ }
12378
+ }, tableProps))), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
12379
+ getPopupContainer: function getPopupContainer(triggerNode) {
12380
+ return triggerNode.parentElement;
12381
+ },
12382
+ content: showTable(),
12383
+ title: "\u5DF2\u9009\u62E9".concat(selectList.length, "\u4E2A\u5546\u54C1")
12384
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12385
+ danger: true,
12386
+ type: "text"
12387
+ }, "\u5DF2\u9009".concat(selectList.length > 99 ? '99+' : selectList.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(icons.CaretUpOutlined, null))));
12388
+ };
12389
+ var BsE3GoodList = /*#__PURE__*/React.forwardRef(GoodList$1);
12390
+
12391
+ var GoodsModal$4 = function GoodsModal(props, ref) {
12392
+ React.useImperativeHandle(ref, function () {
12393
+ return {
12394
+ open: function open() {
12395
+ setVisible(true);
12396
+ }
12397
+ };
12398
+ });
12399
+ var onSubmit = props.onSubmit,
12400
+ width = props.width;
12401
+ var _useState = React.useState(false),
12402
+ _useState2 = _slicedToArray(_useState, 2),
12403
+ visible = _useState2[0],
12404
+ setVisible = _useState2[1];
12405
+ var bsE3GoodListRef = React.useRef(null);
12406
+ var _onCancel = function onCancel() {
12407
+ setVisible(false);
12408
+ };
12409
+ var onOk = function onOk() {
12410
+ var _bsE3GoodListRef$curr;
12411
+ var selectedList = ((_bsE3GoodListRef$curr = bsE3GoodListRef.current) === null || _bsE3GoodListRef$curr === void 0 ? void 0 : _bsE3GoodListRef$curr.getSelectGoodList()) || [];
12412
+ onSubmit(selectedList);
12413
+ _onCancel();
12414
+ };
12415
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
12416
+ title: '选择商品',
12417
+ okText: '确认',
12418
+ cancelText: '取消',
12419
+ visible: visible,
12420
+ width: width || 850,
12421
+ onCancel: function onCancel() {
12422
+ _onCancel();
12423
+ },
12424
+ onOk: onOk,
12425
+ wrapClassName: "goodModal"
12426
+ }, /*#__PURE__*/React__default['default'].createElement(BsE3GoodList, {
12427
+ ref: bsE3GoodListRef
12428
+ })));
12429
+ };
12430
+ var BsE3GoodsModal = /*#__PURE__*/React.forwardRef(GoodsModal$4);
12431
+
12432
+ var columns$3 = [{
12433
+ dataIndex: 'sku',
12434
+ title: "SKU",
12435
+ width: 150
12436
+ }, {
12437
+ dataIndex: 'skuId',
12438
+ title: "SKU ID",
12439
+ width: 150
12440
+ }, {
12441
+ dataIndex: 'goodsName',
12442
+ title: "\u5546\u54C1\u540D\u79F0",
12443
+ width: 150
12444
+ }, {
12445
+ dataIndex: 'goodsShortName',
12446
+ title: "\u5546\u54C1\u7B80\u79F0",
12447
+ width: 150
12448
+ }, {
12449
+ dataIndex: 'picPath',
12450
+ title: "\u5546\u54C1\u56FE\u7247",
12451
+ width: 150
12452
+ }, {
12453
+ dataIndex: 'goodsSn',
12454
+ title: "\u8D27\u53F7",
12455
+ width: 150
12456
+ }, {
12457
+ dataIndex: 'goodsId',
12458
+ title: "\u8D27\u53F7ID",
12459
+ width: 150
12460
+ }, {
12461
+ dataIndex: 'colorName',
12462
+ title: "\u989C\u8272\u540D\u79F0",
12463
+ width: 150
12464
+ }, {
12465
+ dataIndex: 'colorCode',
12466
+ title: "\u989C\u8272\u4EE3\u7801",
12467
+ width: 150
12468
+ }, {
12469
+ dataIndex: 'sizeName',
12470
+ title: "\u5C3A\u7801\u540D\u79F0",
12471
+ width: 150
12472
+ }, {
12473
+ dataIndex: 'sizeCode',
12474
+ title: "\u5C3A\u7801\u4EE3\u7801",
12475
+ width: 150
12476
+ }, {
12477
+ dataIndex: 'brandName',
12478
+ title: "\u54C1\u724C\u540D\u79F0",
12479
+ width: 150
12480
+ }, {
12481
+ dataIndex: 'goodsNumber',
12482
+ title: "\u5546\u54C1\u6570\u91CF",
12483
+ width: 150
12484
+ }, {
12485
+ dataIndex: 'goodsPrice',
12486
+ title: "\u5546\u54C1\u5355\u4EF7",
12487
+ width: 150
12488
+ }, {
12489
+ dataIndex: 'shopPrice',
12490
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12491
+ width: 150
12492
+ }, {
12493
+ dataIndex: 'isGift',
12494
+ title: "\u662F\u5426\u8D60\u54C1",
12495
+ width: 150,
12496
+ render: function render(val) {
12497
+ return /*#__PURE__*/React__default['default'].createElement("span", null, +val ? '是' : '否');
12498
+ }
12499
+ }];
12500
+ var renderFieldMap = {
12501
+ goodsNumber: function goodsNumber(_ref) {
12502
+ var disabled = _ref.disabled,
12503
+ updateHandle = _ref.updateHandle;
12504
+ return function (val, record, index) {
12505
+ return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
12506
+ style: {
12507
+ width: 70
12508
+ },
12509
+ value: val,
12510
+ min: 1,
12511
+ precision: 0,
12512
+ onChange: function onChange(num) {
12513
+ return updateHandle(num, index, 'goodsNumber');
12514
+ }
12515
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
12516
+ };
12517
+ },
12518
+ goodsPrice: function goodsPrice(_ref2) {
12519
+ var disabled = _ref2.disabled,
12520
+ updateHandle = _ref2.updateHandle;
12521
+ return function (val, record, index) {
12522
+ return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
12523
+ style: {
12524
+ width: 70
12525
+ },
12526
+ value: val,
12527
+ min: 0,
12528
+ onChange: function onChange(value) {
12529
+ return updateHandle(value, index, 'goodsPrice');
12530
+ }
12531
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
12532
+ };
12533
+ },
12534
+ isGift: function isGift(_ref3) {
12535
+ var disabled = _ref3.disabled,
12536
+ updateHandle = _ref3.updateHandle;
12537
+ return function (val, record, index) {
12538
+ var options = [{
12539
+ label: '是',
12540
+ value: 1
12541
+ }, {
12542
+ label: '否',
12543
+ value: 0
12544
+ }];
12545
+ return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
12546
+ style: {
12547
+ width: 70
12548
+ },
12549
+ options: options,
12550
+ value: val,
12551
+ onChange: function onChange(value) {
12552
+ return updateHandle(value, index, 'isGift');
12553
+ },
12554
+ getPopupContainer: function getPopupContainer() {
12555
+ return document.getElementById('bsE3ReissueGoods');
12556
+ }
12557
+ }) : /*#__PURE__*/React__default['default'].createElement("span", null, +val ? '是' : '否');
12558
+ };
12559
+ }
12560
+ };
12561
+ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
12562
+ var disabled = _ref4.disabled,
12563
+ updateHandle = _ref4.updateHandle,
12564
+ operate = _ref4.operate;
12565
+ return columns$3.map(function (item) {
12566
+ var newItem = _objectSpread2({
12567
+ align: 'center',
12568
+ ellipsis: true
12569
+ }, item);
12570
+ if (operate && (renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex])) {
12571
+ return _objectSpread2(_objectSpread2({}, newItem), {}, {
12572
+ render: renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex]({
12573
+ disabled: disabled,
12574
+ updateHandle: updateHandle
12575
+ })
12576
+ });
12577
+ }
12578
+ return newItem;
12579
+ });
12580
+ };
12581
+
12582
+ var SelectTradeGoods = function SelectTradeGoods(_ref) {
12583
+ var columns = _ref.columns,
12584
+ dataSource = _ref.dataSource,
12585
+ selectedRowKeys = _ref.selectedRowKeys,
12586
+ onChangeSelectedKeys = _ref.onChangeSelectedKeys;
12587
+ var _useState = React.useState(false),
12588
+ _useState2 = _slicedToArray(_useState, 2),
12589
+ tradeGoodsVisible = _useState2[0],
12590
+ setTradeGoodsVisible = _useState2[1];
12591
+ var openModal = function openModal() {
12592
+ return setTradeGoodsVisible(true);
12593
+ };
12594
+ var closeModal = function closeModal() {
12595
+ return setTradeGoodsVisible(false);
12596
+ };
12597
+ var rowSelection = {
12598
+ selectedRowKeys: selectedRowKeys,
12599
+ onChange: onChangeSelectedKeys
12600
+ };
12601
+ console.debug('选择订单商品-dataSource', dataSource, selectedRowKeys);
12602
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12603
+ type: "link",
12604
+ onClick: openModal
12605
+ }, "\u9009\u62E9\u8BA2\u5355\u5546\u54C1"), /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
12606
+ title: "\u8BA2\u5355\u5546\u54C1",
12607
+ visible: tradeGoodsVisible,
12608
+ footer: null,
12609
+ onCancel: closeModal
12610
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
12611
+ rowKey: "sku",
12612
+ rowSelection: rowSelection,
12613
+ columns: columns,
12614
+ dataSource: dataSource,
12615
+ pagination: false,
12616
+ scroll: {
12617
+ x: 500,
12618
+ y: 500
12619
+ }
12620
+ }), /*#__PURE__*/React__default['default'].createElement("span", null, "\u5DF2\u9009\u62E9(", selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length, "/", dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, ")")));
12621
+ };
12622
+ var GoodItem$1 = function GoodItem(props) {
12623
+ var _props$value = props.value,
12624
+ value = _props$value === void 0 ? [] : _props$value,
12625
+ type = props.type,
12626
+ onChange = props.onChange,
12627
+ disabled = props.disabled,
12628
+ _props$showHeader = props.showHeader,
12629
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
12630
+ width = props.width,
12631
+ _props$shopList = props.shopList,
12632
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
12633
+ _props$shopId = props.shopId,
12634
+ shopId = _props$shopId === void 0 ? '' : _props$shopId,
12635
+ _props$maxLength = props.maxLength,
12636
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
12637
+ _props$showChangeBtn = props.showChangeBtn,
12638
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
12639
+ _props$showModeBtn = props.showModeBtn,
12640
+ showModeBtn = _props$showModeBtn === void 0 ? false : _props$showModeBtn,
12641
+ _props$isStrict = props.isStrict,
12642
+ isStrict = _props$isStrict === void 0 ? false : _props$isStrict,
12643
+ _props$tableSelect = props.tableSelect,
12644
+ tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
12645
+ _props$selectType = props.selectType,
12646
+ selectType = _props$selectType === void 0 ? '' : _props$selectType,
12647
+ _props$otherOperation = props.otherOperations,
12648
+ otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
12649
+ _props$canUpdateNumbe = props.canUpdateNumber,
12650
+ canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
12651
+ shopCode = props.shopCode,
12652
+ _props$companyKey = props.companyKey,
12653
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
12654
+ onSelect = props.onSelect,
12655
+ onDelete = props.onDelete,
12656
+ onModeChange = props.onModeChange,
12657
+ tradeGoods = props.tradeGoods;
12658
+ var refModal = React.useRef();
12659
+ console.debug('表格数据', value);
12660
+ var handleDelete = function handleDelete(record, index) {
12661
+ onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
12662
+ var newList = _toConsumableArray(value).filter(function (item, i) {
12663
+ return index !== i;
12664
+ });
12665
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
12666
+ };
12667
+ var _useState3 = React.useState([]),
12668
+ _useState4 = _slicedToArray(_useState3, 2),
12669
+ selectedRowKeys = _useState4[0],
12670
+ setSelectedRowKeys = _useState4[1];
12671
+ React.useEffect(function () {
12672
+ setSelectedRowKeys([]);
12673
+ }, [tableSelect, selectType]);
12674
+ // TODO: 商品订单中以选中商品
12675
+ var selectedGoods = React.useMemo(function () {
12676
+ return value === null || value === void 0 ? void 0 : value.map(function (v) {
12677
+ return v.sku;
12678
+ });
12679
+ }, [value]);
12680
+ var updateHandle = function updateHandle(val, index, columnType) {
12681
+ if (value === null || value === void 0 ? void 0 : value.length) {
12682
+ value[index][columnType] = val;
12683
+ if (type === 'WDT_RETURN_GOODS') {
12684
+ if (['sharePrice', 'num'].includes(columnType)) {
12685
+ var totalMoney = null;
12686
+ if (columnType === 'num') {
12687
+ totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].sharePrice));
12688
+ } else {
12689
+ totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
12690
+ }
12691
+ if (totalMoney !== null) {
12692
+ value[index]['returnPrice'] = totalMoney.toString();
12693
+ }
12694
+ }
12695
+ } else if (type === 'WDT_EXCHANGE_GOODS') {
12696
+ if (['price', 'num'].includes(columnType)) {
12697
+ var _totalMoney = null;
12698
+ if (columnType === 'num') {
12699
+ _totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].price));
12700
+ } else {
12701
+ _totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
12702
+ }
12703
+ if (_totalMoney !== null) {
12704
+ value[index]['exchangePrice'] = _totalMoney.toString();
12705
+ }
12706
+ }
12707
+ }
12708
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
12709
+ }
12710
+ };
12711
+ var COLUMNS_MAP = function COLUMNS_MAP() {
12712
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12713
+ var operate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12714
+ return function (type) {
12715
+ var columns = [];
12716
+ switch (type) {
12717
+ case 'WDT_REISSUE_GOODS':
12718
+ case 'WDT_GOODS':
12719
+ columns = [{
12720
+ dataIndex: 'goodId',
12721
+ title: "\u5546\u54C1ID",
12722
+ align: 'center',
12723
+ ellipsis: true,
12724
+ width: 70
12725
+ }, {
12726
+ dataIndex: 'goodNo',
12727
+ title: "\u5546\u54C1\u7F16\u7801",
12728
+ align: 'center',
12729
+ ellipsis: true,
12141
12730
  width: 180
12142
12731
  }, {
12143
12732
  dataIndex: 'goodName',
@@ -12476,6 +13065,161 @@ var GoodItem$1 = function GoodItem(props) {
12476
13065
  }];
12477
13066
  }
12478
13067
  break;
13068
+ case 'BS_E3_GOODS':
13069
+ {
13070
+ columns = [{
13071
+ dataIndex: 'sku',
13072
+ title: "SKU",
13073
+ align: 'center',
13074
+ ellipsis: true,
13075
+ width: 150
13076
+ }, {
13077
+ dataIndex: 'skuId',
13078
+ title: "SKU ID",
13079
+ align: 'center',
13080
+ ellipsis: true,
13081
+ width: 150
13082
+ }, {
13083
+ dataIndex: 'goodsName',
13084
+ title: "\u5546\u54C1\u540D\u79F0",
13085
+ align: 'center',
13086
+ ellipsis: true,
13087
+ width: 150
13088
+ }, {
13089
+ dataIndex: 'goodsShortName',
13090
+ title: "\u5546\u54C1\u7B80\u79F0",
13091
+ align: 'center',
13092
+ ellipsis: true,
13093
+ width: 100
13094
+ }, {
13095
+ dataIndex: 'picPath',
13096
+ title: "\u5546\u54C1\u56FE\u7247",
13097
+ align: 'center',
13098
+ ellipsis: true,
13099
+ width: 100,
13100
+ render: function render(val) {
13101
+ return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
13102
+ width: 60,
13103
+ src: val
13104
+ });
13105
+ }
13106
+ }, {
13107
+ dataIndex: 'goodsSn',
13108
+ title: "\u8D27\u53F7",
13109
+ align: 'center',
13110
+ ellipsis: true,
13111
+ width: 150
13112
+ }, {
13113
+ dataIndex: 'goodsId',
13114
+ title: "\u8D27\u53F7ID",
13115
+ align: 'center',
13116
+ ellipsis: true,
13117
+ width: 150
13118
+ }, {
13119
+ dataIndex: 'colorName',
13120
+ title: "\u989C\u8272\u540D\u79F0",
13121
+ align: 'center',
13122
+ ellipsis: true,
13123
+ width: 100
13124
+ }, {
13125
+ dataIndex: 'colorCode',
13126
+ title: "\u989C\u8272\u4EE3\u7801",
13127
+ align: 'center',
13128
+ ellipsis: true,
13129
+ width: 150
13130
+ }, {
13131
+ dataIndex: 'sizeName',
13132
+ title: "\u5C3A\u7801\u540D\u79F0",
13133
+ align: 'center',
13134
+ ellipsis: true,
13135
+ width: 100
13136
+ }, {
13137
+ dataIndex: 'sizeCode',
13138
+ title: "\u5C3A\u7801\u4EE3\u7801",
13139
+ align: 'center',
13140
+ ellipsis: true,
13141
+ width: 100
13142
+ }, {
13143
+ dataIndex: 'brandName',
13144
+ title: "\u54C1\u724C\u540D\u79F0",
13145
+ align: 'center',
13146
+ ellipsis: true,
13147
+ width: 150
13148
+ }, {
13149
+ dataIndex: 'goodsNumber',
13150
+ title: "\u5546\u54C1\u6570\u91CF",
13151
+ align: 'center',
13152
+ ellipsis: true,
13153
+ width: 100
13154
+ }, {
13155
+ dataIndex: 'goodsPrice',
13156
+ title: "\u5546\u54C1\u5355\u4EF7",
13157
+ align: 'center',
13158
+ ellipsis: true,
13159
+ width: 120
13160
+ }, {
13161
+ dataIndex: 'shopPrice',
13162
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
13163
+ align: 'center',
13164
+ ellipsis: true,
13165
+ width: 120
13166
+ }, {
13167
+ dataIndex: 'sharePrice',
13168
+ title: "\u5206\u644A\u4EF7",
13169
+ align: 'center',
13170
+ ellipsis: true,
13171
+ width: 120
13172
+ }, {
13173
+ dataIndex: 'sharePayment',
13174
+ title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
13175
+ align: 'center',
13176
+ ellipsis: true,
13177
+ width: 120
13178
+ }, {
13179
+ dataIndex: 'payment',
13180
+ title: "\u5B9E\u4ED8\u91D1\u989D",
13181
+ align: 'center',
13182
+ ellipsis: true,
13183
+ width: 120
13184
+ }, {
13185
+ dataIndex: 'tcSku',
13186
+ title: "\u5957\u9910SKU",
13187
+ align: 'center',
13188
+ ellipsis: true,
13189
+ width: 150
13190
+ }, {
13191
+ dataIndex: 'tcGoodsNumber',
13192
+ title: "\u5957\u9910\u5957\u6570",
13193
+ align: 'center',
13194
+ ellipsis: true,
13195
+ width: 100
13196
+ }, {
13197
+ dataIndex: 'taoCanSingleSl',
13198
+ title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
13199
+ align: 'center',
13200
+ ellipsis: true,
13201
+ width: 100
13202
+ }, {
13203
+ dataIndex: 'isGift',
13204
+ title: "\u662F\u5426\u8D60\u54C1",
13205
+ align: 'center',
13206
+ ellipsis: true,
13207
+ width: 100,
13208
+ render: function render(val) {
13209
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
13210
+ }
13211
+ }];
13212
+ }
13213
+ break;
13214
+ case 'BS_E3_REISSUE_GOODS':
13215
+ {
13216
+ columns = getBsE3ReissueGoodColumns({
13217
+ disabled: disabled,
13218
+ updateHandle: updateHandle,
13219
+ operate: operate
13220
+ });
13221
+ }
13222
+ break;
12479
13223
  default:
12480
13224
  columns = [{
12481
13225
  dataIndex: 'mark',
@@ -12615,6 +13359,19 @@ var GoodItem$1 = function GoodItem(props) {
12615
13359
  }
12616
13360
  return columnList;
12617
13361
  }, [showHeader, value, disabled]);
13362
+ var orderColumns = React.useMemo(function () {
13363
+ var columns = COLUMNS_MAP('', false)(type);
13364
+ return [{
13365
+ dataIndex: '',
13366
+ title: '序号',
13367
+ align: 'center',
13368
+ ellipsis: true,
13369
+ width: 50,
13370
+ render: function render(val, record, index) {
13371
+ return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
13372
+ }
13373
+ }].concat(_toConsumableArray(columns));
13374
+ }, []);
12618
13375
  var onSubmit = function onSubmit(list) {
12619
13376
  var newList = [];
12620
13377
  if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
@@ -12631,6 +13388,39 @@ var GoodItem$1 = function GoodItem(props) {
12631
13388
  }
12632
13389
  return item;
12633
13390
  });
13391
+ } else if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
13392
+ newList = list.map(function (item) {
13393
+ var specNo = item.specNo,
13394
+ specId = item.specId,
13395
+ goodName = item.goodName,
13396
+ goodShortName = item.goodShortName,
13397
+ goodPicUrl = item.goodPicUrl,
13398
+ goodNo = item.goodNo,
13399
+ goodId = item.goodId,
13400
+ retailPrice = item.retailPrice;
13401
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13402
+ sku: specNo,
13403
+ skuId: specId,
13404
+ goodsName: goodName,
13405
+ goodsShortName: goodShortName,
13406
+ picPath: goodPicUrl,
13407
+ goodsSn: goodNo,
13408
+ goodsId: goodId,
13409
+ goodsPrice: retailPrice,
13410
+ shopPrice: retailPrice,
13411
+ sharePayment: '',
13412
+ sharePrice: '',
13413
+ payment: '',
13414
+ tcSku: '',
13415
+ tcGoodsNumber: '',
13416
+ taoCanSingleSl: '',
13417
+ isGift: '',
13418
+ uuid: kmkfUtils.uuid(),
13419
+ canDelete: true,
13420
+ goodsNumber: 1,
13421
+ canUpdateNumber: canUpdateNumber
13422
+ });
13423
+ });
12634
13424
  } else {
12635
13425
  newList = list.map(function (item) {
12636
13426
  var goodsId = item.goodsId,
@@ -12673,6 +13463,9 @@ var GoodItem$1 = function GoodItem(props) {
12673
13463
  fixed: true,
12674
13464
  onChange: onSelectChange
12675
13465
  };
13466
+ var handleCheckboxChange = function handleCheckboxChange(e) {
13467
+ onModeChange === null || onModeChange === void 0 ? void 0 : onModeChange(e.target.checked);
13468
+ };
12676
13469
  var tableConfig = React.useMemo(function () {
12677
13470
  var params = {};
12678
13471
  if (tableSelect) {
@@ -12684,10 +13477,18 @@ var GoodItem$1 = function GoodItem(props) {
12684
13477
  style: {
12685
13478
  float: 'right'
12686
13479
  }
12687
- }, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
13480
+ }, showModeBtn && /*#__PURE__*/React__default['default'].createElement(antd.Checkbox, {
13481
+ checked: isStrict,
13482
+ onChange: handleCheckboxChange
13483
+ }, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !lodash.isEmpty(tradeGoods) && /*#__PURE__*/React__default['default'].createElement(SelectTradeGoods, {
13484
+ columns: orderColumns,
13485
+ dataSource: tradeGoods.originDataSource,
13486
+ selectedRowKeys: selectedGoods,
13487
+ onChangeSelectedKeys: tradeGoods.selectedGoodsChange
13488
+ }), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
12688
13489
  type: "link",
12689
13490
  onClick: handleChangeGoods
12690
- }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
13491
+ }, ['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type) ? '选择百胜ERP商品' : '选择商品'), otherOperations), /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
12691
13492
  columns: newColumns,
12692
13493
  dataSource: value,
12693
13494
  rowKey: 'uuid',
@@ -12707,6 +13508,14 @@ var GoodItem$1 = function GoodItem(props) {
12707
13508
  shopId: shopId,
12708
13509
  maxLength: maxLength,
12709
13510
  companyKey: companyKey
13511
+ }) : ['BS_E3_REISSUE_GOODS', 'BS_E3_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React__default['default'].createElement(BsE3GoodsModal, {
13512
+ ref: refModal,
13513
+ onSubmit: onSubmit,
13514
+ width: width,
13515
+ shopList: shopList,
13516
+ shopId: shopId,
13517
+ maxLength: maxLength,
13518
+ companyKey: companyKey
12710
13519
  }) : /*#__PURE__*/React__default['default'].createElement(GoodsModal$2, {
12711
13520
  ref: refModal,
12712
13521
  onSubmit: onSubmit,
@@ -13326,19 +14135,212 @@ var BsReturnGoods = function BsReturnGoods(props) {
13326
14135
  })));
13327
14136
  };
13328
14137
 
13329
- var columnsNameMap = {
13330
- BS_SYSTEM_ORDER: {
13331
- typeName: '单据类型',
13332
- tagName: '标签'
13333
- },
13334
- WLN_SYSTEM_ORDER: {
13335
- typeName: '订单类型',
13336
- tagName: '标记'
13337
- },
13338
- WDT_SYSTEM_ORDER: {
13339
- typeName: '订单类型',
13340
- tagName: '订单标签'
14138
+ var singletonMap = new Map();
14139
+ var getWdtOrderListSingleton = function getWdtOrderListSingleton(orderNo) {
14140
+ if (!singletonMap.has(orderNo)) {
14141
+ var p = new Promise(function (resolve, reject) {
14142
+ var doReject = function doReject(err) {
14143
+ // 清空掉错误的请求记录
14144
+ singletonMap.delete(orderNo);
14145
+ reject(err);
14146
+ };
14147
+ extendRequest('/qy/gdfw/order/wdtOrderDetail', {
14148
+ method: 'post',
14149
+ data: {
14150
+ billNo: orderNo
14151
+ }
14152
+ }).then(function (data) {
14153
+ if (data === null || data === void 0 ? void 0 : data.success) {
14154
+ var _data$data, _data$data$trades;
14155
+ 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) {
14156
+ data.data.trades = kmkfUtils.filterWdtOrders(data === null || data === void 0 ? void 0 : data.data, orderNo).map(function (item) {
14157
+ return _objectSpread2(_objectSpread2({}, item), {}, {
14158
+ billNo: item.tradeNo,
14159
+ billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
14160
+ billTag: item.tagName
14161
+ });
14162
+ });
14163
+ }
14164
+ resolve(data.data);
14165
+ // 延迟10秒清除,保证订单的时效性
14166
+ setTimeout(function () {
14167
+ singletonMap.delete(orderNo);
14168
+ }, 1000 * 10);
14169
+ } else {
14170
+ doReject(data);
14171
+ }
14172
+ }).catch(doReject);
14173
+ });
14174
+ singletonMap.set(orderNo, p);
14175
+ }
14176
+ return singletonMap.get(orderNo);
14177
+ };
14178
+ var wdtUtils = {
14179
+ getWdtOrderListSingleton: getWdtOrderListSingleton
14180
+ };
14181
+
14182
+ var singletonMap$1 = new Map();
14183
+ var getBsE3OrderListSingleton = function getBsE3OrderListSingleton(orderNo) {
14184
+ if (!singletonMap$1.has(orderNo)) {
14185
+ var p = new Promise(function (resolve, reject) {
14186
+ var doReject = function doReject(err) {
14187
+ // 清空掉错误的请求记录
14188
+ // singletonMap.delete(orderNo);
14189
+ reject(err);
14190
+ };
14191
+ extendRequest('/qy/gdfw/order/bse3OrderDetail', {
14192
+ method: 'post',
14193
+ data: {
14194
+ billNo: orderNo
14195
+ }
14196
+ }).then(function (data) {
14197
+ if (data === null || data === void 0 ? void 0 : data.success) {
14198
+ var _data$data, _data$data$orderList;
14199
+ 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) {
14200
+ data.data.orderList = kmkfUtils.filterBsE3Orders(data === null || data === void 0 ? void 0 : data.data, orderNo);
14201
+ }
14202
+ resolve(data.data);
14203
+ } else {
14204
+ doReject(data);
14205
+ }
14206
+ }).catch(doReject);
14207
+ });
14208
+ singletonMap$1.set(orderNo, p);
14209
+ }
14210
+ return singletonMap$1.get(orderNo);
14211
+ };
14212
+ var bsE3Utils = {
14213
+ getBsE3OrderListSingleton: getBsE3OrderListSingleton
14214
+ };
14215
+
14216
+ var columnsMap = {
14217
+ BS_SYSTEM_ORDER: [{
14218
+ title: '单据类型',
14219
+ dataIndex: 'billType',
14220
+ width: 150
14221
+ }, {
14222
+ title: '系统订单号',
14223
+ dataIndex: 'billNo',
14224
+ width: 150
14225
+ }, {
14226
+ title: '标签',
14227
+ dataIndex: 'billTag',
14228
+ width: 150
14229
+ }, {
14230
+ title: '主播名称',
14231
+ dataIndex: 'authorName',
14232
+ width: 150
14233
+ }, {
14234
+ title: '主播ID',
14235
+ dataIndex: 'authorId',
14236
+ width: 150
13341
14237
  }
14238
+ // {
14239
+ // title: '直播活动',
14240
+ // dataIndex: 'liveActivites',
14241
+ // width: 150,
14242
+ // },
14243
+ ],
14244
+
14245
+ WLN_SYSTEM_ORDER: [{
14246
+ title: '订单类型',
14247
+ dataIndex: 'billType',
14248
+ width: 150
14249
+ }, {
14250
+ title: '系统订单号',
14251
+ dataIndex: 'billNo',
14252
+ width: 150
14253
+ }, {
14254
+ title: '标记',
14255
+ dataIndex: 'billTag',
14256
+ width: 150
14257
+ }],
14258
+ WDT_SYSTEM_ORDER: [{
14259
+ title: '订单类型',
14260
+ dataIndex: 'billType',
14261
+ width: 150
14262
+ }, {
14263
+ title: '系统订单号',
14264
+ dataIndex: 'billNo',
14265
+ width: 150
14266
+ }, {
14267
+ title: '订单标签',
14268
+ dataIndex: 'billTag',
14269
+ width: 150
14270
+ }],
14271
+ BS_E3_SYSTEM_ORDER: [{
14272
+ title: '系统订单号',
14273
+ dataIndex: 'orderSn',
14274
+ width: 150,
14275
+ ellipsis: true
14276
+ }, {
14277
+ title: '订单状态',
14278
+ dataIndex: 'orderStatus',
14279
+ width: 100,
14280
+ ellipsis: true,
14281
+ render: function render(val) {
14282
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_ORDER_STATUS_MAP[val] || val);
14283
+ }
14284
+ }, {
14285
+ title: '是否被拆分',
14286
+ dataIndex: 'isSplit',
14287
+ width: 100,
14288
+ ellipsis: true,
14289
+ render: function render(val) {
14290
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14291
+ }
14292
+ }, {
14293
+ title: '是否拆分子单',
14294
+ dataIndex: 'isSplitNew',
14295
+ width: 100,
14296
+ ellipsis: true,
14297
+ render: function render(val) {
14298
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14299
+ }
14300
+ }, {
14301
+ title: '是否被合并',
14302
+ dataIndex: 'isCombine',
14303
+ width: 100,
14304
+ ellipsis: true,
14305
+ render: function render(val) {
14306
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14307
+ }
14308
+ }, {
14309
+ title: '是否合并新单',
14310
+ dataIndex: 'isCombineNew',
14311
+ width: 100,
14312
+ ellipsis: true,
14313
+ render: function render(val) {
14314
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14315
+ }
14316
+ }, {
14317
+ title: '是否复制单',
14318
+ dataIndex: 'isCopy',
14319
+ width: 100,
14320
+ ellipsis: true,
14321
+ render: function render(val) {
14322
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14323
+ }
14324
+ }, {
14325
+ title: '是否换货单',
14326
+ dataIndex: 'isExchangeOrder',
14327
+ width: 100,
14328
+ ellipsis: true,
14329
+ render: function render(val) {
14330
+ return /*#__PURE__*/React__default['default'].createElement("span", null, kmkfUtils.BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14331
+ }
14332
+ }, {
14333
+ title: '订单备注',
14334
+ dataIndex: 'orderMsg',
14335
+ width: 150,
14336
+ ellipsis: true
14337
+ }]
14338
+ };
14339
+ var rowKeyMap = {
14340
+ BS_SYSTEM_ORDER: 'billNo',
14341
+ WLN_SYSTEM_ORDER: 'billNo',
14342
+ WDT_SYSTEM_ORDER: 'billNo',
14343
+ BS_E3_SYSTEM_ORDER: 'orderSn'
13342
14344
  };
13343
14345
  var index$1 = (function (props) {
13344
14346
  var value = props.value,
@@ -13356,21 +14358,13 @@ var index$1 = (function (props) {
13356
14358
  getWlnOrderList(value.orderNo);
13357
14359
  } else if (type === 'WDT_SYSTEM_ORDER') {
13358
14360
  getWdtOrderList(value.orderNo);
14361
+ } else if (type === 'BS_E3_SYSTEM_ORDER') {
14362
+ getBsE3OrderList(value.orderNo);
13359
14363
  }
13360
14364
  }
13361
- }, [value, type]);
13362
- var columns = React.useMemo(function () {
13363
- var _columnsNameMap$type, _columnsNameMap$type2;
13364
- return [{
13365
- dataIndex: 'billType',
13366
- title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type = columnsNameMap[type]) === null || _columnsNameMap$type === void 0 ? void 0 : _columnsNameMap$type.typeName
13367
- }, {
13368
- dataIndex: 'billNo',
13369
- title: '系统订单号'
13370
- }, {
13371
- dataIndex: 'billTag',
13372
- title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type2 = columnsNameMap[type]) === null || _columnsNameMap$type2 === void 0 ? void 0 : _columnsNameMap$type2.tagName
13373
- }];
14365
+ }, [value, type]);
14366
+ var columns = React.useMemo(function () {
14367
+ return columnsMap[type] || [];
13374
14368
  }, [type]);
13375
14369
  var getOrderList = /*#__PURE__*/function () {
13376
14370
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
@@ -13396,11 +14390,15 @@ var index$1 = (function (props) {
13396
14390
  return {
13397
14391
  billNo: item.billNo,
13398
14392
  billType: item.billType,
13399
- billTag: item.billTag
14393
+ billTag: item.billTag,
14394
+ authorName: item.authorName,
14395
+ authorId: item.authorId
14396
+ // liveActivites: item.liveActivites,
13400
14397
  };
13401
14398
  })
13402
14399
  }));
13403
14400
  }
14401
+
13404
14402
  onceRef.current = false;
13405
14403
  case 7:
13406
14404
  case "end":
@@ -13460,51 +14458,29 @@ var index$1 = (function (props) {
13460
14458
  }();
13461
14459
  var getWdtOrderList = /*#__PURE__*/function () {
13462
14460
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
13463
- var _yield$request3, success, data, trades;
13464
14461
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
13465
14462
  while (1) switch (_context3.prev = _context3.next) {
13466
14463
  case 0:
13467
- _context3.next = 2;
13468
- return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13469
- method: 'post',
13470
- data: {
13471
- billNo: orderNo
13472
- }
13473
- });
13474
- case 2:
13475
- _yield$request3 = _context3.sent;
13476
- success = _yield$request3.success;
13477
- data = _yield$request3.data;
13478
- if (success) {
13479
- trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
14464
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14465
+ var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
13480
14466
  return (item.srcTid || '').split(',').includes(orderNo);
13481
- }).map(function (item) {
13482
- if (Array.isArray(item.goodDetails)) {
13483
- item.goodDetails = item.goodDetails.filter(function (good) {
13484
- return good.srcTid === orderNo;
13485
- });
13486
- }
13487
- return item;
13488
14467
  });
13489
- _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13490
- orders: trades.map(function (item) {
13491
- return _objectSpread2(_objectSpread2({}, item), {}, {
13492
- billNo: item.tradeNo,
13493
- billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13494
- billTag: item.tagName
13495
- });
13496
- }),
13497
- showOrderInfo: trades.map(function (item) {
14468
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14469
+ orders: trades,
14470
+ showOrderInfo: trades.map(function (_ref4) {
14471
+ var billNo = _ref4.billNo,
14472
+ billType = _ref4.billType,
14473
+ billTag = _ref4.billTag;
13498
14474
  return {
13499
- billNo: item.tradeNo,
13500
- billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
13501
- billTag: item.tagName
14475
+ billNo: billNo,
14476
+ billType: billType,
14477
+ billTag: billTag
13502
14478
  };
13503
14479
  })
13504
14480
  }));
13505
- }
14481
+ });
13506
14482
  onceRef.current = false;
13507
- case 7:
14483
+ case 2:
13508
14484
  case "end":
13509
14485
  return _context3.stop();
13510
14486
  }
@@ -13514,6 +14490,31 @@ var index$1 = (function (props) {
13514
14490
  return _ref3.apply(this, arguments);
13515
14491
  };
13516
14492
  }();
14493
+ var getBsE3OrderList = /*#__PURE__*/function () {
14494
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderNo) {
14495
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
14496
+ while (1) switch (_context4.prev = _context4.next) {
14497
+ case 0:
14498
+ bsE3Utils.getBsE3OrderListSingleton(orderNo).then(function (data) {
14499
+ var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
14500
+ return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
14501
+ });
14502
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14503
+ orders: trades,
14504
+ showOrderInfo: trades
14505
+ }));
14506
+ });
14507
+ onceRef.current = false;
14508
+ case 2:
14509
+ case "end":
14510
+ return _context4.stop();
14511
+ }
14512
+ }, _callee4);
14513
+ }));
14514
+ return function getBsE3OrderList(_x4) {
14515
+ return _ref5.apply(this, arguments);
14516
+ };
14517
+ }();
13517
14518
  var rowSelection = {
13518
14519
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
13519
14520
  fixed: true,
@@ -13534,7 +14535,7 @@ var index$1 = (function (props) {
13534
14535
  dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
13535
14536
  columns: columns,
13536
14537
  rowSelection: rowSelection,
13537
- rowKey: 'billNo',
14538
+ rowKey: rowKeyMap[type] || 'billNo',
13538
14539
  size: "small",
13539
14540
  pagination: false,
13540
14541
  scroll: {
@@ -13573,8 +14574,11 @@ var componentMap$1 = {
13573
14574
  type: 'wdt',
13574
14575
  key: 'wdtGoods',
13575
14576
  name: '旺店通',
14577
+ orderNo: 'srcTid',
14578
+ goodDetailOrderNo: 'srcTid',
13576
14579
  eventNameMap: {
13577
14580
  type: 'wdtType',
14581
+ updateGoodsHandle: kmkfUtils.updateWdtGoodsHandle,
13578
14582
  selectListReturn: 'wdtSelectListReturn',
13579
14583
  selectList: 'wdtSelectList',
13580
14584
  reissueSelectList: 'wdtReissueSelectList',
@@ -13589,6 +14593,30 @@ var componentMap$1 = {
13589
14593
  returnDeleteGood: 'wdtReturnDeleteGood',
13590
14594
  exchangeDeleteGood: 'wdtExchangeDeleteGood'
13591
14595
  }
14596
+ },
14597
+ 'BS_E3_GOODS': {
14598
+ type: 'e3',
14599
+ key: 'bsE3Goods',
14600
+ name: '百胜E3',
14601
+ orderNo: 'dealCode',
14602
+ goodDetailOrderNo: 'originalDealCode',
14603
+ eventNameMap: {
14604
+ type: 'bsE3Type',
14605
+ updateGoodsHandle: kmkfUtils.updateBsE3GoodsHandle,
14606
+ selectListReturn: 'bsE3SelectListReturn',
14607
+ selectList: 'bsE3SelectList',
14608
+ reissueSelectList: 'bsE3ReissueSelectList',
14609
+ reissueSelectListReturn: 'bsE3ReissueSelectListReturn',
14610
+ reissueDeleteGood: 'bsE3ReissueDeleteGood',
14611
+ changeShopCode: 'bsE3ChangeShopCode',
14612
+ reissueType: 'bsE3ReissueType',
14613
+ returnType: 'bsE3ReturnType',
14614
+ returnSelectListReturn: 'bsE3ReturnSelectListReturn',
14615
+ returnSelectList: 'bsE3ReturnSelectList',
14616
+ deleteGood: 'bsE3DeleteGood',
14617
+ returnDeleteGood: 'bsE3ReturnDeleteGood',
14618
+ exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
14619
+ }
13592
14620
  }
13593
14621
  };
13594
14622
  var CommonGoods = function CommonGoods(props) {
@@ -13597,6 +14625,13 @@ var CommonGoods = function CommonGoods(props) {
13597
14625
  disabled = props.disabled,
13598
14626
  onChange = props.onChange,
13599
14627
  compType = props.type;
14628
+ console.log('value?.orders', value === null || value === void 0 ? void 0 : value.orders);
14629
+ // 合并单订单会包含","
14630
+ var showModeBtn = !['BS_E3_GOODS'].includes(compType) && ((value === null || value === void 0 ? void 0 : value.orders) || []).some(function (order) {
14631
+ var _order$componentMap$c;
14632
+ 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(',');
14633
+ });
14634
+ var getOrderFlag = React.useRef(false);
13600
14635
  var _useState = React.useState(false),
13601
14636
  _useState2 = _slicedToArray(_useState, 2),
13602
14637
  tableSelect = _useState2[0],
@@ -13604,8 +14639,36 @@ var CommonGoods = function CommonGoods(props) {
13604
14639
  var withInfo = React.useRef(null);
13605
14640
  var valueRef = React.useRef(null);
13606
14641
  React.useEffect(function () {
14642
+ var _value$orders;
13607
14643
  valueRef.current = value;
14644
+ 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)) {
14645
+ getOrderFlag.current = true;
14646
+ compType.indexOf('WDT') > -1 && getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
14647
+ }
13608
14648
  }, [value]);
14649
+ var getWdtOrderList = /*#__PURE__*/function () {
14650
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
14651
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
14652
+ while (1) switch (_context.prev = _context.next) {
14653
+ case 0:
14654
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14655
+ var orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (trade) {
14656
+ return (value.selectIds || []).includes(trade.tradeNo);
14657
+ });
14658
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14659
+ orders: orders
14660
+ }));
14661
+ });
14662
+ case 1:
14663
+ case "end":
14664
+ return _context.stop();
14665
+ }
14666
+ }, _callee);
14667
+ }));
14668
+ return function getWdtOrderList(_x) {
14669
+ return _ref.apply(this, arguments);
14670
+ };
14671
+ }();
13609
14672
  React.useEffect(function () {
13610
14673
  pubsub__default['default'].subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
13611
14674
  if (disabled) return;
@@ -13663,7 +14726,7 @@ var CommonGoods = function CommonGoods(props) {
13663
14726
  });
13664
14727
  pubsub__default['default'].subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
13665
14728
  // console.log(data);
13666
- onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
14729
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
13667
14730
  shopCode: data.shopCode
13668
14731
  }));
13669
14732
  });
@@ -13703,6 +14766,24 @@ var CommonGoods = function CommonGoods(props) {
13703
14766
  var changeHandle = function changeHandle(list) {
13704
14767
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
13705
14768
  };
14769
+ var handleModeChange = function handleModeChange(isStrict) {
14770
+ // isStrict 是否只展示当前平台订单商品
14771
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({
14772
+ isStrict: isStrict
14773
+ }, componentMap$1[compType].key, getGoodDetails({
14774
+ mode: isStrict
14775
+ }))));
14776
+ };
14777
+ var getGoodDetails = function getGoodDetails(_ref2) {
14778
+ var mode = _ref2.mode;
14779
+ var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
14780
+ var goodDetails = updateHandle(value.orders || []);
14781
+ var orderNo = value.orderNo;
14782
+ return mode ? goodDetails.filter(function (goodItem) {
14783
+ var _componentMap$compTyp;
14784
+ 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;
14785
+ }) : goodDetails;
14786
+ };
13706
14787
  return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13707
14788
  key: componentMap$1[compType].key
13708
14789
  }, props), {}, {
@@ -13719,7 +14800,10 @@ var CommonGoods = function CommonGoods(props) {
13719
14800
  },
13720
14801
  onChange: function onChange(val) {
13721
14802
  return changeHandle(val);
13722
- }
14803
+ },
14804
+ onModeChange: handleModeChange,
14805
+ showModeBtn: showModeBtn,
14806
+ isStrict: value === null || value === void 0 ? void 0 : value.isStrict
13723
14807
  }));
13724
14808
  };
13725
14809
 
@@ -13986,8 +15070,8 @@ var typeMap$1 = {
13986
15070
  key: 'wdtReissueGoods',
13987
15071
  name: '旺店通',
13988
15072
  typeName: 'wdtReissueType',
13989
- wdtSystemOrder: 'wdtSystemOrder',
13990
- wdtSystemOrderNo: 'wdtSystemOrderNo',
15073
+ systemOrder: 'wdtSystemOrder',
15074
+ systemOrderNo: 'wdtSystemOrderNo',
13991
15075
  reissueSelectList: 'wdtReissueSelectList',
13992
15076
  reissueSelectListReturn: 'wdtReissueSelectListReturn',
13993
15077
  reissueDeleteGood: 'wdtReissueDeleteGood',
@@ -13996,11 +15080,12 @@ var typeMap$1 = {
13996
15080
  formatDefaultField: {
13997
15081
  money: 'orderPrice',
13998
15082
  share: 'sharePrice'
13999
- }
15083
+ },
15084
+ getOrderList: wdtUtils.getWdtOrderListSingleton
14000
15085
  }
14001
15086
  };
14002
15087
  var wdtReissue = function wdtReissue(props) {
14003
- var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type10, _typeMap$type26, _typeMap$type27, _value$typeMap$type$w2, _typeMap$type28, _typeMap$type29, _typeMap$type30;
15088
+ var _value$wdtSystemOrder, _typeMap$type24, _typeMap$type25, _value$typeMap$type$s5, _typeMap$type26, _typeMap$type27, _typeMap$type28;
14004
15089
  var value = props.value,
14005
15090
  onChange = props.onChange,
14006
15091
  _props$reasonList = props.reasonList,
@@ -14008,177 +15093,172 @@ var wdtReissue = function wdtReissue(props) {
14008
15093
  disabled = props.disabled,
14009
15094
  type = props.type,
14010
15095
  other = _objectWithoutProperties(props, _excluded$g);
14011
- var valueRef = React.useRef({});
14012
- React.useEffect(function () {
14013
- var _typeMap$type, _typeMap$type4;
14014
- valueRef.current = value;
14015
- pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
14016
- if (disabled) return;
14017
- if (value) {
14018
- var _typeMap$type2, _typeMap$type3;
14019
- var newValue = _objectSpread2({}, value);
14020
- 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) {
14021
- return item.sku !== data;
14022
- });
14023
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14024
- }
14025
- });
14026
- pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
14027
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14028
- shopCode: data.shopCode
14029
- }));
14030
- });
14031
- }, [value, disabled]);
15096
+ 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) {
15097
+ var _order$srcTid;
15098
+ return order === null || order === void 0 ? void 0 : (_order$srcTid = order.srcTid) === null || _order$srcTid === void 0 ? void 0 : _order$srcTid.includes(',');
15099
+ });
15100
+ var getOrderFlag = React.useRef(false);
15101
+ var _useState = React.useState(false),
15102
+ _useState2 = _slicedToArray(_useState, 2),
15103
+ isStrict = _useState2[0],
15104
+ setIsStrict = _useState2[1];
14032
15105
  React.useEffect(function () {
14033
- var _value$orders, _value$showOrderInfo;
14034
- 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)) {
14035
- if (type === 'WDT_SYSTEM_ORDER') {
14036
- getWdtOrderList(value.orderNo);
14037
- }
15106
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
15107
+ 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)) {
15108
+ var _value$typeMap$type$s4, _typeMap$type3;
15109
+ getOrderFlag.current = true;
15110
+ 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);
14038
15111
  }
14039
15112
  return;
14040
15113
  }, [value]);
14041
- React.useEffect(function () {
14042
- var _typeMap$type5;
14043
- 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];
14044
- if (wdtSystemOrderNo) {
14045
- var _value$typeMap$type$t, _typeMap$type6;
14046
- 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])) {
14047
- getGoodItems(wdtSystemOrderNo);
14048
- }
14049
- }
14050
- return;
14051
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
14052
- React.useEffect(function () {
14053
- var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
14054
- 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];
14055
- 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];
14056
- if (['1'].includes(typeName)) {
14057
- wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
14058
- } else if (['2'].includes(typeName)) {
14059
- var newValue = _objectSpread2({}, value);
14060
- // newValue[`${typeMap?.[type]?.key}`] = [];
14061
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14062
- }
14063
- return;
14064
- }, [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]]);
14065
- var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
14066
- var _value$typeMap$type$w, _typeMap$type11, _ref;
14067
- 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;
14068
- var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
14069
- return orderItem.billNo === wdtSystemOrderNo;
14070
- });
14071
- if (order) {
14072
- var _typeMap$type12, _order$goodDetails;
14073
- var newValue = _objectSpread2({}, value);
14074
- 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) {
14075
- var _typeMap$type13, _typeMap$type14;
14076
- 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;
14077
- 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;
14078
- item.canUpdateNumber = true;
14079
- return item;
14080
- });
14081
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14082
- }
14083
- };
14084
- var getWdtOrderList = /*#__PURE__*/function () {
14085
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
14086
- var _yield$request, success, data, _typeMap$type15, _typeMap$type16, orders, showOrderInfo;
15114
+ // useEffect(() => {
15115
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
15116
+ // if (systemOrderNo) {
15117
+ // if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
15118
+ // onChange?.({
15119
+ // ...value,
15120
+ // [typeMap[type]?.key]: getGoodDetails({
15121
+ // mode: isStrict
15122
+ // })
15123
+ // })
15124
+ // }
15125
+ // }
15126
+ // return;
15127
+ // }, [value?.[typeMap[type]?.systemOrderNo]]);
15128
+ // const getWdtOrderList = async (orderNo: string) => {
15129
+ // wdtUtils.getWdtOrderListSingleton(orderNo).then(data => {
15130
+ // const orders = data?.trades || [];
15131
+ // const showOrderInfo = orders.map(({ billNo, billType, billTag }: any) => {
15132
+ // return { billNo, billType, billTag }
15133
+ // });
15134
+ // onChange({
15135
+ // ...value,
15136
+ // [typeMap[type]?.systemOrder]: {
15137
+ // ...value[typeMap[type]?.systemOrder],
15138
+ // showOrderInfo,
15139
+ // orders,
15140
+ // },
15141
+ // });
15142
+ // })
15143
+ // };
15144
+ var getOrderList = /*#__PURE__*/function () {
15145
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
15146
+ var _typeMap$type4;
14087
15147
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14088
15148
  while (1) switch (_context.prev = _context.next) {
14089
15149
  case 0:
14090
- _context.next = 2;
14091
- return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
14092
- method: 'post',
14093
- data: {
14094
- billNo: orderNo
14095
- }
14096
- });
14097
- case 2:
14098
- _yield$request = _context.sent;
14099
- success = _yield$request.success;
14100
- data = _yield$request.data;
14101
- if (success) {
14102
- orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
14103
- return _objectSpread2(_objectSpread2({}, item), {}, {
14104
- billNo: item.tradeNo,
14105
- billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
14106
- billTag: item.tagName
14107
- });
14108
- });
14109
- showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
15150
+ (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
15151
+ var _typeMap$type5, _typeMap$type6;
15152
+ var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
15153
+ var showOrderInfo = orders.map(function (_ref2) {
15154
+ var billNo = _ref2.billNo,
15155
+ billType = _ref2.billType,
15156
+ billTag = _ref2.billTag;
14110
15157
  return {
14111
- billNo: item.tradeNo,
14112
- billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
14113
- billTag: item.tagName
15158
+ billNo: billNo,
15159
+ billType: billType,
15160
+ billTag: billTag
14114
15161
  };
14115
15162
  });
14116
- 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]), {}, {
15163
+ 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]), {}, {
14117
15164
  showOrderInfo: showOrderInfo,
14118
15165
  orders: orders
14119
15166
  }))));
14120
- }
14121
- case 6:
15167
+ });
15168
+ case 1:
14122
15169
  case "end":
14123
15170
  return _context.stop();
14124
15171
  }
14125
15172
  }, _callee);
14126
15173
  }));
14127
- return function getWdtOrderList(_x) {
14128
- return _ref2.apply(this, arguments);
15174
+ return function getOrderList(_x) {
15175
+ return _ref.apply(this, arguments);
14129
15176
  };
14130
15177
  }();
14131
15178
  var changeTypeHandle = function changeTypeHandle(val) {
14132
- var _typeMap$type17, _typeMap$type18;
15179
+ var _value$typeMap$type$t, _typeMap$type7, _typeMap$type8;
15180
+ var typeName = val === null || val === void 0 ? void 0 : val[0];
15181
+ 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;
15182
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
14133
15183
  var newValue = _objectSpread2({}, value);
14134
- 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;
14135
- 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)] = [];
15184
+ newValue[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName] = val;
15185
+ if (typeName === '1') {
15186
+ var _typeMap$type9;
15187
+ newValue[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = getGoodDetails({
15188
+ mode: isStrict
15189
+ });
15190
+ } else if (typeName === '2') {
15191
+ var _typeMap$type10;
15192
+ // 切换到非原单,清空列表
15193
+ newValue[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key] = [];
15194
+ }
14136
15195
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14137
- valueRef.current = newValue;
14138
- // if (['2'].includes(val[0])) {
14139
- // onChange?.(newValue);
14140
- // valueRef.current = newValue;
14141
- // }
14142
- // pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
14143
- // val: val[0],
14144
- // goodValue: newValue,
14145
- // });
14146
15196
  };
14147
-
15197
+ var handleModeChange = function handleModeChange(mode) {
15198
+ var _value$typeMap$type$t2, _typeMap$type11, _typeMap$type12;
15199
+ 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';
15200
+ setIsStrict(mode);
15201
+ if (!isOriginalOrder) return;
15202
+ 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({
15203
+ mode: mode
15204
+ }))));
15205
+ };
15206
+ var getGoodDetails = function getGoodDetails(_ref3) {
15207
+ var _typeMap$type13, _typeMap$type14, _order$goodDetails;
15208
+ var mode = _ref3.mode,
15209
+ sysOrderNo = _ref3.sysOrderNo;
15210
+ 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];
15211
+ 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];
15212
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
15213
+ return order.tradeNo === systemOrderNo;
15214
+ });
15215
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.length) ? kmkfUtils.updateWdtGoodsHandle([order]) : [];
15216
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
15217
+ return mode ? goodDetails.filter(function (goodItem) {
15218
+ return !orderNo || goodItem.srcTid === orderNo;
15219
+ }) : goodDetails;
15220
+ };
14148
15221
  var changeGoodHandle = function changeGoodHandle(val) {
14149
- var _typeMap$type19;
15222
+ var _typeMap$type15;
14150
15223
  var newValue = _objectSpread2({}, value);
14151
- 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) {
14152
- var _typeMap$type20, _typeMap$type21;
14153
- 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;
14154
- 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;
15224
+ 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) {
15225
+ var _typeMap$type16, _typeMap$type17;
15226
+ 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;
15227
+ 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;
14155
15228
  return item;
14156
15229
  });
14157
15230
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14158
15231
  };
14159
15232
  var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
14160
- var _typeMap$type22, _value$typeMap$type$t4, _typeMap$type23;
15233
+ var _typeMap$type18, _value$typeMap$type$t3, _typeMap$type19, _value$typeMap$type$t4, _typeMap$type21;
14161
15234
  var newValue = _objectSpread2({}, value);
14162
- 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;
14163
- 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])) {
14164
- var _typeMap$type24;
14165
- 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)] = [];
15235
+ 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;
15236
+ 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])) {
15237
+ var _typeMap$type20;
15238
+ 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)] = [];
15239
+ } 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])) {
15240
+ var _typeMap$type22;
15241
+ 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({
15242
+ mode: isStrict,
15243
+ sysOrderNo: val
15244
+ });
14166
15245
  }
14167
15246
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14168
15247
  };
14169
15248
  //显示选择商品按钮 原单换不显示选择商品
14170
15249
  var showChangeBtn = React.useMemo(function () {
14171
- var _typeMap$type25;
14172
- return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]);
14173
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo]]);
15250
+ var _typeMap$type23;
15251
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrderNo]);
15252
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrderNo]]);
14174
15253
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
14175
- gutter: 8
15254
+ gutter: 8,
15255
+ wrap: true
14176
15256
  }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
14177
15257
  className: "gutter-row",
14178
15258
  xs: {
14179
15259
  span: 11
14180
15260
  },
14181
- md: {
15261
+ sm: {
14182
15262
  span: 6
14183
15263
  }
14184
15264
  }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
@@ -14187,12 +15267,12 @@ var wdtReissue = function wdtReissue(props) {
14187
15267
  },
14188
15268
  disabled: disabled,
14189
15269
  allowClear: false,
14190
- 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)],
15270
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderNo)],
14191
15271
  onChange: function onChange(val) {
14192
15272
  return changeSystemOrderHandle(val);
14193
15273
  },
14194
15274
  placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
14195
- }, ((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) {
15275
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type26 = typeMap$1[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) {
14196
15276
  return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
14197
15277
  key: item.billNo,
14198
15278
  value: item.billNo,
@@ -14203,7 +15283,7 @@ var wdtReissue = function wdtReissue(props) {
14203
15283
  xs: {
14204
15284
  span: 11
14205
15285
  },
14206
- md: {
15286
+ sm: {
14207
15287
  span: 6
14208
15288
  }
14209
15289
  }, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
@@ -14213,7 +15293,7 @@ var wdtReissue = function wdtReissue(props) {
14213
15293
  disabled: disabled,
14214
15294
  allowClear: false,
14215
15295
  options: reasonList,
14216
- 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)],
15296
+ 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.typeName)],
14217
15297
  onChange: function onChange(val) {
14218
15298
  return changeTypeHandle(val);
14219
15299
  }
@@ -14225,10 +15305,13 @@ var wdtReissue = function wdtReissue(props) {
14225
15305
  canUpdateNumber: showChangeBtn,
14226
15306
  showChangeBtn: showChangeBtn,
14227
15307
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
14228
- 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)],
15308
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.key)],
14229
15309
  onChange: function onChange(val) {
14230
15310
  return changeGoodHandle(val);
14231
- }
15311
+ },
15312
+ onModeChange: handleModeChange,
15313
+ showModeBtn: showModeBtn,
15314
+ isStrict: isStrict
14232
15315
  })));
14233
15316
  };
14234
15317
 
@@ -14238,7 +15321,7 @@ styleInject(css_248z$a);
14238
15321
  var TabPane$1 = antd.Tabs.TabPane;
14239
15322
  var Option$2 = antd.Select.Option;
14240
15323
  var Search$1 = antd.Input.Search;
14241
- var GoodsModal$4 = function GoodsModal(props) {
15324
+ var GoodsModal$5 = function GoodsModal(props) {
14242
15325
  var onSubmit = props.onSubmit,
14243
15326
  _onCancel = props.onCancel,
14244
15327
  visible = props.visible,
@@ -14689,7 +15772,7 @@ var Goods$1 = function Goods(props, ref) {
14689
15772
  };
14690
15773
  return /*#__PURE__*/React__default['default'].createElement("div", {
14691
15774
  className: "goodsBox"
14692
- }, /*#__PURE__*/React__default['default'].createElement(GoodsModal$4, {
15775
+ }, /*#__PURE__*/React__default['default'].createElement(GoodsModal$5, {
14693
15776
  visible: visible,
14694
15777
  onSubmit: onSubmit,
14695
15778
  type: type,
@@ -15002,6 +16085,236 @@ var CalculationInput = function CalculationInput(props) {
15002
16085
  }, config === null || config === void 0 ? void 0 : config.unit));
15003
16086
  };
15004
16087
 
16088
+ var _excluded$k = ["value", "onChange", "reasonList", "disabled", "type"];
16089
+ var typeMap$2 = {
16090
+ BS_E3_REISSUE_GOODS: {
16091
+ key: 'bsE3ReissueGoods',
16092
+ typeName: 'bsE3ReissueType',
16093
+ systemOrder: 'bsE3SystemOrder',
16094
+ systemOrderNo: 'bsE3SystemOrderNo',
16095
+ getOrderList: bsE3Utils.getBsE3OrderListSingleton
16096
+ }
16097
+ };
16098
+ var bsE3Reissue = function bsE3Reissue(props) {
16099
+ var _typeMap$type21, _typeMap$type23, _typeMap$type24, _value$typeMap$type$s5, _typeMap$type25, _typeMap$type26, _typeMap$type27;
16100
+ var value = props.value,
16101
+ onChange = props.onChange,
16102
+ _props$reasonList = props.reasonList,
16103
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
16104
+ disabled = props.disabled,
16105
+ type = props.type,
16106
+ other = _objectWithoutProperties(props, _excluded$k);
16107
+ var getOrderFlag = React.useRef(false);
16108
+ var _useState = React.useState(false),
16109
+ _useState2 = _slicedToArray(_useState, 2),
16110
+ isStrict = _useState2[0],
16111
+ setIsStrict = _useState2[1];
16112
+ // TODO: 在修改场景下手动获取一次订单详情中数据
16113
+ React.useEffect(function () {
16114
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
16115
+ 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)) {
16116
+ var _value$typeMap$type$s4, _typeMap$type3;
16117
+ getOrderFlag.current = true;
16118
+ 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);
16119
+ }
16120
+ return;
16121
+ }, [value]);
16122
+ // useEffect(() => {
16123
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
16124
+ // if (systemOrderNo) {
16125
+ // if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
16126
+ // onChange?.({
16127
+ // ...value,
16128
+ // [typeMap[type]?.key]: getGoodDetails({
16129
+ // mode: isStrict
16130
+ // })
16131
+ // })
16132
+ // }
16133
+ // }
16134
+ // return;
16135
+ // }, [value?.[typeMap[type]?.systemOrderNo]]);
16136
+ var getOrderList = /*#__PURE__*/function () {
16137
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
16138
+ var _typeMap$type4;
16139
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
16140
+ while (1) switch (_context.prev = _context.next) {
16141
+ case 0:
16142
+ (_typeMap$type4 = typeMap$2[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
16143
+ var _typeMap$type5, _typeMap$type6;
16144
+ var orders = (data === null || data === void 0 ? void 0 : data.orderList) || [];
16145
+ var showOrderInfo = orders.map(function (_ref2) {
16146
+ var orderSn = _ref2.orderSn;
16147
+ return {
16148
+ billNo: orderSn
16149
+ };
16150
+ });
16151
+ 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]), {}, {
16152
+ showOrderInfo: showOrderInfo,
16153
+ orders: orders
16154
+ }))));
16155
+ });
16156
+ case 1:
16157
+ case "end":
16158
+ return _context.stop();
16159
+ }
16160
+ }, _callee);
16161
+ }));
16162
+ return function getOrderList(_x) {
16163
+ return _ref.apply(this, arguments);
16164
+ };
16165
+ }();
16166
+ var changeTypeHandle = function changeTypeHandle(val) {
16167
+ var _typeMap$type7;
16168
+ var typeName = val === null || val === void 0 ? void 0 : val[0];
16169
+ // if (typeName === value?.[typeMap[type]?.typeName]?.[0]) return
16170
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
16171
+ var newValue = _objectSpread2({}, value);
16172
+ newValue[(_typeMap$type7 = typeMap$2[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName] = val;
16173
+ if (typeName === '1') {
16174
+ var _typeMap$type8;
16175
+ newValue[(_typeMap$type8 = typeMap$2[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.key] = getGoodDetails({
16176
+ mode: isStrict
16177
+ });
16178
+ } else if (typeName === '2') {
16179
+ var _typeMap$type9;
16180
+ // 切换到非原单,清空列表
16181
+ newValue[(_typeMap$type9 = typeMap$2[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = [];
16182
+ }
16183
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16184
+ };
16185
+ var handleModeChange = function handleModeChange(mode) {
16186
+ var _value$typeMap$type$t, _typeMap$type10, _typeMap$type11;
16187
+ 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';
16188
+ setIsStrict(mode);
16189
+ if (!isOriginalOrder) return;
16190
+ 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({
16191
+ mode: mode
16192
+ }))));
16193
+ };
16194
+ var getGoodDetails = function getGoodDetails(_ref3) {
16195
+ var _typeMap$type12, _typeMap$type13, _order$orderDetailGet;
16196
+ var mode = _ref3.mode,
16197
+ sysOrderNo = _ref3.sysOrderNo;
16198
+ 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];
16199
+ 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];
16200
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
16201
+ return order.orderSn === systemOrderNo;
16202
+ });
16203
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$orderDetailGet = order.orderDetailGets) === null || _order$orderDetailGet === void 0 ? void 0 : _order$orderDetailGet.length) ? kmkfUtils.updateBsE3GoodsHandle([order]) : [];
16204
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
16205
+ return mode ? goodDetails.filter(function (goodItem) {
16206
+ return !orderNo || goodItem.originalOrderSn === orderNo;
16207
+ }) : goodDetails;
16208
+ };
16209
+ var changeGoodHandle = function changeGoodHandle(val) {
16210
+ var _typeMap$type14;
16211
+ var newValue = _objectSpread2({}, value);
16212
+ 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 || [];
16213
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16214
+ };
16215
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
16216
+ var _typeMap$type15, _value$typeMap$type$t2, _typeMap$type16, _value$typeMap$type$t3, _typeMap$type18;
16217
+ var newValue = _objectSpread2({}, value);
16218
+ 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;
16219
+ 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])) {
16220
+ var _typeMap$type17;
16221
+ 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)] = [];
16222
+ } 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])) {
16223
+ var _typeMap$type19;
16224
+ 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({
16225
+ mode: isStrict,
16226
+ sysOrderNo: val
16227
+ });
16228
+ }
16229
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16230
+ };
16231
+ //显示选择商品按钮 原单换不显示选择商品
16232
+ var showChangeBtn = React.useMemo(function () {
16233
+ var _typeMap$type20;
16234
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.systemOrderNo]);
16235
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo]]);
16236
+ var selectedGoodsChange = React.useCallback(function (skuList) {
16237
+ var _typeMap$type22, _getGoodDetails;
16238
+ var newValue = _objectSpread2({}, value);
16239
+ newValue["".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)] = (_getGoodDetails = getGoodDetails({
16240
+ mode: isStrict
16241
+ })) === null || _getGoodDetails === void 0 ? void 0 : _getGoodDetails.filter(function (item) {
16242
+ return skuList.includes(item.sku);
16243
+ });
16244
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16245
+ }, [value === null || value === void 0 ? void 0 : value["".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)], isStrict]);
16246
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
16247
+ gutter: 8,
16248
+ wrap: true,
16249
+ id: "bsE3ReissueGoods"
16250
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
16251
+ className: "gutter-row",
16252
+ xs: {
16253
+ span: 11
16254
+ },
16255
+ sm: {
16256
+ span: 6
16257
+ }
16258
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
16259
+ style: {
16260
+ marginBottom: '8px'
16261
+ },
16262
+ disabled: disabled,
16263
+ allowClear: false,
16264
+ value: 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.systemOrderNo)],
16265
+ onChange: function onChange(val) {
16266
+ return changeSystemOrderHandle(val);
16267
+ },
16268
+ placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
16269
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
16270
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
16271
+ key: item.billNo,
16272
+ value: item.billNo,
16273
+ label: item.billNo
16274
+ }, item.billNo);
16275
+ }))), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
16276
+ className: "gutter-row",
16277
+ xs: {
16278
+ span: 11
16279
+ },
16280
+ sm: {
16281
+ span: 6
16282
+ }
16283
+ }, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
16284
+ style: {
16285
+ marginBottom: '8px'
16286
+ },
16287
+ disabled: disabled,
16288
+ allowClear: false,
16289
+ options: reasonList,
16290
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.typeName)],
16291
+ onChange: function onChange(val) {
16292
+ return changeTypeHandle(val);
16293
+ }
16294
+ }))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
16295
+ key: 'reissueGoods'
16296
+ }, other), {}, {
16297
+ type: type,
16298
+ disabled: disabled,
16299
+ canUpdateNumber: showChangeBtn,
16300
+ showChangeBtn: showChangeBtn,
16301
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
16302
+ 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.key)],
16303
+ onChange: function onChange(val) {
16304
+ return changeGoodHandle(val);
16305
+ },
16306
+ onModeChange: handleModeChange,
16307
+ showModeBtn: false,
16308
+ isStrict: isStrict,
16309
+ tradeGoods: {
16310
+ originDataSource: getGoodDetails({
16311
+ mode: isStrict
16312
+ }),
16313
+ selectedGoodsChange: selectedGoodsChange
16314
+ }
16315
+ })));
16316
+ };
16317
+
15005
16318
  exports.Address = ApaasAddress;
15006
16319
  exports.AliPay = AliPay;
15007
16320
  exports.ApaasAddress = Province;
@@ -15022,6 +16335,7 @@ exports.ApaasTextArea = ApaasTextArea;
15022
16335
  exports.ApaasUpload = ApaasUpload;
15023
16336
  exports.ApaasUploadAsync = index;
15024
16337
  exports.ApaasUploadFile = ApaasUploadFile;
16338
+ exports.BsE3Reissue = bsE3Reissue;
15025
16339
  exports.BsExchange = BsExchange;
15026
16340
  exports.BsGoods = BsGoods;
15027
16341
  exports.BsReissue = BsReissue;