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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3,8 +3,8 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, WdtSendData, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, BS_E3_BOOLEAN_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
7
- import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject } from 'lodash';
6
+ import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterKmOrders, KM_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
7
+ import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty, intersection, uniqBy } from 'lodash';
8
8
  import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
9
9
  import zhCN from 'antd/lib/locale/zh_CN';
10
10
  import pubsub from 'pubsub-js';
@@ -921,13 +921,14 @@ var css_248z$1 = ".index-module_imageBox__8zj7A {\n display: flex;\n flex-wrap
921
921
  var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-module_inputImage__3VrvC","imageShow":"index-module_imageShow__3wD4d","imageWrap":"index-module_imageWrap__JkMJo","-webkit-mask":"index-module_mask__3LUIn","mask":"index-module_mask__3LUIn","deleteIcon":"index-module_deleteIcon__20Wzd","actions":"index-module_actions__2tY_V","icon":"index-module_icon__ZI-2P","imagePaste":"index-module_imagePaste__2X-K1","fakeBox":"index-module_fakeBox__2_3rA","addBtn":"index-module_addBtn__2m5lC","upload":"index-module_upload__2igU3","tips":"index-module_tips__1ATcr"};
922
922
  styleInject(css_248z$1);
923
923
 
924
- var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
924
+ var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl", "platform"];
925
925
  var fn$1 = function fn() {
926
926
  return void 0;
927
927
  };
928
928
  var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
929
+ var _document;
929
930
  var _ref$maxCount = _ref.maxCount,
930
- maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
931
+ maxCount = _ref$maxCount === void 0 ? 20 : _ref$maxCount,
931
932
  _ref$maxSize = _ref.maxSize,
932
933
  maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
933
934
  _ref$uploadText = _ref.uploadText,
@@ -946,6 +947,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
946
947
  hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
947
948
  _ref$actionUrl = _ref.actionUrl,
948
949
  actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
950
+ _ref$platform = _ref.platform,
951
+ platform = _ref$platform === void 0 ? '' : _ref$platform,
949
952
  resetProps = _objectWithoutProperties(_ref, _excluded$6);
950
953
  var inputRef = useRef(null);
951
954
  var valueRef = useRef(value);
@@ -953,18 +956,13 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
953
956
  _useState2 = _slicedToArray(_useState, 2),
954
957
  uploading = _useState2[0],
955
958
  setUploading = _useState2[1];
956
- var _useState3 = useState(false),
959
+ var _useState3 = useState(true),
957
960
  _useState4 = _slicedToArray(_useState3, 2),
958
- visible = _useState4[0],
959
- setVisible = _useState4[1];
960
- var _useState5 = useState(''),
961
- _useState6 = _slicedToArray(_useState5, 2),
962
- currentPreviewImg = _useState6[0],
963
- setCurrentPreviewImg = _useState6[1];
964
- var _useState7 = useState(true),
965
- _useState8 = _slicedToArray(_useState7, 2),
966
- pasteDefaultStates = _useState8[0],
967
- setPasteDefaultStates = _useState8[1];
961
+ pasteDefaultStates = _useState4[0],
962
+ setPasteDefaultStates = _useState4[1];
963
+ var preview = platform === 'ks' ? {
964
+ getContainer: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementById('root')
965
+ } : true;
968
966
  useEffect(function () {
969
967
  valueRef.current = value;
970
968
  }, [value]);
@@ -1096,7 +1094,9 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1096
1094
  };
1097
1095
  };
1098
1096
  var renderImages = function renderImages(images) {
1099
- return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, images.map(function (image, index) {
1097
+ return /*#__PURE__*/React.createElement(Image.PreviewGroup, {
1098
+ preview: preview
1099
+ }, images.map(function (image, index) {
1100
1100
  var finalImage = "".concat(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image, "?x-oss-process=image/resize,h_60,w_60");
1101
1101
  var showImage = /^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image;
1102
1102
  return /*#__PURE__*/React.createElement("div", {
@@ -1172,21 +1172,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1172
1172
  beforeUpload: beforeUpload
1173
1173
  }, resetProps), value.length >= maxCount ? null : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
1174
1174
  className: "addBtn"
1175
- }, "+"), /*#__PURE__*/React.createElement("div", null, uploadText))), /*#__PURE__*/React.createElement(Image, {
1176
- width: 0,
1177
- style: {
1178
- display: visible ? '' : 'none'
1179
- },
1180
- src: currentPreviewImg,
1181
- preview: {
1182
- visible: visible,
1183
- src: "".concat(currentPreviewImg),
1184
- onVisibleChange: function onVisibleChange(value) {
1185
- setCurrentPreviewImg('');
1186
- setVisible(value);
1187
- }
1188
- }
1189
- })));
1175
+ }, "+"), /*#__PURE__*/React.createElement("div", null, uploadText)))));
1190
1176
  };
1191
1177
  var index = /*#__PURE__*/forwardRef(ApaasUploadAsync);
1192
1178
 
@@ -6877,7 +6863,7 @@ var fn$2 = function fn() {
6877
6863
  };
6878
6864
  var ApaasUploadFile = function ApaasUploadFile(_ref) {
6879
6865
  var _ref$maxCount = _ref.maxCount,
6880
- maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
6866
+ maxCount = _ref$maxCount === void 0 ? 20 : _ref$maxCount,
6881
6867
  _ref$maxSize = _ref.maxSize,
6882
6868
  maxSize = _ref$maxSize === void 0 ? 100 : _ref$maxSize,
6883
6869
  _ref$onChange = _ref.onChange,
@@ -9577,10 +9563,29 @@ var GoodItem = function GoodItem(props) {
9577
9563
  return _ref5.apply(this, arguments);
9578
9564
  };
9579
9565
  }();
9580
- var headerList = showHeader || {
9581
- 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9582
- ]
9583
- }[type] || [];
9566
+ var headerList = useMemo(function () {
9567
+ if (!Array.isArray(showHeader)) return ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9568
+ ];
9569
+
9570
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9571
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9572
+ var dataIndexList = [];
9573
+ if (isStringArray) {
9574
+ dataIndexList = showHeader;
9575
+ } else if (isObjectArray) {
9576
+ dataIndexList = showHeader.map(function (item) {
9577
+ return item.dataIndex;
9578
+ });
9579
+ }
9580
+ return isStringArray ? showHeader : isObjectArray ? showHeader.filter(function (item) {
9581
+ return item.show !== false;
9582
+ }).map(function (item) {
9583
+ return item.dataIndex;
9584
+ }) : [] || {
9585
+ 1: ['title', 'outerId', 'picUrl', 'numIid', 'skuId', 'outerSkuId', 'propertiesName' // sku 信息
9586
+ ]
9587
+ }[type] || [];
9588
+ }, [showHeader]);
9584
9589
  //修改参数
9585
9590
  var handleChangeValue = function handleChangeValue(key, index) {
9586
9591
  return function (e) {
@@ -9595,35 +9600,57 @@ var GoodItem = function GoodItem(props) {
9595
9600
  };
9596
9601
  };
9597
9602
  // TODO: 目前只做了type 1的处理,其他的还是走老的文件 ./index.tsx
9598
- var goodItemAttrs = [{
9599
- isShow: headerList.includes('title'),
9600
- key: 'title',
9601
- label: '商品名称'
9602
- }, {
9603
- isShow: headerList.includes('outerId'),
9604
- key: 'outerId',
9605
- label: '商品编码'
9606
- },
9607
- // { isShow: headerList.includes('picUrl'), key: 'picUrl', label: '图片' },
9608
- {
9609
- isShow: headerList.includes('numIid'),
9610
- key: 'numIid',
9611
- label: '商品id'
9612
- }, {
9613
- isShow: changeSku && headerList.includes('skuId'),
9614
- key: 'skuId',
9615
- label: 'SKU ID'
9616
- }, {
9617
- isShow: changeSku && headerList.includes('outerSkuId'),
9618
- key: 'outerSkuId',
9619
- label: 'SKU 编码'
9620
- }, {
9621
- isShow: changeSku && headerList.includes('propertiesName'),
9622
- key: 'propertiesName',
9623
- label: 'SKU 信息'
9624
- }];
9625
- var hasPic = headerList.includes('picUrl');
9626
- var hasAttr = hasPic ? headerList.length > 1 : headerList.length > 0;
9603
+ var goodItemAttrs = useMemo(function () {
9604
+ var initList = [{
9605
+ isShow: headerList.includes('title'),
9606
+ key: 'title',
9607
+ label: '商品名称'
9608
+ }, {
9609
+ isShow: headerList.includes('outerId'),
9610
+ key: 'outerId',
9611
+ label: '商品编码'
9612
+ },
9613
+ // { isShow: headerList.includes('picUrl'), key: 'picUrl', label: '图片' },
9614
+ {
9615
+ isShow: headerList.includes('numIid'),
9616
+ key: 'numIid',
9617
+ label: '商品id'
9618
+ }, {
9619
+ isShow: changeSku && headerList.includes('skuId'),
9620
+ key: 'skuId',
9621
+ label: 'SKU ID'
9622
+ }, {
9623
+ isShow: changeSku && headerList.includes('outerSkuId'),
9624
+ key: 'outerSkuId',
9625
+ label: 'SKU 编码'
9626
+ }, {
9627
+ isShow: changeSku && headerList.includes('propertiesName'),
9628
+ key: 'propertiesName',
9629
+ label: 'SKU 信息'
9630
+ }];
9631
+ if (!Array.isArray(showHeader)) return initList;
9632
+ var newList = [];
9633
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
9634
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
9635
+ (isStringArray ? showHeader : isObjectArray ? showHeader.map(function (item) {
9636
+ return item.dataIndex;
9637
+ }) : []).forEach(function (dataIndex) {
9638
+ if (initList.find(function (item) {
9639
+ return item.key === dataIndex;
9640
+ })) {
9641
+ newList.push(initList.find(function (item) {
9642
+ return item.key === dataIndex;
9643
+ }));
9644
+ }
9645
+ });
9646
+ return newList;
9647
+ }, [headerList, showHeader]);
9648
+ var hasPic = useMemo(function () {
9649
+ return headerList.includes('picUrl');
9650
+ }, [headerList]);
9651
+ var hasAttr = useMemo(function () {
9652
+ return hasPic ? headerList.length > 1 : headerList.length > 0;
9653
+ }, [hasPic, headerList]);
9627
9654
  return /*#__PURE__*/React.createElement("div", null, imgList.length === 0 ? /*#__PURE__*/React.createElement("p", {
9628
9655
  className: "goods-title"
9629
9656
  }, "\u6700\u591A\u6DFB\u52A0", maxLength, "\u4E2A\u5B9D\u8D1D") : /*#__PURE__*/React.createElement("p", {
@@ -10969,13 +10996,19 @@ var jstGoods = function jstGoods(props) {
10969
10996
  _useState2 = _slicedToArray(_useState, 2),
10970
10997
  changeIndex = _useState2[0],
10971
10998
  setChangeIndex = _useState2[1]; //选中的包裹
10972
- var wdtSendOptions = WdtSendData.getInstance().wdtSendData || [];
10999
+ var sendOptions = SendDataCenter.getInstance(platformType).getSendData();
11000
+ var isSelectName = ['wdt', 'bsE3', 'km'].includes(platformType);
10973
11001
  useEffect(function () {
10974
11002
  //没有值塞个默认值
10975
11003
  if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
10976
11004
  onChange === null || onChange === void 0 ? void 0 : onChange(typeInitValueMap[type]);
10977
11005
  }
10978
11006
  }, [value, type]);
11007
+ useEffect(function () {
11008
+ if (changeIndex > (value === null || value === void 0 ? void 0 : value.length) - 1) {
11009
+ setChangeIndex(0);
11010
+ }
11011
+ }, value);
10979
11012
  var content = function content(item, index) {
10980
11013
  return /*#__PURE__*/React.createElement("div", {
10981
11014
  style: {
@@ -10986,7 +11019,7 @@ var jstGoods = function jstGoods(props) {
10986
11019
  style: {
10987
11020
  textAlign: 'center'
10988
11021
  }
10989
- }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
11022
+ }, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F"), item.sid && /*#__PURE__*/React.createElement("span", null, "(\u7CFB\u7EDF\u5355\u53F7:", item.sid, ")")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
10990
11023
  return /*#__PURE__*/React.createElement("div", {
10991
11024
  key: index
10992
11025
  }, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Image, {
@@ -11000,7 +11033,7 @@ var jstGoods = function jstGoods(props) {
11000
11033
  var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
11001
11034
  changeOrderInfo[type] = val;
11002
11035
  changeOrderInfo['sendId'] = option.value;
11003
- if (platformType === 'wdt' && type === 'sendName') {
11036
+ if (isSelectName && type === 'sendName') {
11004
11037
  changeOrderInfo['sendSnapshotName'] = option.label;
11005
11038
  }
11006
11039
  var newList = _toConsumableArray(value);
@@ -11083,7 +11116,7 @@ var jstGoods = function jstGoods(props) {
11083
11116
  return changeInputHandle(e.target.value, 'sendId');
11084
11117
  },
11085
11118
  value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
11086
- }), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React.createElement(Select, {
11119
+ }), ['sendName', 'all'].includes(showField) && (isSelectName ? /*#__PURE__*/React.createElement(Select, {
11087
11120
  style: {
11088
11121
  minWidth: '100px',
11089
11122
  maxWidth: '180px'
@@ -11091,7 +11124,7 @@ var jstGoods = function jstGoods(props) {
11091
11124
  disabled: disabled,
11092
11125
  placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
11093
11126
  showSearch: true,
11094
- options: wdtSendOptions,
11127
+ options: sendOptions,
11095
11128
  filterOption: filterOption,
11096
11129
  value: ((_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName) || null,
11097
11130
  onChange: function onChange(value, option) {
@@ -12083,9 +12116,9 @@ var getTableData$1 = function getTableData(_ref, formData) {
12083
12116
  var current = _ref.current,
12084
12117
  pageSize = _ref.pageSize;
12085
12118
  var data = {
12086
- goodsSn: formData.goodsSn || null,
12087
- goodsName: formData.goodsName || null,
12088
- sku: formData.sku || null,
12119
+ goodNo: formData.goodNo || null,
12120
+ goodName: formData.goodName || null,
12121
+ skuCode: formData.skuCode || null,
12089
12122
  skuId: formData.skuId || null
12090
12123
  };
12091
12124
  return extendRequest('/qy/gdfw/product/product/page', {
@@ -12093,7 +12126,7 @@ var getTableData$1 = function getTableData(_ref, formData) {
12093
12126
  data: _objectSpread2({
12094
12127
  pageSize: pageSize,
12095
12128
  pageNo: current,
12096
- platform: 'WDT_ERP'
12129
+ platform: 'BS_E3_ERP'
12097
12130
  }, data)
12098
12131
  }).then(function (res) {
12099
12132
  var _res$data = res.data,
@@ -12122,127 +12155,91 @@ var columns$2 = [{
12122
12155
  }
12123
12156
  }, index + 1);
12124
12157
  },
12125
- width: 100
12158
+ width: 80
12126
12159
  }, {
12127
- dataIndex: 'sku',
12160
+ dataIndex: 'specNo',
12128
12161
  title: "SKU",
12129
12162
  ellipsis: true,
12130
- width: 70
12163
+ width: 200
12131
12164
  }, {
12132
- dataIndex: 'skuId',
12165
+ dataIndex: 'specId',
12133
12166
  title: "SKU ID",
12134
12167
  ellipsis: true,
12135
- width: 70
12168
+ width: 80
12136
12169
  }, {
12137
- dataIndex: 'goodsName',
12170
+ dataIndex: 'goodName',
12138
12171
  title: "\u5546\u54C1\u540D\u79F0",
12139
12172
  ellipsis: true,
12140
- width: 70
12173
+ width: 250
12141
12174
  }, {
12142
- dataIndex: 'goodsShortName',
12175
+ dataIndex: 'goodShortName',
12143
12176
  title: "\u5546\u54C1\u7B80\u79F0",
12144
12177
  ellipsis: true,
12145
- width: 70
12146
- }, {
12147
- dataIndex: 'picPath',
12148
- title: "\u5546\u54C1\u56FE\u7247",
12149
- ellipsis: true,
12150
- width: 100,
12151
- render: function render(picUrl) {
12152
- return /*#__PURE__*/React.createElement("img", {
12153
- style: {
12154
- width: '60px',
12155
- height: '60px',
12156
- objectFit: 'contain'
12157
- },
12158
- src: picUrl
12159
- });
12160
- }
12161
- }, {
12162
- dataIndex: 'goodsSn',
12178
+ width: 250
12179
+ },
12180
+ // {
12181
+ // dataIndex: 'goodPicUrl',
12182
+ // title: `商品图片`,
12183
+ // ellipsis: true,
12184
+ // width: 100,
12185
+ // render: (picUrl: string) => {
12186
+ // return (
12187
+ // <img
12188
+ // style={{
12189
+ // width: '40px',
12190
+ // height: '40px',
12191
+ // objectFit: 'contain',
12192
+ // }}
12193
+ // src={picUrl}
12194
+ // ></img>
12195
+ // );
12196
+ // },
12197
+ // },
12198
+ {
12199
+ dataIndex: 'goodNo',
12163
12200
  title: "\u8D27\u53F7",
12164
12201
  ellipsis: true,
12165
- width: 70
12202
+ width: 150
12166
12203
  }, {
12167
- dataIndex: 'goodsId',
12204
+ dataIndex: 'goodId',
12168
12205
  title: "\u8D27\u53F7ID",
12169
12206
  ellipsis: true,
12170
- width: 70
12207
+ width: 100
12171
12208
  }, {
12172
12209
  dataIndex: 'colorName',
12173
12210
  title: "\u989C\u8272\u540D\u79F0",
12174
12211
  ellipsis: true,
12175
- width: 70
12212
+ width: 100
12176
12213
  }, {
12177
12214
  dataIndex: 'colorCode',
12178
12215
  title: "\u989C\u8272\u4EE3\u7801",
12179
12216
  ellipsis: true,
12180
- width: 70
12217
+ width: 100
12181
12218
  }, {
12182
12219
  dataIndex: 'sizeName',
12183
12220
  title: "\u5C3A\u7801\u540D\u79F0",
12184
12221
  ellipsis: true,
12185
- width: 70
12222
+ width: 100
12186
12223
  }, {
12187
12224
  dataIndex: 'sizeCode',
12188
12225
  title: "\u5C3A\u7801\u4EE3\u7801",
12189
12226
  ellipsis: true,
12190
- width: 70
12227
+ width: 100
12191
12228
  }, {
12192
12229
  dataIndex: 'brandName',
12193
12230
  title: "\u54C1\u724C\u540D\u79F0",
12194
12231
  ellipsis: true,
12195
- width: 70
12196
- }, {
12197
- dataIndex: 'goodsNumber',
12198
- title: "\u5546\u54C1\u6570\u91CF",
12199
- ellipsis: true,
12200
- width: 70
12201
- }, {
12202
- dataIndex: 'goodsPrice',
12203
- title: "\u5546\u54C1\u5355\u4EF7",
12204
- ellipsis: true,
12205
- width: 70
12206
- }, {
12207
- dataIndex: 'shopPrice',
12208
- title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12209
- ellipsis: true,
12210
- width: 70
12211
- }, {
12212
- dataIndex: 'sharePrice',
12213
- title: "\u5206\u644A\u4EF7",
12214
- ellipsis: true,
12215
- width: 70
12216
- }, {
12217
- dataIndex: 'sharePayment',
12218
- title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
12219
- ellipsis: true,
12220
- width: 70
12221
- }, {
12222
- dataIndex: 'payment',
12223
- title: "\u5B9E\u4ED8\u91D1\u989D",
12224
- ellipsis: true,
12225
- width: 70
12226
- }, {
12227
- dataIndex: 'tcSku',
12228
- title: "\u5957\u9910SKU",
12229
- ellipsis: true,
12230
- width: 70
12231
- }, {
12232
- dataIndex: 'tcGoodsNumber',
12233
- title: "\u5957\u9910\u5957\u6570",
12234
- ellipsis: true,
12235
- width: 70
12232
+ width: 100
12236
12233
  }, {
12237
- dataIndex: 'taoCanSingleSl',
12238
- title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
12234
+ dataIndex: 'marketPrice',
12235
+ title: "\u5E02\u573A\u4EF7",
12239
12236
  ellipsis: true,
12240
- width: 70
12237
+ width: 100
12241
12238
  }, {
12242
- dataIndex: 'isGift',
12243
- title: "\u662F\u5426\u8D60\u54C1",
12239
+ dataIndex: 'retailPrice',
12240
+ title: "\u552E\u4EF7",
12244
12241
  ellipsis: true,
12245
- width: 70
12242
+ width: 100
12246
12243
  }];
12247
12244
  var GoodList$1 = function GoodList(props, ref) {
12248
12245
  var _useState = useState([]),
@@ -12276,7 +12273,7 @@ var GoodList$1 = function GoodList(props, ref) {
12276
12273
  layout: "inline",
12277
12274
  form: form
12278
12275
  }, /*#__PURE__*/React.createElement(Form.Item, {
12279
- name: "goodsSn",
12276
+ name: "goodNo",
12280
12277
  style: {
12281
12278
  marginBottom: '12px'
12282
12279
  }
@@ -12287,7 +12284,7 @@ var GoodList$1 = function GoodList(props, ref) {
12287
12284
  width: 150
12288
12285
  }
12289
12286
  })), /*#__PURE__*/React.createElement(Form.Item, {
12290
- name: "goodsName",
12287
+ name: "goodName",
12291
12288
  style: {
12292
12289
  marginBottom: '12px'
12293
12290
  }
@@ -12298,7 +12295,7 @@ var GoodList$1 = function GoodList(props, ref) {
12298
12295
  width: 150
12299
12296
  }
12300
12297
  })), /*#__PURE__*/React.createElement(Form.Item, {
12301
- name: "sku",
12298
+ name: "skuCode",
12302
12299
  style: {
12303
12300
  marginBottom: '12px'
12304
12301
  }
@@ -12415,7 +12412,7 @@ var GoodList$1 = function GoodList(props, ref) {
12415
12412
  }
12416
12413
  }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
12417
12414
  rowSelection: rowSelection,
12418
- rowKey: "goodsId",
12415
+ rowKey: "specNo",
12419
12416
  columns: columns$2,
12420
12417
  scroll: {
12421
12418
  x: '100%',
@@ -12475,81 +12472,1249 @@ var GoodsModal$4 = function GoodsModal(props, ref) {
12475
12472
  };
12476
12473
  var BsE3GoodsModal = /*#__PURE__*/forwardRef(GoodsModal$4);
12477
12474
 
12478
- // interface GoodsItem {
12479
- // title: string;
12480
- // pic: string;
12481
- // platform: string;
12482
- // skuId: string;
12483
- // styleId: string;
12484
- // }
12485
- var GoodItem$1 = function GoodItem(props) {
12486
- var _ref;
12487
- var _props$value = props.value,
12488
- value = _props$value === void 0 ? [] : _props$value,
12489
- type = props.type,
12490
- onChange = props.onChange,
12491
- disabled = props.disabled,
12492
- _props$showHeader = props.showHeader,
12493
- showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
12494
- width = props.width,
12495
- _props$shopList = props.shopList,
12496
- shopList = _props$shopList === void 0 ? [] : _props$shopList,
12497
- _props$shopId = props.shopId,
12498
- shopId = _props$shopId === void 0 ? '' : _props$shopId,
12499
- _props$maxLength = props.maxLength,
12500
- maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
12501
- _props$showChangeBtn = props.showChangeBtn,
12502
- showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
12503
- _props$showModeBtn = props.showModeBtn,
12504
- showModeBtn = _props$showModeBtn === void 0 ? false : _props$showModeBtn,
12505
- _props$isStrict = props.isStrict,
12506
- isStrict = _props$isStrict === void 0 ? false : _props$isStrict,
12507
- _props$tableSelect = props.tableSelect,
12508
- tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
12509
- _props$selectType = props.selectType,
12510
- selectType = _props$selectType === void 0 ? '' : _props$selectType,
12511
- _props$otherOperation = props.otherOperations,
12512
- otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
12513
- _props$canUpdateNumbe = props.canUpdateNumber,
12514
- canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
12515
- shopCode = props.shopCode,
12516
- _props$companyKey = props.companyKey,
12517
- companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
12518
- onSelect = props.onSelect,
12519
- onDelete = props.onDelete,
12520
- onModeChange = props.onModeChange;
12521
- var refModal = useRef();
12522
- var handleDelete = function handleDelete(record, index) {
12523
- onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
12524
- var newList = _toConsumableArray(value).filter(function (item, i) {
12525
- return index !== i;
12526
- });
12527
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
12528
- };
12529
- var _useState = useState([]),
12530
- _useState2 = _slicedToArray(_useState, 2),
12531
- selectedRowKeys = _useState2[0],
12532
- setSelectedRowKeys = _useState2[1];
12533
- useEffect(function () {
12534
- setSelectedRowKeys([]);
12535
- }, [tableSelect, selectType]);
12536
- var updateHandle = function updateHandle(val, index, columnType) {
12537
- if (value === null || value === void 0 ? void 0 : value.length) {
12538
- value[index][columnType] = val;
12539
- if (type === 'WDT_RETURN_GOODS') {
12540
- if (['sharePrice', 'num'].includes(columnType)) {
12541
- var totalMoney = null;
12542
- if (columnType === 'num') {
12543
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
12544
- } else {
12545
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
12475
+ var getColumns = function getColumns(_ref) {
12476
+ var _ref$text = _ref.text,
12477
+ text = _ref$text === void 0 ? '' : _ref$text,
12478
+ disabled = _ref.disabled,
12479
+ updateHandle = _ref.updateHandle;
12480
+ return {
12481
+ //百胜E3补发商品
12482
+ BS_E3_REISSUE_GOODS: [{
12483
+ dataIndex: 'sku',
12484
+ title: "SKU",
12485
+ width: 150
12486
+ }, {
12487
+ dataIndex: 'skuId',
12488
+ title: "SKU ID",
12489
+ width: 150
12490
+ }, {
12491
+ dataIndex: 'goodsName',
12492
+ title: "\u5546\u54C1\u540D\u79F0",
12493
+ width: 150
12494
+ }, {
12495
+ dataIndex: 'goodsShortName',
12496
+ title: "\u5546\u54C1\u7B80\u79F0",
12497
+ width: 150
12498
+ }, {
12499
+ dataIndex: 'picPath',
12500
+ title: "\u5546\u54C1\u56FE\u7247",
12501
+ width: 150
12502
+ }, {
12503
+ dataIndex: 'goodsSn',
12504
+ title: "\u8D27\u53F7",
12505
+ width: 150
12506
+ }, {
12507
+ dataIndex: 'goodsId',
12508
+ title: "\u8D27\u53F7ID",
12509
+ width: 150
12510
+ }, {
12511
+ dataIndex: 'colorName',
12512
+ title: "\u989C\u8272\u540D\u79F0",
12513
+ width: 150
12514
+ }, {
12515
+ dataIndex: 'colorCode',
12516
+ title: "\u989C\u8272\u4EE3\u7801",
12517
+ width: 150
12518
+ }, {
12519
+ dataIndex: 'sizeName',
12520
+ title: "\u5C3A\u7801\u540D\u79F0",
12521
+ width: 150
12522
+ }, {
12523
+ dataIndex: 'sizeCode',
12524
+ title: "\u5C3A\u7801\u4EE3\u7801",
12525
+ width: 150
12526
+ }, {
12527
+ dataIndex: 'brandName',
12528
+ title: "\u54C1\u724C\u540D\u79F0",
12529
+ width: 150
12530
+ }, {
12531
+ dataIndex: 'goodsNumber',
12532
+ title: "\u5546\u54C1\u6570\u91CF",
12533
+ width: 150
12534
+ }, {
12535
+ dataIndex: 'goodsPrice',
12536
+ title: "\u5546\u54C1\u5355\u4EF7",
12537
+ width: 150
12538
+ }, {
12539
+ dataIndex: 'shopPrice',
12540
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12541
+ width: 150
12542
+ }, {
12543
+ dataIndex: 'isGift',
12544
+ title: "\u662F\u5426\u8D60\u54C1",
12545
+ width: 150,
12546
+ render: function render(val) {
12547
+ return /*#__PURE__*/React.createElement("span", null, +val ? '是' : '否');
12548
+ }
12549
+ }],
12550
+ //百胜E3商品信息
12551
+ BS_E3_GOODS: [{
12552
+ dataIndex: 'sku',
12553
+ title: "SKU",
12554
+ align: 'center',
12555
+ ellipsis: true,
12556
+ width: 150
12557
+ }, {
12558
+ dataIndex: 'skuId',
12559
+ title: "SKU ID",
12560
+ align: 'center',
12561
+ ellipsis: true,
12562
+ width: 150
12563
+ }, {
12564
+ dataIndex: 'goodsName',
12565
+ title: "\u5546\u54C1\u540D\u79F0",
12566
+ align: 'center',
12567
+ ellipsis: true,
12568
+ width: 150
12569
+ }, {
12570
+ dataIndex: 'goodsShortName',
12571
+ title: "\u5546\u54C1\u7B80\u79F0",
12572
+ align: 'center',
12573
+ ellipsis: true,
12574
+ width: 100
12575
+ }, {
12576
+ dataIndex: 'picPath',
12577
+ title: "\u5546\u54C1\u56FE\u7247",
12578
+ align: 'center',
12579
+ ellipsis: true,
12580
+ width: 100,
12581
+ render: function render(val) {
12582
+ return /*#__PURE__*/React.createElement(Image, {
12583
+ width: 60,
12584
+ src: val
12585
+ });
12586
+ }
12587
+ }, {
12588
+ dataIndex: 'goodsSn',
12589
+ title: "\u8D27\u53F7",
12590
+ align: 'center',
12591
+ ellipsis: true,
12592
+ width: 150
12593
+ }, {
12594
+ dataIndex: 'goodsId',
12595
+ title: "\u8D27\u53F7ID",
12596
+ align: 'center',
12597
+ ellipsis: true,
12598
+ width: 150
12599
+ }, {
12600
+ dataIndex: 'colorName',
12601
+ title: "\u989C\u8272\u540D\u79F0",
12602
+ align: 'center',
12603
+ ellipsis: true,
12604
+ width: 100
12605
+ }, {
12606
+ dataIndex: 'colorCode',
12607
+ title: "\u989C\u8272\u4EE3\u7801",
12608
+ align: 'center',
12609
+ ellipsis: true,
12610
+ width: 150
12611
+ }, {
12612
+ dataIndex: 'sizeName',
12613
+ title: "\u5C3A\u7801\u540D\u79F0",
12614
+ align: 'center',
12615
+ ellipsis: true,
12616
+ width: 100
12617
+ }, {
12618
+ dataIndex: 'sizeCode',
12619
+ title: "\u5C3A\u7801\u4EE3\u7801",
12620
+ align: 'center',
12621
+ ellipsis: true,
12622
+ width: 100
12623
+ }, {
12624
+ dataIndex: 'brandName',
12625
+ title: "\u54C1\u724C\u540D\u79F0",
12626
+ align: 'center',
12627
+ ellipsis: true,
12628
+ width: 150
12629
+ }, {
12630
+ dataIndex: 'goodsNumber',
12631
+ title: "\u5546\u54C1\u6570\u91CF",
12632
+ align: 'center',
12633
+ ellipsis: true,
12634
+ width: 100,
12635
+ render: function render(val, record, index) {
12636
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12637
+ style: {
12638
+ width: 70
12639
+ },
12640
+ value: val,
12641
+ min: 1,
12642
+ precision: 0,
12643
+ onChange: function onChange(num) {
12644
+ return updateHandle(num, index, 'goodsNumber');
12546
12645
  }
12547
- if (totalMoney !== null) {
12548
- value[index]['returnPrice'] = totalMoney.toString();
12646
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12647
+ }
12648
+ }, {
12649
+ dataIndex: 'goodsPrice',
12650
+ title: "\u5546\u54C1\u5355\u4EF7",
12651
+ align: 'center',
12652
+ ellipsis: true,
12653
+ width: 120,
12654
+ render: function render(val, record, index) {
12655
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12656
+ style: {
12657
+ width: 70
12658
+ },
12659
+ value: val,
12660
+ min: 0,
12661
+ precision: 2,
12662
+ onChange: function onChange(num) {
12663
+ return updateHandle(num, index, 'goodsPrice');
12549
12664
  }
12550
- }
12551
- } else if (type === 'WDT_EXCHANGE_GOODS') {
12552
- if (['price', 'num'].includes(columnType)) {
12665
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12666
+ }
12667
+ }, {
12668
+ dataIndex: 'shopPrice',
12669
+ title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
12670
+ align: 'center',
12671
+ ellipsis: true,
12672
+ width: 120
12673
+ }, {
12674
+ dataIndex: 'sharePrice',
12675
+ title: "\u5206\u644A\u4EF7",
12676
+ align: 'center',
12677
+ ellipsis: true,
12678
+ width: 120
12679
+ }, {
12680
+ dataIndex: 'sharePayment',
12681
+ title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
12682
+ align: 'center',
12683
+ ellipsis: true,
12684
+ width: 120
12685
+ }, {
12686
+ dataIndex: 'payment',
12687
+ title: "\u5B9E\u4ED8\u91D1\u989D",
12688
+ align: 'center',
12689
+ ellipsis: true,
12690
+ width: 120,
12691
+ render: function render(val, record, index) {
12692
+ return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12693
+ style: {
12694
+ width: 70
12695
+ },
12696
+ value: val,
12697
+ min: 0,
12698
+ precision: 2,
12699
+ onChange: function onChange(num) {
12700
+ return updateHandle(num, index, 'payment');
12701
+ }
12702
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12703
+ }
12704
+ }, {
12705
+ dataIndex: 'tcSku',
12706
+ title: "\u5957\u9910SKU",
12707
+ align: 'center',
12708
+ ellipsis: true,
12709
+ width: 150
12710
+ }, {
12711
+ dataIndex: 'tcGoodsNumber',
12712
+ title: "\u5957\u9910\u5957\u6570",
12713
+ align: 'center',
12714
+ ellipsis: true,
12715
+ width: 100
12716
+ }, {
12717
+ dataIndex: 'taoCanSingleSl',
12718
+ title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
12719
+ align: 'center',
12720
+ ellipsis: true,
12721
+ width: 100
12722
+ }, {
12723
+ dataIndex: 'isGift',
12724
+ title: "\u662F\u5426\u8D60\u54C1",
12725
+ align: 'center',
12726
+ ellipsis: true,
12727
+ width: 100,
12728
+ render: function render(val) {
12729
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
12730
+ }
12731
+ }],
12732
+ BS_GOODS: [{
12733
+ dataIndex: 'mark',
12734
+ title: "\u5546\u54C1\u6807\u8BB0",
12735
+ align: 'center',
12736
+ ellipsis: true,
12737
+ width: 70,
12738
+ render: function render(val, record, index) {
12739
+ return /*#__PURE__*/React.createElement(Select, {
12740
+ options: [{
12741
+ label: '是',
12742
+ value: '是'
12743
+ }, {
12744
+ label: '否',
12745
+ value: '否'
12746
+ }],
12747
+ disabled: disabled,
12748
+ value: val,
12749
+ onChange: function onChange(val) {
12750
+ return updateHandle(val, index, 'mark');
12751
+ }
12752
+ });
12753
+ }
12754
+ }, {
12755
+ dataIndex: 'skuName',
12756
+ title: "".concat(text, "sku\u540D\u79F0"),
12757
+ align: 'center',
12758
+ ellipsis: true,
12759
+ width: 250
12760
+ }, {
12761
+ dataIndex: 'sku',
12762
+ title: "".concat(text, "sku\u7F16\u7801"),
12763
+ align: 'center',
12764
+ ellipsis: true,
12765
+ width: 100
12766
+ }, {
12767
+ dataIndex: 'name',
12768
+ title: "".concat(text, "\u540D\u79F0"),
12769
+ align: 'center',
12770
+ ellipsis: true,
12771
+ width: 250
12772
+ }, {
12773
+ dataIndex: 'pic',
12774
+ title: "\u56FE\u7247",
12775
+ align: 'center',
12776
+ ellipsis: true,
12777
+ width: 100,
12778
+ render: function render(val) {
12779
+ return /*#__PURE__*/React.createElement(Image, {
12780
+ width: 60,
12781
+ src: val
12782
+ });
12783
+ }
12784
+ }, {
12785
+ dataIndex: 'code',
12786
+ title: "".concat(text, "\u7F16\u7801"),
12787
+ align: 'center',
12788
+ ellipsis: true,
12789
+ width: 100
12790
+ }, {
12791
+ dataIndex: 'money',
12792
+ title: "\u5B9E\u4ED8\u91D1\u989D",
12793
+ align: 'center',
12794
+ ellipsis: true,
12795
+ width: 100
12796
+ }, {
12797
+ dataIndex: 'number',
12798
+ title: "".concat(text, "\u6570\u91CF"),
12799
+ align: 'center',
12800
+ ellipsis: true,
12801
+ width: 100,
12802
+ render: function render(val, record, index) {
12803
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12804
+ style: {
12805
+ width: 70
12806
+ },
12807
+ value: val,
12808
+ min: 1,
12809
+ precision: 0,
12810
+ onChange: function onChange(num) {
12811
+ return updateHandle(num, index, 'number');
12812
+ }
12813
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12814
+ }
12815
+ }, {
12816
+ dataIndex: 'share',
12817
+ title: "\u5206\u644A\u4EF7",
12818
+ align: 'center',
12819
+ ellipsis: true,
12820
+ width: 70
12821
+ }, {
12822
+ dataIndex: 'type',
12823
+ title: "\u8D60\u54C1\u7C7B\u578B",
12824
+ align: 'center',
12825
+ ellipsis: true,
12826
+ width: 100
12827
+ }, {
12828
+ dataIndex: 'batch',
12829
+ title: "\u6279\u6B21\u53F7",
12830
+ align: 'center',
12831
+ ellipsis: true,
12832
+ width: 100
12833
+ }, {
12834
+ dataIndex: 'expireDate',
12835
+ title: "\u6709\u6548\u671F",
12836
+ align: 'center',
12837
+ ellipsis: true,
12838
+ width: 100
12839
+ }]
12840
+ };
12841
+ };
12842
+
12843
+ var renderGiftType = function renderGiftType(val) {
12844
+ var giftTypeMap = {
12845
+ 0: '非赠品',
12846
+ 1: '自动赠送',
12847
+ 2: '手工赠送',
12848
+ 3: '回购自动送赠品',
12849
+ 4: '前N有礼送赠品',
12850
+ 6: '天猫优仓赠品',
12851
+ 7: '淘宝CRM会员送赠'
12852
+ };
12853
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12854
+ };
12855
+ var renderFieldMap = {
12856
+ num: function num(_ref) {
12857
+ var disabled = _ref.disabled,
12858
+ updateHandle = _ref.updateHandle;
12859
+ return function (val, record, index) {
12860
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12861
+ style: {
12862
+ width: 70
12863
+ },
12864
+ value: val,
12865
+ min: 1,
12866
+ precision: 0,
12867
+ onChange: function onChange(num) {
12868
+ return updateHandle(num, index, 'num');
12869
+ }
12870
+ }) : /*#__PURE__*/React.createElement("span", null, val);
12871
+ };
12872
+ },
12873
+ giftType: function giftType() {
12874
+ return renderGiftType;
12875
+ }
12876
+ };
12877
+ var getWdtReissueGoodColumns = function getWdtReissueGoodColumns(_ref2) {
12878
+ var disabled = _ref2.disabled,
12879
+ updateHandle = _ref2.updateHandle,
12880
+ operate = _ref2.operate;
12881
+ return getColumnsMap()['WDT_REISSUE_GOODS'].map(function (item) {
12882
+ var newItem = _objectSpread2({
12883
+ align: 'center',
12884
+ ellipsis: true
12885
+ }, item);
12886
+ if (operate && (renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex])) {
12887
+ return _objectSpread2(_objectSpread2({}, newItem), {}, {
12888
+ render: renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex]({
12889
+ disabled: disabled,
12890
+ updateHandle: updateHandle
12891
+ })
12892
+ });
12893
+ }
12894
+ return newItem;
12895
+ });
12896
+ };
12897
+
12898
+ var getColumns$1 = function getColumns(_ref) {
12899
+ var _ref$text = _ref.text,
12900
+ text = _ref$text === void 0 ? '' : _ref$text,
12901
+ disabled = _ref.disabled,
12902
+ updateHandle = _ref.updateHandle;
12903
+ return {
12904
+ //旺店通补发商品信息
12905
+ WDT_REISSUE_GOODS: [{
12906
+ dataIndex: 'goodId',
12907
+ title: "\u5546\u54C1ID",
12908
+ width: 120
12909
+ }, {
12910
+ dataIndex: 'goodNo',
12911
+ title: "\u5546\u54C1\u7F16\u7801",
12912
+ width: 200
12913
+ }, {
12914
+ dataIndex: 'goodName',
12915
+ title: "\u5546\u54C1\u540D\u79F0",
12916
+ width: 200
12917
+ }, {
12918
+ dataIndex: 'specId',
12919
+ title: "SKUID",
12920
+ width: 150
12921
+ }, {
12922
+ dataIndex: 'specNo',
12923
+ title: "\u5546\u54C1SKU\u7F16\u7801",
12924
+ width: 200
12925
+ }, {
12926
+ dataIndex: 'specName',
12927
+ title: "\u5546\u54C1SKU\u540D\u79F0",
12928
+ width: 250
12929
+ }, {
12930
+ dataIndex: 'orderPrice',
12931
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
12932
+ width: 200
12933
+ }, {
12934
+ dataIndex: 'num',
12935
+ title: "\u6570\u91CF",
12936
+ width: 100
12937
+ }, {
12938
+ dataIndex: 'sharePrice',
12939
+ title: "\u5206\u644A\u4EF7",
12940
+ width: 150
12941
+ }, {
12942
+ dataIndex: 'giftType',
12943
+ title: "\u8D60\u54C1\u65B9\u5F0F",
12944
+ width: 100,
12945
+ render: renderGiftType
12946
+ }],
12947
+ //旺店通商品信息
12948
+ WDT_GOODS: [{
12949
+ dataIndex: 'goodId',
12950
+ title: "\u5546\u54C1ID",
12951
+ align: 'center',
12952
+ ellipsis: true,
12953
+ width: 70
12954
+ }, {
12955
+ dataIndex: 'goodNo',
12956
+ title: "\u5546\u54C1\u7F16\u7801",
12957
+ align: 'center',
12958
+ ellipsis: true,
12959
+ width: 180
12960
+ }, {
12961
+ dataIndex: 'goodName',
12962
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12963
+ align: 'center',
12964
+ ellipsis: true,
12965
+ width: 250
12966
+ }, {
12967
+ dataIndex: 'specId',
12968
+ title: "".concat(text, "SKUID"),
12969
+ align: 'center',
12970
+ ellipsis: true,
12971
+ width: 100
12972
+ }, {
12973
+ dataIndex: 'specNo',
12974
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12975
+ align: 'center',
12976
+ ellipsis: true,
12977
+ width: 180
12978
+ }, {
12979
+ dataIndex: 'specName',
12980
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12981
+ align: 'center',
12982
+ ellipsis: true,
12983
+ width: 250
12984
+ }, {
12985
+ dataIndex: 'orderPrice',
12986
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
12987
+ align: 'center',
12988
+ ellipsis: true,
12989
+ width: 100
12990
+ }, {
12991
+ dataIndex: 'num',
12992
+ title: "".concat(text, "\u6570\u91CF"),
12993
+ align: 'center',
12994
+ ellipsis: true,
12995
+ width: 100,
12996
+ render: function render(val, record, index) {
12997
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12998
+ style: {
12999
+ width: 70
13000
+ },
13001
+ value: val,
13002
+ min: 1,
13003
+ precision: 0,
13004
+ onChange: function onChange(num) {
13005
+ return updateHandle(num, index, 'num');
13006
+ }
13007
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13008
+ }
13009
+ }, {
13010
+ dataIndex: 'sharePrice',
13011
+ title: "\u5206\u644A\u4EF7",
13012
+ align: 'center',
13013
+ ellipsis: true,
13014
+ width: 70
13015
+ }, {
13016
+ dataIndex: 'giftType',
13017
+ title: "\u8D60\u54C1\u65B9\u5F0F",
13018
+ align: 'center',
13019
+ ellipsis: true,
13020
+ width: 100,
13021
+ render: function render(val) {
13022
+ var giftTypeMap = {
13023
+ 0: '非赠品',
13024
+ 1: '自动赠送',
13025
+ 2: '手工赠送',
13026
+ 3: '回购自动送赠品',
13027
+ 4: '前N有礼送赠品',
13028
+ 6: '天猫优仓赠品',
13029
+ 7: '淘宝CRM会员送赠'
13030
+ };
13031
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
13032
+ }
13033
+ }],
13034
+ //旺店通退货商品信息
13035
+ WDT_RETURN_GOODS: [{
13036
+ dataIndex: 'goodId',
13037
+ title: "\u5546\u54C1ID",
13038
+ align: 'center',
13039
+ ellipsis: true,
13040
+ width: 70
13041
+ }, {
13042
+ dataIndex: 'goodNo',
13043
+ title: "\u5546\u54C1\u7F16\u7801",
13044
+ align: 'center',
13045
+ ellipsis: true,
13046
+ width: 180
13047
+ }, {
13048
+ dataIndex: 'goodName',
13049
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13050
+ align: 'center',
13051
+ ellipsis: true,
13052
+ width: 250
13053
+ }, {
13054
+ dataIndex: 'specId',
13055
+ title: "".concat(text, "SKUID"),
13056
+ align: 'center',
13057
+ ellipsis: true,
13058
+ width: 100
13059
+ }, {
13060
+ dataIndex: 'specNo',
13061
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
13062
+ align: 'center',
13063
+ ellipsis: true,
13064
+ width: 180
13065
+ }, {
13066
+ dataIndex: 'specName',
13067
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13068
+ align: 'center',
13069
+ ellipsis: true,
13070
+ width: 250
13071
+ }, {
13072
+ dataIndex: 'num',
13073
+ title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
13074
+ align: 'center',
13075
+ ellipsis: true,
13076
+ width: 100,
13077
+ render: function render(val, record, index) {
13078
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13079
+ style: {
13080
+ width: 70
13081
+ },
13082
+ value: val,
13083
+ min: 1,
13084
+ precision: 0,
13085
+ onChange: function onChange(num) {
13086
+ return updateHandle(num, index, 'num');
13087
+ }
13088
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13089
+ }
13090
+ }, {
13091
+ dataIndex: 'sharePrice',
13092
+ title: "\u5206\u644A\u4EF7",
13093
+ align: 'center',
13094
+ ellipsis: true,
13095
+ width: 80,
13096
+ render: function render(val, record, index) {
13097
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13098
+ style: {
13099
+ width: 70
13100
+ },
13101
+ value: val,
13102
+ min: 0,
13103
+ onChange: function onChange(value) {
13104
+ return updateHandle(value, index, 'sharePrice');
13105
+ }
13106
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13107
+ }
13108
+ }, {
13109
+ dataIndex: 'returnPrice',
13110
+ title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
13111
+ align: 'center',
13112
+ ellipsis: true,
13113
+ width: 100
13114
+ }, {
13115
+ dataIndex: 'giftType',
13116
+ title: "\u8D60\u54C1\u65B9\u5F0F",
13117
+ align: 'center',
13118
+ ellipsis: true,
13119
+ width: 100,
13120
+ render: function render(val) {
13121
+ var giftTypeMap = {
13122
+ 0: '非赠品',
13123
+ 1: '自动赠送',
13124
+ 2: '手工赠送',
13125
+ 3: '回购自动送赠品',
13126
+ 4: '前N有礼送赠品',
13127
+ 6: '天猫优仓赠品',
13128
+ 7: '淘宝CRM会员送赠'
13129
+ };
13130
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
13131
+ }
13132
+ }, {
13133
+ dataIndex: 'type',
13134
+ title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
13135
+ align: 'center',
13136
+ ellipsis: true,
13137
+ width: 100,
13138
+ render: function render(val, record, index) {
13139
+ var options = [{
13140
+ label: '单品',
13141
+ value: '1'
13142
+ }, {
13143
+ label: '组合装',
13144
+ value: '2'
13145
+ }];
13146
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
13147
+ style: {
13148
+ width: 70
13149
+ },
13150
+ options: options,
13151
+ value: val,
13152
+ onChange: function onChange(value) {
13153
+ return updateHandle(value, index, 'type');
13154
+ }
13155
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13156
+ }
13157
+ }],
13158
+ //旺店通换出商品信息
13159
+ WDT_EXCHANGE_GOODS: [{
13160
+ dataIndex: 'goodId',
13161
+ title: "\u5546\u54C1ID",
13162
+ align: 'center',
13163
+ ellipsis: true,
13164
+ width: 70
13165
+ }, {
13166
+ dataIndex: 'goodNo',
13167
+ title: "\u5546\u54C1\u7F16\u7801",
13168
+ align: 'center',
13169
+ ellipsis: true,
13170
+ width: 180
13171
+ }, {
13172
+ dataIndex: 'goodName',
13173
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
13174
+ align: 'center',
13175
+ ellipsis: true,
13176
+ width: 250
13177
+ }, {
13178
+ dataIndex: 'specId',
13179
+ title: "".concat(text, "SKUID"),
13180
+ align: 'center',
13181
+ ellipsis: true,
13182
+ width: 100
13183
+ }, {
13184
+ dataIndex: 'specNo',
13185
+ title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
13186
+ align: 'center',
13187
+ ellipsis: true,
13188
+ width: 180
13189
+ }, {
13190
+ dataIndex: 'specName',
13191
+ title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
13192
+ align: 'center',
13193
+ ellipsis: true,
13194
+ width: 250
13195
+ }, {
13196
+ dataIndex: 'num',
13197
+ title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
13198
+ align: 'center',
13199
+ ellipsis: true,
13200
+ width: 100,
13201
+ render: function render(val, record, index) {
13202
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13203
+ style: {
13204
+ width: 70
13205
+ },
13206
+ value: val,
13207
+ min: 1,
13208
+ precision: 0,
13209
+ onChange: function onChange(num) {
13210
+ return updateHandle(num, index, 'num');
13211
+ }
13212
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13213
+ }
13214
+ }, {
13215
+ dataIndex: 'price',
13216
+ title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
13217
+ align: 'center',
13218
+ ellipsis: true,
13219
+ width: 100,
13220
+ render: function render(val, record, index) {
13221
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13222
+ style: {
13223
+ width: 70
13224
+ },
13225
+ value: val,
13226
+ min: 0,
13227
+ onChange: function onChange(value) {
13228
+ return updateHandle(value, index, 'price');
13229
+ }
13230
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13231
+ }
13232
+ }, {
13233
+ dataIndex: 'exchangePrice',
13234
+ title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
13235
+ align: 'center',
13236
+ ellipsis: true,
13237
+ width: 100
13238
+ }, {
13239
+ dataIndex: 'giftType',
13240
+ title: "\u8D60\u54C1\u65B9\u5F0F",
13241
+ align: 'center',
13242
+ ellipsis: true,
13243
+ width: 100,
13244
+ render: function render(val) {
13245
+ var giftTypeMap = {
13246
+ 0: '非赠品',
13247
+ 1: '自动赠送',
13248
+ 2: '手工赠送',
13249
+ 3: '回购自动送赠品',
13250
+ 4: '前N有礼送赠品',
13251
+ 6: '天猫优仓赠品',
13252
+ 7: '淘宝CRM会员送赠'
13253
+ };
13254
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
13255
+ }
13256
+ }, {
13257
+ dataIndex: 'type',
13258
+ title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
13259
+ align: 'center',
13260
+ ellipsis: true,
13261
+ width: 100,
13262
+ render: function render(val, record, index) {
13263
+ var options = [{
13264
+ label: '单品',
13265
+ value: '1'
13266
+ }, {
13267
+ label: '组合装',
13268
+ value: '2'
13269
+ }];
13270
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
13271
+ style: {
13272
+ width: 70
13273
+ },
13274
+ options: options,
13275
+ value: val,
13276
+ onChange: function onChange(value) {
13277
+ return updateHandle(value, index, 'type');
13278
+ }
13279
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13280
+ }
13281
+ }]
13282
+ };
13283
+ };
13284
+
13285
+ var getColumns$2 = function getColumns(_ref) {
13286
+ var _ref$text = _ref.text,
13287
+ text = _ref$text === void 0 ? '' : _ref$text,
13288
+ disabled = _ref.disabled,
13289
+ updateHandle = _ref.updateHandle;
13290
+ return {
13291
+ //万里牛商品信息
13292
+ WLN_GOODS: [{
13293
+ dataIndex: 'skuName',
13294
+ title: "".concat(text, "sku\u540D\u79F0"),
13295
+ align: 'center',
13296
+ ellipsis: true,
13297
+ width: 250
13298
+ }, {
13299
+ dataIndex: 'sku',
13300
+ title: "".concat(text, "sku\u7F16\u7801"),
13301
+ align: 'center',
13302
+ ellipsis: true,
13303
+ width: 100
13304
+ }, {
13305
+ dataIndex: 'name',
13306
+ title: "".concat(text, "\u540D\u79F0"),
13307
+ align: 'center',
13308
+ ellipsis: true,
13309
+ width: 250
13310
+ }, {
13311
+ dataIndex: 'pic',
13312
+ title: "\u56FE\u7247",
13313
+ align: 'center',
13314
+ ellipsis: true,
13315
+ width: 100,
13316
+ render: function render(val) {
13317
+ return /*#__PURE__*/React.createElement(Image, {
13318
+ width: 60,
13319
+ src: val
13320
+ });
13321
+ }
13322
+ }, {
13323
+ dataIndex: 'code',
13324
+ title: "".concat(text, "\u7F16\u7801"),
13325
+ align: 'center',
13326
+ ellipsis: true,
13327
+ width: 100
13328
+ }, {
13329
+ dataIndex: 'money',
13330
+ title: "\u5B9E\u4ED8\u91D1\u989D",
13331
+ align: 'center',
13332
+ ellipsis: true,
13333
+ width: 100
13334
+ }, {
13335
+ dataIndex: 'number',
13336
+ title: "".concat(text, "\u6570\u91CF"),
13337
+ align: 'center',
13338
+ ellipsis: true,
13339
+ width: 100,
13340
+ render: function render(val, record, index) {
13341
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13342
+ style: {
13343
+ width: 70
13344
+ },
13345
+ value: val,
13346
+ min: 1,
13347
+ precision: 0,
13348
+ onChange: function onChange(num) {
13349
+ return updateHandle(num, index, 'number');
13350
+ }
13351
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13352
+ }
13353
+ }, {
13354
+ dataIndex: 'share',
13355
+ title: "\u5206\u644A\u4EF7",
13356
+ align: 'center',
13357
+ ellipsis: true,
13358
+ width: 70
13359
+ }, {
13360
+ dataIndex: 'type',
13361
+ title: "\u8D60\u54C1\u7C7B\u578B",
13362
+ align: 'center',
13363
+ ellipsis: true,
13364
+ width: 100
13365
+ }]
13366
+ };
13367
+ };
13368
+
13369
+ var getColumnsMap = function getColumnsMap(args) {
13370
+ var _ref = args || {},
13371
+ _ref$text = _ref.text,
13372
+ text = _ref$text === void 0 ? '' : _ref$text,
13373
+ disabled = _ref.disabled,
13374
+ updateHandle = _ref.updateHandle;
13375
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, getColumns({
13376
+ text: text,
13377
+ disabled: disabled,
13378
+ updateHandle: updateHandle
13379
+ })), getColumns$1({
13380
+ text: text,
13381
+ disabled: disabled,
13382
+ updateHandle: updateHandle
13383
+ })), getColumns$2({
13384
+ text: text,
13385
+ disabled: disabled,
13386
+ updateHandle: updateHandle
13387
+ })), {}, {
13388
+ default: [{
13389
+ dataIndex: 'mark',
13390
+ title: "\u5546\u54C1\u6807\u8BB0",
13391
+ align: 'center',
13392
+ ellipsis: true,
13393
+ width: 70,
13394
+ render: function render(val, record, index) {
13395
+ return /*#__PURE__*/React.createElement(Select, {
13396
+ options: [{
13397
+ label: '是',
13398
+ value: '是'
13399
+ }, {
13400
+ label: '否',
13401
+ value: '否'
13402
+ }],
13403
+ disabled: disabled,
13404
+ value: val,
13405
+ onChange: function onChange(val) {
13406
+ return updateHandle(val, index, 'mark');
13407
+ }
13408
+ });
13409
+ }
13410
+ }, {
13411
+ dataIndex: 'skuName',
13412
+ title: "".concat(text, "sku\u540D\u79F0"),
13413
+ align: 'center',
13414
+ ellipsis: true,
13415
+ width: 250
13416
+ }, {
13417
+ dataIndex: 'sku',
13418
+ title: "".concat(text, "sku\u7F16\u7801"),
13419
+ align: 'center',
13420
+ ellipsis: true,
13421
+ width: 100
13422
+ }, {
13423
+ dataIndex: 'name',
13424
+ title: "".concat(text, "\u540D\u79F0"),
13425
+ align: 'center',
13426
+ ellipsis: true,
13427
+ width: 250
13428
+ }, {
13429
+ dataIndex: 'pic',
13430
+ title: "\u56FE\u7247",
13431
+ align: 'center',
13432
+ ellipsis: true,
13433
+ width: 100,
13434
+ render: function render(val) {
13435
+ return /*#__PURE__*/React.createElement(Image, {
13436
+ width: 60,
13437
+ src: val
13438
+ });
13439
+ }
13440
+ }, {
13441
+ dataIndex: 'code',
13442
+ title: "".concat(text, "\u7F16\u7801"),
13443
+ align: 'center',
13444
+ ellipsis: true,
13445
+ width: 100
13446
+ }, {
13447
+ dataIndex: 'money',
13448
+ title: "\u5B9E\u4ED8\u91D1\u989D",
13449
+ align: 'center',
13450
+ ellipsis: true,
13451
+ width: 100
13452
+ }, {
13453
+ dataIndex: 'number',
13454
+ title: "".concat(text, "\u6570\u91CF"),
13455
+ align: 'center',
13456
+ ellipsis: true,
13457
+ width: 100,
13458
+ render: function render(val, record, index) {
13459
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13460
+ style: {
13461
+ width: 70
13462
+ },
13463
+ value: val,
13464
+ min: 1,
13465
+ precision: 0,
13466
+ onChange: function onChange(num) {
13467
+ return updateHandle(num, index, 'number');
13468
+ }
13469
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13470
+ }
13471
+ }, {
13472
+ dataIndex: 'share',
13473
+ title: "\u5206\u644A\u4EF7",
13474
+ align: 'center',
13475
+ ellipsis: true,
13476
+ width: 70
13477
+ }, {
13478
+ dataIndex: 'type',
13479
+ title: "\u8D60\u54C1\u7C7B\u578B",
13480
+ align: 'center',
13481
+ ellipsis: true,
13482
+ width: 100
13483
+ }]
13484
+ });
13485
+ };
13486
+ var getColumnsBaseInfo = function getColumnsBaseInfo() {
13487
+ var clone_columnsMap = cloneDeep(getColumnsMap());
13488
+ var newColumns = {};
13489
+ Object.keys(clone_columnsMap).forEach(function (key) {
13490
+ newColumns[key] = clone_columnsMap[key].map(function (col) {
13491
+ return {
13492
+ title: col.title,
13493
+ dataIndex: col.dataIndex
13494
+ };
13495
+ });
13496
+ });
13497
+ return newColumns;
13498
+ };
13499
+ var columnsBaseInfoMap = getColumnsBaseInfo();
13500
+
13501
+ var renderFieldMap$1 = {
13502
+ goodsNumber: function goodsNumber(_ref) {
13503
+ var disabled = _ref.disabled,
13504
+ updateHandle = _ref.updateHandle;
13505
+ return function (val, record, index) {
13506
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13507
+ style: {
13508
+ width: 70
13509
+ },
13510
+ value: val,
13511
+ min: 1,
13512
+ precision: 0,
13513
+ onChange: function onChange(num) {
13514
+ return updateHandle(num, index, 'goodsNumber');
13515
+ }
13516
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13517
+ };
13518
+ },
13519
+ goodsPrice: function goodsPrice(_ref2) {
13520
+ var disabled = _ref2.disabled,
13521
+ updateHandle = _ref2.updateHandle;
13522
+ return function (val, record, index) {
13523
+ return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13524
+ style: {
13525
+ width: 70
13526
+ },
13527
+ value: val,
13528
+ min: 0,
13529
+ onChange: function onChange(value) {
13530
+ return updateHandle(value, index, 'goodsPrice');
13531
+ }
13532
+ }) : /*#__PURE__*/React.createElement("span", null, val);
13533
+ };
13534
+ },
13535
+ isGift: function isGift(_ref3) {
13536
+ var disabled = _ref3.disabled,
13537
+ updateHandle = _ref3.updateHandle;
13538
+ return function (val, record, index) {
13539
+ var options = [{
13540
+ label: '是',
13541
+ value: 1
13542
+ }, {
13543
+ label: '否',
13544
+ value: 0
13545
+ }];
13546
+ return !disabled ? /*#__PURE__*/React.createElement(Select, {
13547
+ style: {
13548
+ width: 70
13549
+ },
13550
+ options: options,
13551
+ value: val,
13552
+ onChange: function onChange(value) {
13553
+ return updateHandle(value, index, 'isGift');
13554
+ },
13555
+ getPopupContainer: function getPopupContainer() {
13556
+ return document.getElementById('bsE3ReissueGoods');
13557
+ }
13558
+ }) : /*#__PURE__*/React.createElement("span", null, +val ? '是' : '否');
13559
+ };
13560
+ }
13561
+ };
13562
+ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
13563
+ var disabled = _ref4.disabled,
13564
+ updateHandle = _ref4.updateHandle,
13565
+ operate = _ref4.operate;
13566
+ return getColumnsMap()['BS_E3_REISSUE_GOODS'].map(function (item) {
13567
+ var newItem = _objectSpread2({
13568
+ align: 'center',
13569
+ ellipsis: true
13570
+ }, item);
13571
+ if (operate && (renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex])) {
13572
+ return _objectSpread2(_objectSpread2({}, newItem), {}, {
13573
+ render: renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex]({
13574
+ disabled: disabled,
13575
+ updateHandle: updateHandle
13576
+ })
13577
+ });
13578
+ }
13579
+ return newItem;
13580
+ });
13581
+ };
13582
+
13583
+ var MAIN_FIELD = 'uuid';
13584
+ var SelectTradeGoods = function SelectTradeGoods(_ref) {
13585
+ var columns = _ref.columns,
13586
+ dataSource = _ref.dataSource,
13587
+ selectedRowKeys = _ref.selectedRowKeys,
13588
+ onChangeSelectedKeys = _ref.onChangeSelectedKeys;
13589
+ var _useState = useState(false),
13590
+ _useState2 = _slicedToArray(_useState, 2),
13591
+ tradeGoodsVisible = _useState2[0],
13592
+ setTradeGoodsVisible = _useState2[1];
13593
+ var openModal = function openModal() {
13594
+ return setTradeGoodsVisible(true);
13595
+ };
13596
+ var closeModal = function closeModal() {
13597
+ return setTradeGoodsVisible(false);
13598
+ };
13599
+ var currentTradeOriginGoods = intersection(dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
13600
+ return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
13601
+ }), selectedRowKeys);
13602
+ var unCurrentTradeOriginGoods = difference(selectedRowKeys, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
13603
+ return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
13604
+ }));
13605
+ var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
13606
+ console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
13607
+ onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
13608
+ };
13609
+ var rowSelection = {
13610
+ selectedRowKeys: selectedRowKeys,
13611
+ onChange: handleChangeSelectedKeys
13612
+ };
13613
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
13614
+ type: "link",
13615
+ onClick: openModal
13616
+ }, "\u9009\u62E9\u8BA2\u5355\u5546\u54C1"), /*#__PURE__*/React.createElement(Modal, {
13617
+ title: "\u8BA2\u5355\u5546\u54C1",
13618
+ visible: tradeGoodsVisible,
13619
+ footer: null,
13620
+ onCancel: closeModal
13621
+ }, /*#__PURE__*/React.createElement(Table, {
13622
+ rowKey: MAIN_FIELD,
13623
+ rowSelection: rowSelection,
13624
+ columns: columns,
13625
+ dataSource: dataSource,
13626
+ pagination: false,
13627
+ scroll: {
13628
+ x: 500,
13629
+ y: 500
13630
+ }
13631
+ }), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/", dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, ")")));
13632
+ };
13633
+ var getButtonText = function getButtonText() {
13634
+ var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13635
+ if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
13636
+ return '选择百胜ERP商品';
13637
+ }
13638
+ if (['WDT_REISSUE_GOODS'].includes(type)) {
13639
+ return '选择旺店通商品';
13640
+ }
13641
+ return '选择商品';
13642
+ };
13643
+ var GoodItem$1 = function GoodItem(props) {
13644
+ var _props$value = props.value,
13645
+ value = _props$value === void 0 ? [] : _props$value,
13646
+ type = props.type,
13647
+ onChange = props.onChange,
13648
+ disabled = props.disabled,
13649
+ _props$showHeader = props.showHeader,
13650
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
13651
+ width = props.width,
13652
+ _props$shopList = props.shopList,
13653
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
13654
+ _props$shopId = props.shopId,
13655
+ shopId = _props$shopId === void 0 ? '' : _props$shopId,
13656
+ _props$maxLength = props.maxLength,
13657
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
13658
+ _props$showChangeBtn = props.showChangeBtn,
13659
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
13660
+ _props$showModeBtn = props.showModeBtn,
13661
+ showModeBtn = _props$showModeBtn === void 0 ? false : _props$showModeBtn,
13662
+ _props$isStrict = props.isStrict,
13663
+ isStrict = _props$isStrict === void 0 ? false : _props$isStrict,
13664
+ _props$tableSelect = props.tableSelect,
13665
+ tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
13666
+ _props$selectType = props.selectType,
13667
+ selectType = _props$selectType === void 0 ? '' : _props$selectType,
13668
+ _props$otherOperation = props.otherOperations,
13669
+ otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
13670
+ _props$canUpdateNumbe = props.canUpdateNumber,
13671
+ canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
13672
+ shopCode = props.shopCode,
13673
+ _props$companyKey = props.companyKey,
13674
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
13675
+ onSelect = props.onSelect,
13676
+ onDelete = props.onDelete,
13677
+ onModeChange = props.onModeChange,
13678
+ tradeGoods = props.tradeGoods;
13679
+ var refModal = useRef();
13680
+ console.debug('表格数据', value);
13681
+ var handleDelete = function handleDelete(record, index) {
13682
+ onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
13683
+ var newList = _toConsumableArray(value).filter(function (item, i) {
13684
+ return index !== i;
13685
+ });
13686
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
13687
+ };
13688
+ var _useState3 = useState([]),
13689
+ _useState4 = _slicedToArray(_useState3, 2),
13690
+ selectedRowKeys = _useState4[0],
13691
+ setSelectedRowKeys = _useState4[1];
13692
+ useEffect(function () {
13693
+ setSelectedRowKeys([]);
13694
+ }, [tableSelect, selectType]);
13695
+ // TODO: 商品订单中以选中商品
13696
+ var selectedGoods = useMemo(function () {
13697
+ return value === null || value === void 0 ? void 0 : value.map(function (v) {
13698
+ return v === null || v === void 0 ? void 0 : v[MAIN_FIELD];
13699
+ });
13700
+ }, [value]);
13701
+ var updateHandle = function updateHandle(val, index, columnType) {
13702
+ if (value === null || value === void 0 ? void 0 : value.length) {
13703
+ value[index][columnType] = val;
13704
+ if (type === 'WDT_RETURN_GOODS') {
13705
+ if (['sharePrice', 'num'].includes(columnType)) {
13706
+ var totalMoney = null;
13707
+ if (columnType === 'num') {
13708
+ totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
13709
+ } else {
13710
+ totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
13711
+ }
13712
+ if (totalMoney !== null) {
13713
+ value[index]['returnPrice'] = totalMoney.toString();
13714
+ }
13715
+ }
13716
+ } else if (type === 'WDT_EXCHANGE_GOODS') {
13717
+ if (['price', 'num'].includes(columnType)) {
12553
13718
  var _totalMoney = null;
12554
13719
  if (columnType === 'num') {
12555
13720
  _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
@@ -12566,600 +13731,48 @@ var GoodItem$1 = function GoodItem(props) {
12566
13731
  };
12567
13732
  var COLUMNS_MAP = function COLUMNS_MAP() {
12568
13733
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
13734
+ var operate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
12569
13735
  return function (type) {
12570
13736
  var columns = [];
12571
13737
  switch (type) {
12572
- case 'WDT_REISSUE_GOODS':
12573
13738
  case 'WDT_GOODS':
12574
- columns = [{
12575
- dataIndex: 'goodId',
12576
- title: "\u5546\u54C1ID",
12577
- align: 'center',
12578
- ellipsis: true,
12579
- width: 70
12580
- }, {
12581
- dataIndex: 'goodNo',
12582
- title: "\u5546\u54C1\u7F16\u7801",
12583
- align: 'center',
12584
- ellipsis: true,
12585
- width: 180
12586
- }, {
12587
- dataIndex: 'goodName',
12588
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12589
- align: 'center',
12590
- ellipsis: true,
12591
- width: 250
12592
- }, {
12593
- dataIndex: 'specId',
12594
- title: "".concat(text, "SKUID"),
12595
- align: 'center',
12596
- ellipsis: true,
12597
- width: 100
12598
- }, {
12599
- dataIndex: 'specNo',
12600
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12601
- align: 'center',
12602
- ellipsis: true,
12603
- width: 180
12604
- }, {
12605
- dataIndex: 'specName',
12606
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12607
- align: 'center',
12608
- ellipsis: true,
12609
- width: 250
12610
- }, {
12611
- dataIndex: 'orderPrice',
12612
- title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
12613
- align: 'center',
12614
- ellipsis: true,
12615
- width: 100
12616
- }, {
12617
- dataIndex: 'num',
12618
- title: "".concat(text, "\u6570\u91CF"),
12619
- align: 'center',
12620
- ellipsis: true,
12621
- width: 100,
12622
- render: function render(val, record, index) {
12623
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12624
- style: {
12625
- width: 70
12626
- },
12627
- value: val,
12628
- min: 1,
12629
- precision: 0,
12630
- onChange: function onChange(num) {
12631
- return updateHandle(num, index, 'num');
12632
- }
12633
- }) : /*#__PURE__*/React.createElement("span", null, val);
12634
- }
12635
- },
12636
- // {
12637
- // dataIndex: 'actualNum',
12638
- // title: `${text}实发数量`,
12639
- // align: 'center',
12640
- // ellipsis: true,
12641
- // width: 100,
12642
- // },
12643
- {
12644
- dataIndex: 'sharePrice',
12645
- title: "\u5206\u644A\u4EF7",
12646
- align: 'center',
12647
- ellipsis: true,
12648
- width: 70
12649
- }, {
12650
- dataIndex: 'giftType',
12651
- title: "\u8D60\u54C1\u65B9\u5F0F",
12652
- align: 'center',
12653
- ellipsis: true,
12654
- width: 100,
12655
- render: function render(val) {
12656
- var giftTypeMap = {
12657
- 0: '非赠品',
12658
- 1: '自动赠送',
12659
- 2: '手工赠送',
12660
- 3: '回购自动送赠品',
12661
- 4: '前N有礼送赠品',
12662
- 6: '天猫优仓赠品',
12663
- 7: '淘宝CRM会员送赠'
12664
- };
12665
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12666
- }
12667
- }];
12668
- break;
12669
13739
  case 'WDT_RETURN_GOODS':
13740
+ case 'WDT_EXCHANGE_GOODS':
13741
+ case 'BS_E3_GOODS':
13742
+ case 'BS_GOODS':
13743
+ case 'WLN_GOODS':
12670
13744
  {
12671
- columns = [{
12672
- dataIndex: 'goodId',
12673
- title: "\u5546\u54C1ID",
12674
- align: 'center',
12675
- ellipsis: true,
12676
- width: 70
12677
- }, {
12678
- dataIndex: 'goodNo',
12679
- title: "\u5546\u54C1\u7F16\u7801",
12680
- align: 'center',
12681
- ellipsis: true,
12682
- width: 180
12683
- }, {
12684
- dataIndex: 'goodName',
12685
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12686
- align: 'center',
12687
- ellipsis: true,
12688
- width: 250
12689
- }, {
12690
- dataIndex: 'specId',
12691
- title: "".concat(text, "SKUID"),
12692
- align: 'center',
12693
- ellipsis: true,
12694
- width: 100
12695
- }, {
12696
- dataIndex: 'specNo',
12697
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12698
- align: 'center',
12699
- ellipsis: true,
12700
- width: 180
12701
- }, {
12702
- dataIndex: 'specName',
12703
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12704
- align: 'center',
12705
- ellipsis: true,
12706
- width: 250
12707
- }, {
12708
- dataIndex: 'num',
12709
- title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
12710
- align: 'center',
12711
- ellipsis: true,
12712
- width: 100,
12713
- render: function render(val, record, index) {
12714
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12715
- style: {
12716
- width: 70
12717
- },
12718
- value: val,
12719
- min: 1,
12720
- precision: 0,
12721
- onChange: function onChange(num) {
12722
- return updateHandle(num, index, 'num');
12723
- }
12724
- }) : /*#__PURE__*/React.createElement("span", null, val);
12725
- }
12726
- }, {
12727
- dataIndex: 'sharePrice',
12728
- title: "\u5206\u644A\u4EF7",
12729
- align: 'center',
12730
- ellipsis: true,
12731
- width: 80,
12732
- render: function render(val, record, index) {
12733
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12734
- style: {
12735
- width: 70
12736
- },
12737
- value: val,
12738
- min: 0,
12739
- onChange: function onChange(value) {
12740
- return updateHandle(value, index, 'sharePrice');
12741
- }
12742
- }) : /*#__PURE__*/React.createElement("span", null, val);
12743
- }
12744
- }, {
12745
- dataIndex: 'returnPrice',
12746
- title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
12747
- align: 'center',
12748
- ellipsis: true,
12749
- width: 100
12750
- }, {
12751
- dataIndex: 'giftType',
12752
- title: "\u8D60\u54C1\u65B9\u5F0F",
12753
- align: 'center',
12754
- ellipsis: true,
12755
- width: 100,
12756
- render: function render(val) {
12757
- var giftTypeMap = {
12758
- 0: '非赠品',
12759
- 1: '自动赠送',
12760
- 2: '手工赠送',
12761
- 3: '回购自动送赠品',
12762
- 4: '前N有礼送赠品',
12763
- 6: '天猫优仓赠品',
12764
- 7: '淘宝CRM会员送赠'
12765
- };
12766
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12767
- }
12768
- }, {
12769
- dataIndex: 'type',
12770
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12771
- align: 'center',
12772
- ellipsis: true,
12773
- width: 100,
12774
- render: function render(val, record, index) {
12775
- var options = [{
12776
- label: '单品',
12777
- value: '1'
12778
- }, {
12779
- label: '组合装',
12780
- value: '2'
12781
- }];
12782
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
12783
- style: {
12784
- width: 70
12785
- },
12786
- options: options,
12787
- value: val,
12788
- onChange: function onChange(value) {
12789
- return updateHandle(value, index, 'type');
12790
- }
12791
- }) : /*#__PURE__*/React.createElement("span", null, val);
12792
- }
12793
- }];
13745
+ columns = getColumnsMap({
13746
+ text: text,
13747
+ disabled: disabled,
13748
+ updateHandle: updateHandle
13749
+ })[type];
12794
13750
  }
12795
13751
  break;
12796
- case 'WDT_EXCHANGE_GOODS':
13752
+ case 'WDT_REISSUE_GOODS':
12797
13753
  {
12798
- columns = [{
12799
- dataIndex: 'goodId',
12800
- title: "\u5546\u54C1ID",
12801
- align: 'center',
12802
- ellipsis: true,
12803
- width: 70
12804
- }, {
12805
- dataIndex: 'goodNo',
12806
- title: "\u5546\u54C1\u7F16\u7801",
12807
- align: 'center',
12808
- ellipsis: true,
12809
- width: 180
12810
- }, {
12811
- dataIndex: 'goodName',
12812
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12813
- align: 'center',
12814
- ellipsis: true,
12815
- width: 250
12816
- }, {
12817
- dataIndex: 'specId',
12818
- title: "".concat(text, "SKUID"),
12819
- align: 'center',
12820
- ellipsis: true,
12821
- width: 100
12822
- }, {
12823
- dataIndex: 'specNo',
12824
- title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
12825
- align: 'center',
12826
- ellipsis: true,
12827
- width: 180
12828
- }, {
12829
- dataIndex: 'specName',
12830
- title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
12831
- align: 'center',
12832
- ellipsis: true,
12833
- width: 250
12834
- }, {
12835
- dataIndex: 'num',
12836
- title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
12837
- align: 'center',
12838
- ellipsis: true,
12839
- width: 100,
12840
- render: function render(val, record, index) {
12841
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12842
- style: {
12843
- width: 70
12844
- },
12845
- value: val,
12846
- min: 1,
12847
- precision: 0,
12848
- onChange: function onChange(num) {
12849
- return updateHandle(num, index, 'num');
12850
- }
12851
- }) : /*#__PURE__*/React.createElement("span", null, val);
12852
- }
12853
- }, {
12854
- dataIndex: 'price',
12855
- title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
12856
- align: 'center',
12857
- ellipsis: true,
12858
- width: 100,
12859
- render: function render(val, record, index) {
12860
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12861
- style: {
12862
- width: 70
12863
- },
12864
- value: val,
12865
- min: 0,
12866
- onChange: function onChange(value) {
12867
- return updateHandle(value, index, 'price');
12868
- }
12869
- }) : /*#__PURE__*/React.createElement("span", null, val);
12870
- }
12871
- }, {
12872
- dataIndex: 'exchangePrice',
12873
- title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
12874
- align: 'center',
12875
- ellipsis: true,
12876
- width: 100
12877
- }, {
12878
- dataIndex: 'giftType',
12879
- title: "\u8D60\u54C1\u65B9\u5F0F",
12880
- align: 'center',
12881
- ellipsis: true,
12882
- width: 100,
12883
- render: function render(val) {
12884
- var giftTypeMap = {
12885
- 0: '非赠品',
12886
- 1: '自动赠送',
12887
- 2: '手工赠送',
12888
- 3: '回购自动送赠品',
12889
- 4: '前N有礼送赠品',
12890
- 6: '天猫优仓赠品',
12891
- 7: '淘宝CRM会员送赠'
12892
- };
12893
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12894
- }
12895
- }, {
12896
- dataIndex: 'type',
12897
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
12898
- align: 'center',
12899
- ellipsis: true,
12900
- width: 100,
12901
- render: function render(val, record, index) {
12902
- var options = [{
12903
- label: '单品',
12904
- value: '1'
12905
- }, {
12906
- label: '组合装',
12907
- value: '2'
12908
- }];
12909
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
12910
- style: {
12911
- width: 70
12912
- },
12913
- options: options,
12914
- value: val,
12915
- onChange: function onChange(value) {
12916
- return updateHandle(value, index, 'type');
12917
- }
12918
- }) : /*#__PURE__*/React.createElement("span", null, val);
12919
- }
12920
- }];
13754
+ columns = getWdtReissueGoodColumns({
13755
+ disabled: disabled,
13756
+ updateHandle: updateHandle,
13757
+ operate: operate
13758
+ });
12921
13759
  }
12922
13760
  break;
12923
- case 'BS_E3_GOODS':
13761
+ case 'BS_E3_REISSUE_GOODS':
12924
13762
  {
12925
- columns = [{
12926
- dataIndex: 'sku',
12927
- title: "SKU",
12928
- align: 'center',
12929
- ellipsis: true,
12930
- width: 150
12931
- }, {
12932
- dataIndex: 'skuId',
12933
- title: "SKU ID",
12934
- align: 'center',
12935
- ellipsis: true,
12936
- width: 150
12937
- }, {
12938
- dataIndex: 'goodsName',
12939
- title: "\u5546\u54C1\u540D\u79F0",
12940
- align: 'center',
12941
- ellipsis: true,
12942
- width: 150
12943
- }, {
12944
- dataIndex: 'goodsShortName',
12945
- title: "\u5546\u54C1\u7B80\u79F0",
12946
- align: 'center',
12947
- ellipsis: true,
12948
- width: 100
12949
- }, {
12950
- dataIndex: 'picPath',
12951
- title: "\u5546\u54C1\u56FE\u7247",
12952
- align: 'center',
12953
- ellipsis: true,
12954
- width: 100,
12955
- render: function render(val) {
12956
- return /*#__PURE__*/React.createElement(Image, {
12957
- width: 60,
12958
- src: val
12959
- });
12960
- }
12961
- }, {
12962
- dataIndex: 'goodsSn',
12963
- title: "\u8D27\u53F7",
12964
- align: 'center',
12965
- ellipsis: true,
12966
- width: 150
12967
- }, {
12968
- dataIndex: 'goodsId',
12969
- title: "\u8D27\u53F7ID",
12970
- align: 'center',
12971
- ellipsis: true,
12972
- width: 150
12973
- }, {
12974
- dataIndex: 'colorName',
12975
- title: "\u989C\u8272\u540D\u79F0",
12976
- align: 'center',
12977
- ellipsis: true,
12978
- width: 100
12979
- }, {
12980
- dataIndex: 'colorCode',
12981
- title: "\u989C\u8272\u4EE3\u7801",
12982
- align: 'center',
12983
- ellipsis: true,
12984
- width: 150
12985
- }, {
12986
- dataIndex: 'sizeName',
12987
- title: "\u5C3A\u7801\u540D\u79F0",
12988
- align: 'center',
12989
- ellipsis: true,
12990
- width: 100
12991
- }, {
12992
- dataIndex: 'sizeCode',
12993
- title: "\u5C3A\u7801\u4EE3\u7801",
12994
- align: 'center',
12995
- ellipsis: true,
12996
- width: 100
12997
- }, {
12998
- dataIndex: 'brandName',
12999
- title: "\u54C1\u724C\u540D\u79F0",
13000
- align: 'center',
13001
- ellipsis: true,
13002
- width: 150
13003
- }, {
13004
- dataIndex: 'goodsNumber',
13005
- title: "\u5546\u54C1\u6570\u91CF",
13006
- align: 'center',
13007
- ellipsis: true,
13008
- width: 100
13009
- }, {
13010
- dataIndex: 'goodsPrice',
13011
- title: "\u5546\u54C1\u5355\u4EF7",
13012
- align: 'center',
13013
- ellipsis: true,
13014
- width: 120
13015
- }, {
13016
- dataIndex: 'shopPrice',
13017
- title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
13018
- align: 'center',
13019
- ellipsis: true,
13020
- width: 120
13021
- }, {
13022
- dataIndex: 'sharePrice',
13023
- title: "\u5206\u644A\u4EF7",
13024
- align: 'center',
13025
- ellipsis: true,
13026
- width: 120
13027
- }, {
13028
- dataIndex: 'sharePayment',
13029
- title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
13030
- align: 'center',
13031
- ellipsis: true,
13032
- width: 120
13033
- }, {
13034
- dataIndex: 'payment',
13035
- title: "\u5B9E\u4ED8\u91D1\u989D",
13036
- align: 'center',
13037
- ellipsis: true,
13038
- width: 120
13039
- }, {
13040
- dataIndex: 'tcSku',
13041
- title: "\u5957\u9910SKU",
13042
- align: 'center',
13043
- ellipsis: true,
13044
- width: 150
13045
- }, {
13046
- dataIndex: 'tcGoodsNumber',
13047
- title: "\u5957\u9910\u5957\u6570",
13048
- align: 'center',
13049
- ellipsis: true,
13050
- width: 100
13051
- }, {
13052
- dataIndex: 'taoCanSingleSl',
13053
- title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
13054
- align: 'center',
13055
- ellipsis: true,
13056
- width: 100
13057
- }, {
13058
- dataIndex: 'isGift',
13059
- title: "\u662F\u5426\u8D60\u54C1",
13060
- align: 'center',
13061
- ellipsis: true,
13062
- width: 100
13063
- }];
13763
+ columns = getBsE3ReissueGoodColumns({
13764
+ disabled: disabled,
13765
+ updateHandle: updateHandle,
13766
+ operate: operate
13767
+ });
13064
13768
  }
13065
13769
  break;
13066
13770
  default:
13067
- columns = [{
13068
- dataIndex: 'mark',
13069
- title: "\u5546\u54C1\u6807\u8BB0",
13070
- align: 'center',
13071
- ellipsis: true,
13072
- width: 70,
13073
- render: function render(val, record, index) {
13074
- return /*#__PURE__*/React.createElement(Select, {
13075
- options: [{
13076
- label: '是',
13077
- value: '是'
13078
- }, {
13079
- label: '否',
13080
- value: '否'
13081
- }],
13082
- disabled: disabled,
13083
- value: val,
13084
- onChange: function onChange(val) {
13085
- return updateHandle(val, index, 'mark');
13086
- }
13087
- });
13088
- }
13089
- }, {
13090
- dataIndex: 'skuName',
13091
- title: "".concat(text, "sku\u540D\u79F0"),
13092
- align: 'center',
13093
- ellipsis: true,
13094
- width: 250
13095
- }, {
13096
- dataIndex: 'sku',
13097
- title: "".concat(text, "sku\u7F16\u7801"),
13098
- align: 'center',
13099
- ellipsis: true,
13100
- width: 100
13101
- }, {
13102
- dataIndex: 'name',
13103
- title: "".concat(text, "\u540D\u79F0"),
13104
- align: 'center',
13105
- ellipsis: true,
13106
- width: 250
13107
- }, {
13108
- dataIndex: 'pic',
13109
- title: "\u56FE\u7247",
13110
- align: 'center',
13111
- ellipsis: true,
13112
- width: 100,
13113
- render: function render(val) {
13114
- return /*#__PURE__*/React.createElement(Image, {
13115
- width: 60,
13116
- src: val
13117
- });
13118
- }
13119
- }, {
13120
- dataIndex: 'code',
13121
- title: "".concat(text, "\u7F16\u7801"),
13122
- align: 'center',
13123
- ellipsis: true,
13124
- width: 100
13125
- }, {
13126
- dataIndex: 'money',
13127
- title: "\u5B9E\u4ED8\u91D1\u989D",
13128
- align: 'center',
13129
- ellipsis: true,
13130
- width: 100
13131
- }, {
13132
- dataIndex: 'number',
13133
- title: "".concat(text, "\u6570\u91CF"),
13134
- align: 'center',
13135
- ellipsis: true,
13136
- width: 100,
13137
- render: function render(val, record, index) {
13138
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
13139
- style: {
13140
- width: 70
13141
- },
13142
- value: val,
13143
- min: 1,
13144
- precision: 0,
13145
- onChange: function onChange(num) {
13146
- return updateHandle(num, index, 'number');
13147
- }
13148
- }) : /*#__PURE__*/React.createElement("span", null, val);
13149
- }
13150
- }, {
13151
- dataIndex: 'share',
13152
- title: "\u5206\u644A\u4EF7",
13153
- align: 'center',
13154
- ellipsis: true,
13155
- width: 70
13156
- }, {
13157
- dataIndex: 'type',
13158
- title: "\u8D60\u54C1\u7C7B\u578B",
13159
- align: 'center',
13160
- ellipsis: true,
13161
- width: 100
13162
- }];
13771
+ columns = getColumnsMap({
13772
+ text: text,
13773
+ disabled: disabled,
13774
+ updateHandle: updateHandle
13775
+ })['default'];
13163
13776
  }
13164
13777
  return columns;
13165
13778
  };
@@ -13171,6 +13784,24 @@ var GoodItem$1 = function GoodItem(props) {
13171
13784
  return COLUMNS_INFO(type);
13172
13785
  };
13173
13786
  var newColumns = useMemo(function () {
13787
+ var initBaseInfoColumns = GOODS_INFO_COLUMNS();
13788
+ var baseInfoColumns = [];
13789
+ var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
13790
+ var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
13791
+ if (isStringArray) {
13792
+ baseInfoColumns = initBaseInfoColumns.filter(function (col) {
13793
+ return showHeader.includes(col.dataIndex);
13794
+ });
13795
+ } else if (isObjectArray) {
13796
+ baseInfoColumns = showHeader.filter(function (col) {
13797
+ return col.show !== false;
13798
+ }).map(function (col) {
13799
+ var currentCol = initBaseInfoColumns.find(function (item) {
13800
+ return item.dataIndex === col.dataIndex;
13801
+ });
13802
+ return currentCol ? currentCol : undefined;
13803
+ }).filter(Boolean);
13804
+ }
13174
13805
  var columnList = [{
13175
13806
  dataIndex: '',
13176
13807
  title: '序号',
@@ -13180,9 +13811,7 @@ var GoodItem$1 = function GoodItem(props) {
13180
13811
  render: function render(val, record, index) {
13181
13812
  return /*#__PURE__*/React.createElement("span", null, index + 1);
13182
13813
  }
13183
- }].concat(_toConsumableArray(GOODS_INFO_COLUMNS().filter(function (t) {
13184
- return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
13185
- })));
13814
+ }].concat(_toConsumableArray(baseInfoColumns));
13186
13815
  if (!disabled) {
13187
13816
  columnList.push({
13188
13817
  dataIndex: '',
@@ -13202,6 +13831,19 @@ var GoodItem$1 = function GoodItem(props) {
13202
13831
  }
13203
13832
  return columnList;
13204
13833
  }, [showHeader, value, disabled]);
13834
+ var orderColumns = useMemo(function () {
13835
+ var columns = COLUMNS_MAP('', false)(type);
13836
+ return [{
13837
+ dataIndex: '',
13838
+ title: '序号',
13839
+ align: 'center',
13840
+ ellipsis: true,
13841
+ width: 50,
13842
+ render: function render(val, record, index) {
13843
+ return /*#__PURE__*/React.createElement("span", null, index + 1);
13844
+ }
13845
+ }].concat(_toConsumableArray(columns));
13846
+ }, []);
13205
13847
  var onSubmit = function onSubmit(list) {
13206
13848
  var newList = [];
13207
13849
  if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
@@ -13220,12 +13862,37 @@ var GoodItem$1 = function GoodItem(props) {
13220
13862
  });
13221
13863
  } else if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
13222
13864
  newList = list.map(function (item) {
13223
- item.uuid = uuid();
13224
- item.canDelete = true;
13225
- item.goodsNumber = 1;
13226
- item.goodsPrice = 0;
13227
- item.canUpdateNumber = canUpdateNumber;
13228
- return item;
13865
+ var specNo = item.specNo,
13866
+ specId = item.specId,
13867
+ goodName = item.goodName,
13868
+ goodShortName = item.goodShortName,
13869
+ goodPicUrl = item.goodPicUrl,
13870
+ goodNo = item.goodNo,
13871
+ goodId = item.goodId,
13872
+ retailPrice = item.retailPrice;
13873
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13874
+ sku: specNo,
13875
+ skuId: specId,
13876
+ goodsName: goodName,
13877
+ goodsShortName: goodShortName,
13878
+ picPath: goodPicUrl,
13879
+ goodsSn: goodNo,
13880
+ goodsId: goodId,
13881
+ goodsPrice: retailPrice,
13882
+ shopPrice: retailPrice,
13883
+ sharePayment: '',
13884
+ sharePrice: '',
13885
+ payment: '',
13886
+ tcSku: '',
13887
+ tcGoodsNumber: '',
13888
+ taoCanSingleSl: '',
13889
+ isGift: '',
13890
+ uuid: uuid(),
13891
+ canDelete: true,
13892
+ canEdit: true,
13893
+ goodsNumber: 1,
13894
+ canUpdateNumber: canUpdateNumber
13895
+ });
13229
13896
  });
13230
13897
  } else {
13231
13898
  newList = list.map(function (item) {
@@ -13286,10 +13953,15 @@ var GoodItem$1 = function GoodItem(props) {
13286
13953
  }, showModeBtn && /*#__PURE__*/React.createElement(Checkbox, {
13287
13954
  checked: isStrict,
13288
13955
  onChange: handleCheckboxChange
13289
- }, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !((_ref = ['BS_E3_GOODS']) === null || _ref === void 0 ? void 0 : _ref.includes(type)) && /*#__PURE__*/React.createElement(Button, {
13956
+ }, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !isEmpty(tradeGoods) && /*#__PURE__*/React.createElement(SelectTradeGoods, {
13957
+ columns: orderColumns,
13958
+ dataSource: tradeGoods.originDataSource,
13959
+ selectedRowKeys: selectedGoods,
13960
+ onChangeSelectedKeys: tradeGoods.selectedGoodsChange
13961
+ }), /*#__PURE__*/React.createElement(Button, {
13290
13962
  type: "link",
13291
13963
  onClick: handleChangeGoods
13292
- }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
13964
+ }, getButtonText(type)), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
13293
13965
  columns: newColumns,
13294
13966
  dataSource: value,
13295
13967
  rowKey: 'uuid',
@@ -13998,25 +14670,7 @@ var getBsE3OrderListSingleton = function getBsE3OrderListSingleton(orderNo) {
13998
14670
  if (data === null || data === void 0 ? void 0 : data.success) {
13999
14671
  var _data$data, _data$data$orderList;
14000
14672
  if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$orderList = _data$data.orderList) === null || _data$data$orderList === void 0 ? void 0 : _data$data$orderList.length) {
14001
- var _filterBsE3Orders;
14002
- data.data.orderList = (_filterBsE3Orders = filterBsE3Orders(data === null || data === void 0 ? void 0 : data.data, orderNo)) === null || _filterBsE3Orders === void 0 ? void 0 : _filterBsE3Orders.map(function (item) {
14003
- var isSplit = item.isSplit,
14004
- isSplitNew = item.isSplitNew,
14005
- isCopy = item.isCopy,
14006
- isExchangeOrder = item.isExchangeOrder,
14007
- isCombineNew = item.isCombineNew,
14008
- isCombine = item.isCombine,
14009
- orderStatus = item.orderStatus;
14010
- return _objectSpread2(_objectSpread2({}, item), {}, {
14011
- orderStatus: BS_E3_ORDER_STATUS_MAP[orderStatus],
14012
- isSplit: BS_E3_BOOLEAN_STATUS_MAP[isSplit],
14013
- isSplitNew: BS_E3_BOOLEAN_STATUS_MAP[isSplitNew],
14014
- isExchangeOrder: BS_E3_BOOLEAN_STATUS_MAP[isExchangeOrder],
14015
- isCopy: BS_E3_BOOLEAN_STATUS_MAP[isCopy],
14016
- isCombineNew: BS_E3_BOOLEAN_STATUS_MAP[isCombineNew],
14017
- isCombine: BS_E3_BOOLEAN_STATUS_MAP[isCombine]
14018
- });
14019
- });
14673
+ data.data.orderList = filterBsE3Orders(data === null || data === void 0 ? void 0 : data.data, orderNo);
14020
14674
  }
14021
14675
  resolve(data.data);
14022
14676
  } else {
@@ -14032,6 +14686,53 @@ var bsE3Utils = {
14032
14686
  getBsE3OrderListSingleton: getBsE3OrderListSingleton
14033
14687
  };
14034
14688
 
14689
+ var singletonMap$2 = new Map();
14690
+ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
14691
+ if (!singletonMap$2.has(orderNo)) {
14692
+ var p = new Promise(function (resolve, reject) {
14693
+ var doReject = function doReject(err) {
14694
+ // 清空掉错误的请求记录
14695
+ singletonMap$2.delete(orderNo);
14696
+ reject(err);
14697
+ };
14698
+ extendRequest('/qy/gdfw/order/kmErpOrderDetail', {
14699
+ method: 'post',
14700
+ data: {
14701
+ tid: orderNo
14702
+ }
14703
+ }).then(function (data) {
14704
+ if (data === null || data === void 0 ? void 0 : data.success) {
14705
+ var _data$data, _data$data$orderDetai;
14706
+ if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$orderDetai = _data$data.orderDetailDtoList) === null || _data$data$orderDetai === void 0 ? void 0 : _data$data$orderDetai.length) {
14707
+ var list = filterKmOrders(data === null || data === void 0 ? void 0 : data.data, orderNo).map(function (item) {
14708
+ return _objectSpread2(_objectSpread2({}, item), {}, {
14709
+ billNo: item.sid,
14710
+ sysStatus: item.sysStatus,
14711
+ billType: item.type,
14712
+ billTag: item.tags
14713
+ });
14714
+ });
14715
+ resolve(list);
14716
+ } else {
14717
+ resolve([]);
14718
+ }
14719
+ // 延迟10秒清除,保证订单的时效性
14720
+ setTimeout(function () {
14721
+ singletonMap$2.delete(orderNo);
14722
+ }, 1000 * 10);
14723
+ } else {
14724
+ doReject(data);
14725
+ }
14726
+ }).catch(doReject);
14727
+ });
14728
+ singletonMap$2.set(orderNo, p);
14729
+ }
14730
+ return singletonMap$2.get(orderNo);
14731
+ };
14732
+ var kmUtils = {
14733
+ getOrderListSingleton: getOrderListSingleton
14734
+ };
14735
+
14035
14736
  var columnsMap = {
14036
14737
  BS_SYSTEM_ORDER: [{
14037
14738
  title: '单据类型',
@@ -14045,7 +14746,23 @@ var columnsMap = {
14045
14746
  title: '标签',
14046
14747
  dataIndex: 'billTag',
14047
14748
  width: 150
14048
- }],
14749
+ }, {
14750
+ title: '主播名称',
14751
+ dataIndex: 'authorName',
14752
+ width: 150
14753
+ }, {
14754
+ title: '主播ID',
14755
+ dataIndex: 'authorId',
14756
+ width: 150
14757
+ }
14758
+ // {
14759
+ // title: '直播活动',
14760
+ // dataIndex: 'liveActivites',
14761
+ // width: 150,
14762
+ // },
14763
+ ],
14764
+
14765
+ KM_SYSTEM_ORDER: KM_SYSTEM_ORDER_CONFIG.columns,
14049
14766
  WLN_SYSTEM_ORDER: [{
14050
14767
  title: '订单类型',
14051
14768
  dataIndex: 'billType',
@@ -14081,37 +14798,58 @@ var columnsMap = {
14081
14798
  title: '订单状态',
14082
14799
  dataIndex: 'orderStatus',
14083
14800
  width: 100,
14084
- ellipsis: true
14801
+ ellipsis: true,
14802
+ render: function render(val) {
14803
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_ORDER_STATUS_MAP[val] || val);
14804
+ }
14085
14805
  }, {
14086
14806
  title: '是否被拆分',
14087
14807
  dataIndex: 'isSplit',
14088
- width: 70,
14089
- ellipsis: true
14808
+ width: 100,
14809
+ ellipsis: true,
14810
+ render: function render(val) {
14811
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14812
+ }
14090
14813
  }, {
14091
14814
  title: '是否拆分子单',
14092
14815
  dataIndex: 'isSplitNew',
14093
- width: 70,
14094
- ellipsis: true
14816
+ width: 100,
14817
+ ellipsis: true,
14818
+ render: function render(val) {
14819
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14820
+ }
14095
14821
  }, {
14096
14822
  title: '是否被合并',
14097
14823
  dataIndex: 'isCombine',
14098
- width: 70,
14099
- ellipsis: true
14824
+ width: 100,
14825
+ ellipsis: true,
14826
+ render: function render(val) {
14827
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14828
+ }
14100
14829
  }, {
14101
14830
  title: '是否合并新单',
14102
14831
  dataIndex: 'isCombineNew',
14103
- width: 70,
14104
- ellipsis: true
14832
+ width: 100,
14833
+ ellipsis: true,
14834
+ render: function render(val) {
14835
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14836
+ }
14105
14837
  }, {
14106
14838
  title: '是否复制单',
14107
14839
  dataIndex: 'isCopy',
14108
- width: 70,
14109
- ellipsis: true
14840
+ width: 100,
14841
+ ellipsis: true,
14842
+ render: function render(val) {
14843
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14844
+ }
14110
14845
  }, {
14111
14846
  title: '是否换货单',
14112
14847
  dataIndex: 'isExchangeOrder',
14113
- width: 70,
14114
- ellipsis: true
14848
+ width: 100,
14849
+ ellipsis: true,
14850
+ render: function render(val) {
14851
+ return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
14852
+ }
14115
14853
  }, {
14116
14854
  title: '订单备注',
14117
14855
  dataIndex: 'orderMsg',
@@ -14121,6 +14859,7 @@ var columnsMap = {
14121
14859
  };
14122
14860
  var rowKeyMap = {
14123
14861
  BS_SYSTEM_ORDER: 'billNo',
14862
+ KM_SYSTEM_ORDER: 'billNo',
14124
14863
  WLN_SYSTEM_ORDER: 'billNo',
14125
14864
  WDT_SYSTEM_ORDER: 'billNo',
14126
14865
  BS_E3_SYSTEM_ORDER: 'orderSn'
@@ -14137,6 +14876,8 @@ var index$1 = (function (props) {
14137
14876
  onceRef.current = true;
14138
14877
  if (type === 'BS_SYSTEM_ORDER') {
14139
14878
  getOrderList(value.orderNo);
14879
+ } else if (type === 'KM_SYSTEM_ORDER') {
14880
+ getKmOrderList(value.orderNo);
14140
14881
  } else if (type === 'WLN_SYSTEM_ORDER') {
14141
14882
  getWlnOrderList(value.orderNo);
14142
14883
  } else if (type === 'WDT_SYSTEM_ORDER') {
@@ -14173,11 +14914,15 @@ var index$1 = (function (props) {
14173
14914
  return {
14174
14915
  billNo: item.billNo,
14175
14916
  billType: item.billType,
14176
- billTag: item.billTag
14917
+ billTag: item.billTag,
14918
+ authorName: item.authorName,
14919
+ authorId: item.authorId
14920
+ // liveActivites: item.liveActivites,
14177
14921
  };
14178
14922
  })
14179
14923
  }));
14180
14924
  }
14925
+
14181
14926
  onceRef.current = false;
14182
14927
  case 7:
14183
14928
  case "end":
@@ -14294,6 +15039,37 @@ var index$1 = (function (props) {
14294
15039
  return _ref5.apply(this, arguments);
14295
15040
  };
14296
15041
  }();
15042
+ var getKmOrderList = /*#__PURE__*/function () {
15043
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(orderNo) {
15044
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
15045
+ while (1) switch (_context5.prev = _context5.next) {
15046
+ case 0:
15047
+ kmUtils.getOrderListSingleton(orderNo).then(function (trades) {
15048
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
15049
+ orders: trades,
15050
+ showOrderInfo: trades.map(function (_ref7) {
15051
+ var billNo = _ref7.billNo,
15052
+ billType = _ref7.billType,
15053
+ billTag = _ref7.billTag;
15054
+ return {
15055
+ billNo: billNo,
15056
+ billType: billType,
15057
+ billTag: billTag
15058
+ };
15059
+ })
15060
+ }));
15061
+ });
15062
+ onceRef.current = false;
15063
+ case 2:
15064
+ case "end":
15065
+ return _context5.stop();
15066
+ }
15067
+ }, _callee5);
15068
+ }));
15069
+ return function getKmOrderList(_x5) {
15070
+ return _ref6.apply(this, arguments);
15071
+ };
15072
+ }();
14297
15073
  var rowSelection = {
14298
15074
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
14299
15075
  fixed: true,
@@ -14422,7 +15198,7 @@ var CommonGoods = function CommonGoods(props) {
14422
15198
  valueRef.current = value;
14423
15199
  if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo)) {
14424
15200
  getOrderFlag.current = true;
14425
- getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
15201
+ compType.indexOf('WDT') > -1 && getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
14426
15202
  }
14427
15203
  }, [value]);
14428
15204
  var getWdtOrderList = /*#__PURE__*/function () {
@@ -14859,11 +15635,12 @@ var typeMap$1 = {
14859
15635
  formatDefaultField: {
14860
15636
  money: 'orderPrice',
14861
15637
  share: 'sharePrice'
14862
- }
15638
+ },
15639
+ getOrderList: wdtUtils.getWdtOrderListSingleton
14863
15640
  }
14864
15641
  };
14865
15642
  var wdtReissue = function wdtReissue(props) {
14866
- var _value$wdtSystemOrder, _typeMap$type7, _typeMap$type25, _typeMap$type26, _value$typeMap$type$s5, _typeMap$type27, _typeMap$type28, _typeMap$type29;
15643
+ var _value$wdtSystemOrder, _typeMap$type26, _typeMap$type28, _typeMap$type29, _value$typeMap$type$s5, _typeMap$type30, _typeMap$type31, _typeMap$type32;
14867
15644
  var value = props.value,
14868
15645
  onChange = props.onChange,
14869
15646
  _props$reasonList = props.reasonList,
@@ -14885,31 +15662,48 @@ var wdtReissue = function wdtReissue(props) {
14885
15662
  if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.systemOrder]) === null || _value$typeMap$type$s === void 0 ? void 0 : (_value$typeMap$type$s2 = _value$typeMap$type$s.orders) === null || _value$typeMap$type$s2 === void 0 ? void 0 : _value$typeMap$type$s2.length) && (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s3 = value[(_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.systemOrder]) === null || _value$typeMap$type$s3 === void 0 ? void 0 : _value$typeMap$type$s3.orderNo)) {
14886
15663
  var _value$typeMap$type$s4, _typeMap$type3;
14887
15664
  getOrderFlag.current = true;
14888
- getWdtOrderList(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);
15665
+ getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.systemOrder]) === null || _value$typeMap$type$s4 === void 0 ? void 0 : _value$typeMap$type$s4.orderNo);
14889
15666
  }
14890
15667
  return;
14891
15668
  }, [value]);
14892
- useEffect(function () {
14893
- var _typeMap$type4;
14894
- var systemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.systemOrderNo];
14895
- if (systemOrderNo) {
14896
- var _value$typeMap$type$t, _typeMap$type5;
14897
- if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
14898
- var _typeMap$type6;
14899
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.key, getGoodDetails({
14900
- mode: isStrict
14901
- }))));
14902
- }
14903
- }
14904
- return;
14905
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.systemOrderNo]]);
14906
- var getWdtOrderList = /*#__PURE__*/function () {
15669
+ // useEffect(() => {
15670
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
15671
+ // if (systemOrderNo) {
15672
+ // if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
15673
+ // onChange?.({
15674
+ // ...value,
15675
+ // [typeMap[type]?.key]: getGoodDetails({
15676
+ // mode: isStrict
15677
+ // })
15678
+ // })
15679
+ // }
15680
+ // }
15681
+ // return;
15682
+ // }, [value?.[typeMap[type]?.systemOrderNo]]);
15683
+ // const getWdtOrderList = async (orderNo: string) => {
15684
+ // wdtUtils.getWdtOrderListSingleton(orderNo).then(data => {
15685
+ // const orders = data?.trades || [];
15686
+ // const showOrderInfo = orders.map(({ billNo, billType, billTag }: any) => {
15687
+ // return { billNo, billType, billTag }
15688
+ // });
15689
+ // onChange({
15690
+ // ...value,
15691
+ // [typeMap[type]?.systemOrder]: {
15692
+ // ...value[typeMap[type]?.systemOrder],
15693
+ // showOrderInfo,
15694
+ // orders,
15695
+ // },
15696
+ // });
15697
+ // })
15698
+ // };
15699
+ var getOrderList = /*#__PURE__*/function () {
14907
15700
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
15701
+ var _typeMap$type4;
14908
15702
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14909
15703
  while (1) switch (_context.prev = _context.next) {
14910
15704
  case 0:
14911
- wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14912
- var _typeMap$type8, _typeMap$type9;
15705
+ (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
15706
+ var _typeMap$type5, _typeMap$type6;
14913
15707
  var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
14914
15708
  var showOrderInfo = orders.map(function (_ref2) {
14915
15709
  var billNo = _ref2.billNo,
@@ -14921,7 +15715,7 @@ var wdtReissue = function wdtReissue(props) {
14921
15715
  billTag: billTag
14922
15716
  };
14923
15717
  });
14924
- onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.systemOrder]), {}, {
15718
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
14925
15719
  showOrderInfo: showOrderInfo,
14926
15720
  orders: orders
14927
15721
  }))));
@@ -14932,43 +15726,44 @@ var wdtReissue = function wdtReissue(props) {
14932
15726
  }
14933
15727
  }, _callee);
14934
15728
  }));
14935
- return function getWdtOrderList(_x) {
15729
+ return function getOrderList(_x) {
14936
15730
  return _ref.apply(this, arguments);
14937
15731
  };
14938
15732
  }();
14939
15733
  var changeTypeHandle = function changeTypeHandle(val) {
14940
- var _value$typeMap$type$t2, _typeMap$type10, _typeMap$type11;
15734
+ var _value$typeMap$type$t, _typeMap$type7, _typeMap$type8;
14941
15735
  var typeName = val === null || val === void 0 ? void 0 : val[0];
14942
- if (typeName === (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) return;
15736
+ if (typeName === (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) return;
14943
15737
  // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
14944
15738
  var newValue = _objectSpread2({}, value);
14945
- newValue[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName] = val;
15739
+ newValue[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName] = val;
14946
15740
  if (typeName === '1') {
14947
- var _typeMap$type12;
14948
- newValue[(_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key] = getGoodDetails({
15741
+ var _typeMap$type9;
15742
+ newValue[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = getGoodDetails({
14949
15743
  mode: isStrict
14950
15744
  });
14951
15745
  } else if (typeName === '2') {
14952
- var _typeMap$type13;
15746
+ var _typeMap$type10;
14953
15747
  // 切换到非原单,清空列表
14954
- newValue[(_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key] = [];
15748
+ newValue[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key] = [];
14955
15749
  }
14956
15750
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14957
15751
  };
14958
15752
  var handleModeChange = function handleModeChange(mode) {
14959
- var _value$typeMap$type$t3, _typeMap$type14, _typeMap$type15;
14960
- var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]) === '1';
15753
+ var _value$typeMap$type$t2, _typeMap$type11, _typeMap$type12;
15754
+ var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0]) === '1';
14961
15755
  setIsStrict(mode);
14962
15756
  if (!isOriginalOrder) return;
14963
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.key, getGoodDetails({
15757
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key, getGoodDetails({
14964
15758
  mode: mode
14965
15759
  }))));
14966
15760
  };
14967
15761
  var getGoodDetails = function getGoodDetails(_ref3) {
14968
- var _typeMap$type16, _typeMap$type17, _order$goodDetails;
14969
- var mode = _ref3.mode;
14970
- var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.systemOrder];
14971
- var systemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.systemOrderNo];
15762
+ var _typeMap$type13, _typeMap$type14, _order$goodDetails;
15763
+ var mode = _ref3.mode,
15764
+ sysOrderNo = _ref3.sysOrderNo;
15765
+ var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrder];
15766
+ var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.systemOrderNo];
14972
15767
  var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
14973
15768
  return order.tradeNo === systemOrderNo;
14974
15769
  });
@@ -14979,31 +15774,52 @@ var wdtReissue = function wdtReissue(props) {
14979
15774
  }) : goodDetails;
14980
15775
  };
14981
15776
  var changeGoodHandle = function changeGoodHandle(val) {
14982
- var _typeMap$type18;
15777
+ var _typeMap$type15;
14983
15778
  var newValue = _objectSpread2({}, value);
14984
- 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)] = (val || []).map(function (item) {
14985
- var _typeMap$type19, _typeMap$type20;
14986
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.formatDefaultField.money)] = 0;
14987
- 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.share)] = 0;
15779
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.key)] = (val || []).map(function (item) {
15780
+ var _typeMap$type16, _typeMap$type17;
15781
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.formatDefaultField.money)] = 0;
15782
+ item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.share)] = 0;
14988
15783
  return item;
14989
15784
  });
14990
15785
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14991
15786
  };
14992
15787
  var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
14993
- var _typeMap$type21, _value$typeMap$type$t4, _typeMap$type22;
15788
+ var _typeMap$type18, _value$typeMap$type$t3, _typeMap$type19, _value$typeMap$type$t4, _typeMap$type21;
14994
15789
  var newValue = _objectSpread2({}, value);
14995
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo)] = val;
14996
- if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0])) {
14997
- var _typeMap$type23;
14998
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)] = [];
15790
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.systemOrderNo)] = val;
15791
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
15792
+ var _typeMap$type20;
15793
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = [];
15794
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0])) {
15795
+ var _typeMap$type22;
15796
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)] = getGoodDetails({
15797
+ mode: isStrict,
15798
+ sysOrderNo: val
15799
+ });
14999
15800
  }
15000
15801
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
15001
15802
  };
15803
+ var selectedGoodsChange = useCallback(function (skuList) {
15804
+ var _typeMap$type23, _typeMap$type24, _uniqBy, _typeMap$type25;
15805
+ var newValue = _objectSpread2({}, value);
15806
+ // 原订单商品
15807
+ var originTradeGoodList = getGoodDetails({
15808
+ mode: isStrict
15809
+ }) || [];
15810
+ // 当前选中的所有商品【包含了原订单+商品库】
15811
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)]) || [];
15812
+ newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
15813
+ return skuList.includes(item.uuid);
15814
+ });
15815
+ console.log('商品发生变化', newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.key)]);
15816
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
15817
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.key)], isStrict]);
15002
15818
  //显示选择商品按钮 原单换不显示选择商品
15003
15819
  var showChangeBtn = useMemo(function () {
15004
- var _typeMap$type24;
15005
- return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrderNo]);
15006
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderNo]]);
15820
+ var _typeMap$type27;
15821
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]);
15822
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.systemOrderNo]]);
15007
15823
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
15008
15824
  gutter: 8,
15009
15825
  wrap: true
@@ -15021,12 +15837,12 @@ var wdtReissue = function wdtReissue(props) {
15021
15837
  },
15022
15838
  disabled: disabled,
15023
15839
  allowClear: false,
15024
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrderNo)],
15840
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.systemOrderNo)],
15025
15841
  onChange: function onChange(val) {
15026
15842
  return changeSystemOrderHandle(val);
15027
15843
  },
15028
15844
  placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
15029
- }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
15845
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type30 = typeMap$1[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
15030
15846
  return /*#__PURE__*/React.createElement(Select.Option, {
15031
15847
  key: item.billNo,
15032
15848
  value: item.billNo,
@@ -15047,7 +15863,7 @@ var wdtReissue = function wdtReissue(props) {
15047
15863
  disabled: disabled,
15048
15864
  allowClear: false,
15049
15865
  options: reasonList,
15050
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName)],
15866
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type31 = typeMap$1[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.typeName)],
15051
15867
  onChange: function onChange(val) {
15052
15868
  return changeTypeHandle(val);
15053
15869
  }
@@ -15059,13 +15875,19 @@ var wdtReissue = function wdtReissue(props) {
15059
15875
  canUpdateNumber: showChangeBtn,
15060
15876
  showChangeBtn: showChangeBtn,
15061
15877
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
15062
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)],
15878
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type32 = typeMap$1[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)],
15063
15879
  onChange: function onChange(val) {
15064
15880
  return changeGoodHandle(val);
15065
15881
  },
15066
15882
  onModeChange: handleModeChange,
15067
15883
  showModeBtn: showModeBtn,
15068
- isStrict: isStrict
15884
+ isStrict: isStrict,
15885
+ tradeGoods: {
15886
+ originDataSource: getGoodDetails({
15887
+ mode: isStrict
15888
+ }),
15889
+ selectedGoodsChange: selectedGoodsChange
15890
+ }
15069
15891
  })));
15070
15892
  };
15071
15893
 
@@ -15839,4 +16661,238 @@ var CalculationInput = function CalculationInput(props) {
15839
16661
  }, config === null || config === void 0 ? void 0 : config.unit));
15840
16662
  };
15841
16663
 
15842
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
16664
+ var _excluded$k = ["value", "onChange", "reasonList", "disabled", "type"];
16665
+ var typeMap$2 = {
16666
+ BS_E3_REISSUE_GOODS: {
16667
+ key: 'bsE3ReissueGoods',
16668
+ typeName: 'bsE3ReissueType',
16669
+ systemOrder: 'bsE3SystemOrder',
16670
+ systemOrderNo: 'bsE3SystemOrderNo',
16671
+ getOrderList: bsE3Utils.getBsE3OrderListSingleton
16672
+ }
16673
+ };
16674
+ var bsE3Reissue = function bsE3Reissue(props) {
16675
+ var _typeMap$type21, _typeMap$type24, _typeMap$type25, _value$typeMap$type$s5, _typeMap$type26, _typeMap$type27, _typeMap$type28;
16676
+ var value = props.value,
16677
+ onChange = props.onChange,
16678
+ _props$reasonList = props.reasonList,
16679
+ reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
16680
+ disabled = props.disabled,
16681
+ type = props.type,
16682
+ other = _objectWithoutProperties(props, _excluded$k);
16683
+ var getOrderFlag = useRef(false);
16684
+ var _useState = useState(false),
16685
+ _useState2 = _slicedToArray(_useState, 2),
16686
+ isStrict = _useState2[0],
16687
+ setIsStrict = _useState2[1];
16688
+ // TODO: 在修改场景下手动获取一次订单详情中数据
16689
+ useEffect(function () {
16690
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
16691
+ if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$2[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.systemOrder]) === null || _value$typeMap$type$s === void 0 ? void 0 : (_value$typeMap$type$s2 = _value$typeMap$type$s.orders) === null || _value$typeMap$type$s2 === void 0 ? void 0 : _value$typeMap$type$s2.length) && (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s3 = value[(_typeMap$type2 = typeMap$2[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.systemOrder]) === null || _value$typeMap$type$s3 === void 0 ? void 0 : _value$typeMap$type$s3.orderNo)) {
16692
+ var _value$typeMap$type$s4, _typeMap$type3;
16693
+ getOrderFlag.current = true;
16694
+ getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$2[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.systemOrder]) === null || _value$typeMap$type$s4 === void 0 ? void 0 : _value$typeMap$type$s4.orderNo);
16695
+ }
16696
+ return;
16697
+ }, [value]);
16698
+ // useEffect(() => {
16699
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
16700
+ // if (systemOrderNo) {
16701
+ // if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
16702
+ // onChange?.({
16703
+ // ...value,
16704
+ // [typeMap[type]?.key]: getGoodDetails({
16705
+ // mode: isStrict
16706
+ // })
16707
+ // })
16708
+ // }
16709
+ // }
16710
+ // return;
16711
+ // }, [value?.[typeMap[type]?.systemOrderNo]]);
16712
+ var getOrderList = /*#__PURE__*/function () {
16713
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
16714
+ var _typeMap$type4;
16715
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
16716
+ while (1) switch (_context.prev = _context.next) {
16717
+ case 0:
16718
+ (_typeMap$type4 = typeMap$2[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
16719
+ var _typeMap$type5, _typeMap$type6;
16720
+ var orders = (data === null || data === void 0 ? void 0 : data.orderList) || [];
16721
+ var showOrderInfo = orders.map(function (_ref2) {
16722
+ var orderSn = _ref2.orderSn;
16723
+ return {
16724
+ billNo: orderSn
16725
+ };
16726
+ });
16727
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$2[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$2[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
16728
+ showOrderInfo: showOrderInfo,
16729
+ orders: orders
16730
+ }))));
16731
+ });
16732
+ case 1:
16733
+ case "end":
16734
+ return _context.stop();
16735
+ }
16736
+ }, _callee);
16737
+ }));
16738
+ return function getOrderList(_x) {
16739
+ return _ref.apply(this, arguments);
16740
+ };
16741
+ }();
16742
+ var changeTypeHandle = function changeTypeHandle(val) {
16743
+ var _typeMap$type7;
16744
+ var typeName = val === null || val === void 0 ? void 0 : val[0];
16745
+ // if (typeName === value?.[typeMap[type]?.typeName]?.[0]) return
16746
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
16747
+ var newValue = _objectSpread2({}, value);
16748
+ newValue[(_typeMap$type7 = typeMap$2[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName] = val;
16749
+ if (typeName === '1') {
16750
+ var _typeMap$type8;
16751
+ newValue[(_typeMap$type8 = typeMap$2[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.key] = getGoodDetails({
16752
+ mode: isStrict
16753
+ });
16754
+ } else if (typeName === '2') {
16755
+ var _typeMap$type9;
16756
+ // 切换到非原单,清空列表
16757
+ newValue[(_typeMap$type9 = typeMap$2[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = [];
16758
+ }
16759
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16760
+ };
16761
+ var handleModeChange = function handleModeChange(mode) {
16762
+ var _value$typeMap$type$t, _typeMap$type10, _typeMap$type11;
16763
+ var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type10 = typeMap$2[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0]) === '1';
16764
+ setIsStrict(mode);
16765
+ if (!isOriginalOrder) return;
16766
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type11 = typeMap$2[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.key, getGoodDetails({
16767
+ mode: mode
16768
+ }))));
16769
+ };
16770
+ var getGoodDetails = function getGoodDetails(_ref3) {
16771
+ var _typeMap$type12, _typeMap$type13, _order$orderDetailGet;
16772
+ var mode = _ref3.mode,
16773
+ sysOrderNo = _ref3.sysOrderNo;
16774
+ var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type12 = typeMap$2[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.systemOrder];
16775
+ var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$2[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrderNo];
16776
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
16777
+ return order.orderSn === systemOrderNo;
16778
+ });
16779
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$orderDetailGet = order.orderDetailGets) === null || _order$orderDetailGet === void 0 ? void 0 : _order$orderDetailGet.length) ? updateBsE3GoodsHandle([order]) : [];
16780
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
16781
+ return mode ? goodDetails.filter(function (goodItem) {
16782
+ return !orderNo || goodItem.originalOrderSn === orderNo;
16783
+ }) : goodDetails;
16784
+ };
16785
+ var changeGoodHandle = function changeGoodHandle(val) {
16786
+ var _typeMap$type14;
16787
+ var newValue = _objectSpread2({}, value);
16788
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type14 = typeMap$2[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key)] = val || [];
16789
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16790
+ };
16791
+ var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
16792
+ var _typeMap$type15, _value$typeMap$type$t2, _typeMap$type16, _value$typeMap$type$t3, _typeMap$type18;
16793
+ var newValue = _objectSpread2({}, value);
16794
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type15 = typeMap$2[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.systemOrderNo)] = val;
16795
+ if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type16 = typeMap$2[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
16796
+ var _typeMap$type17;
16797
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type17 = typeMap$2[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.key)] = [];
16798
+ } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type18 = typeMap$2[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
16799
+ var _typeMap$type19;
16800
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = getGoodDetails({
16801
+ mode: isStrict,
16802
+ sysOrderNo: val
16803
+ });
16804
+ }
16805
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16806
+ };
16807
+ //显示选择商品按钮 原单换不显示选择商品
16808
+ var showChangeBtn = useMemo(function () {
16809
+ var _typeMap$type20;
16810
+ return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.systemOrderNo]);
16811
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo]]);
16812
+ var selectedGoodsChange = useCallback(function (skuList) {
16813
+ var _typeMap$type22, _typeMap$type23, _uniqBy;
16814
+ var newValue = _objectSpread2({}, value);
16815
+ // 原订单商品
16816
+ var originTradeGoodList = getGoodDetails({
16817
+ mode: isStrict
16818
+ }) || [];
16819
+ // 当前选中的所有商品【包含了原订单+商品库】
16820
+ var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)]) || [];
16821
+ newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
16822
+ return skuList.includes(item.uuid);
16823
+ });
16824
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
16825
+ }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)], isStrict]);
16826
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
16827
+ gutter: 8,
16828
+ wrap: true,
16829
+ id: "bsE3ReissueGoods"
16830
+ }, /*#__PURE__*/React.createElement(Col, {
16831
+ className: "gutter-row",
16832
+ xs: {
16833
+ span: 11
16834
+ },
16835
+ sm: {
16836
+ span: 6
16837
+ }
16838
+ }, /*#__PURE__*/React.createElement(Select, {
16839
+ style: {
16840
+ marginBottom: '8px'
16841
+ },
16842
+ disabled: disabled,
16843
+ allowClear: false,
16844
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderNo)],
16845
+ onChange: function onChange(val) {
16846
+ return changeSystemOrderHandle(val);
16847
+ },
16848
+ placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
16849
+ }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
16850
+ return /*#__PURE__*/React.createElement(Select.Option, {
16851
+ key: item.billNo,
16852
+ value: item.billNo,
16853
+ label: item.billNo
16854
+ }, item.billNo);
16855
+ }))), /*#__PURE__*/React.createElement(Col, {
16856
+ className: "gutter-row",
16857
+ xs: {
16858
+ span: 11
16859
+ },
16860
+ sm: {
16861
+ span: 6
16862
+ }
16863
+ }, /*#__PURE__*/React.createElement(Cascader, {
16864
+ style: {
16865
+ marginBottom: '8px'
16866
+ },
16867
+ disabled: disabled,
16868
+ allowClear: false,
16869
+ options: reasonList,
16870
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.typeName)],
16871
+ onChange: function onChange(val) {
16872
+ return changeTypeHandle(val);
16873
+ }
16874
+ }))), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
16875
+ key: 'reissueGoods'
16876
+ }, other), {}, {
16877
+ type: type,
16878
+ disabled: disabled,
16879
+ canUpdateNumber: showChangeBtn,
16880
+ showChangeBtn: showChangeBtn,
16881
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
16882
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type28 = typeMap$2[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.key)],
16883
+ onChange: function onChange(val) {
16884
+ return changeGoodHandle(val);
16885
+ },
16886
+ onModeChange: handleModeChange,
16887
+ showModeBtn: false,
16888
+ isStrict: isStrict,
16889
+ tradeGoods: {
16890
+ originDataSource: getGoodDetails({
16891
+ mode: isStrict
16892
+ }),
16893
+ selectedGoodsChange: selectedGoodsChange
16894
+ }
16895
+ })));
16896
+ };
16897
+
16898
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap };