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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3,8 +3,8 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, WdtSendData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
- import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight } from 'lodash';
6
+ import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, 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';
8
8
  import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
9
9
  import zhCN from 'antd/lib/locale/zh_CN';
10
10
  import pubsub from 'pubsub-js';
@@ -917,8 +917,8 @@ function dataURLtoFile(dataurl, filename) {
917
917
  });
918
918
  }
919
919
 
920
- var css_248z$1 = ".index-module_imageBox__8zj7A {\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_imageBox__8zj7A .ant-upload-picture-card-wrapper {\n width: auto;\n}\n.index-module_imageBox__8zj7A .index-module_inputImage__3VrvC {\n width: 80px;\n height: 80px;\n border: 1px dashed #ccc;\n outline: none;\n background-color: rgba(0, 0, 0, 0);\n text-indent: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageShow__3wD4d {\n padding: 8px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo {\n width: 80px;\n height: 80px;\n position: relative;\n border-radius: 2px;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover {\n background: transparent;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover .index-module_mask__3LUIn:before {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo .index-module_delete__2cFpf {\n position: absolute;\n right: 0px;\n top: 0px;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn::before {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: all 0.3s;\n content: ' ';\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn:hover .index-module_actions__2tY_V {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 10;\n white-space: nowrap;\n transform: translate(-50%, -50%);\n opacity: 0;\n transition: all 0.3s;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V .index-module_icon__ZI-2P {\n font-size: 16px;\n color: #fff;\n padding: 0 4px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 {\n display: inline-block;\n margin-right: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA {\n width: 80px;\n height: 80px;\n border-radius: 2px;\n background: #F2F3F5;\n text-align: center;\n color: #86909C;\n padding-top: 16px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload {\n height: 80px;\n width: 80px;\n border: none;\n background-color: #F2F3F5;\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_tips__1ATcr {\n color: #4E5969;\n font-size: 12px;\n}\n";
921
- var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-module_inputImage__3VrvC","imageShow":"index-module_imageShow__3wD4d","imageWrap":"index-module_imageWrap__JkMJo","-webkit-mask":"index-module_mask__3LUIn","mask":"index-module_mask__3LUIn","delete":"index-module_delete__2cFpf","actions":"index-module_actions__2tY_V","icon":"index-module_icon__ZI-2P","imagePaste":"index-module_imagePaste__2X-K1","fakeBox":"index-module_fakeBox__2_3rA","addBtn":"index-module_addBtn__2m5lC","upload":"index-module_upload__2igU3","tips":"index-module_tips__1ATcr"};
920
+ var css_248z$1 = ".index-module_imageBox__8zj7A {\n display: flex;\n flex-wrap: wrap;\n}\n.index-module_imageBox__8zj7A .ant-upload-picture-card-wrapper {\n width: auto;\n}\n.index-module_imageBox__8zj7A .index-module_inputImage__3VrvC {\n width: 80px;\n height: 80px;\n border: 1px dashed #ccc;\n outline: none;\n background-color: rgba(0, 0, 0, 0);\n text-indent: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageShow__3wD4d {\n padding: 8px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo {\n width: 80px;\n height: 80px;\n position: relative;\n border-radius: 2px;\n margin-right: 8px;\n margin-bottom: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover {\n background: transparent;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo:hover .index-module_mask__3LUIn:before {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.index-module_imageBox__8zj7A .index-module_imageWrap__JkMJo .index-module_deleteIcon__20Wzd {\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn {\n position: relative;\n height: 100%;\n overflow: hidden;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn::before {\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: all 0.3s;\n content: ' ';\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn:hover .index-module_actions__2tY_V {\n opacity: 1;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V {\n position: absolute;\n top: 50%;\n left: 50%;\n z-index: 10;\n white-space: nowrap;\n transform: translate(-50%, -50%);\n opacity: 0;\n transition: all 0.3s;\n}\n.index-module_imageBox__8zj7A .index-module_mask__3LUIn .index-module_actions__2tY_V .index-module_icon__ZI-2P {\n font-size: 16px;\n color: #fff;\n padding: 0 4px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 {\n display: inline-block;\n margin-right: 8px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA {\n width: 80px;\n height: 80px;\n border-radius: 2px;\n background: #F2F3F5;\n text-align: center;\n color: #86909C;\n padding-top: 16px;\n}\n.index-module_imageBox__8zj7A .index-module_imagePaste__2X-K1 .index-module_fakeBox__2_3rA .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload {\n height: 80px;\n width: 80px;\n border: none;\n background-color: #F2F3F5;\n color: #86909C;\n}\n.index-module_imageBox__8zj7A .index-module_upload__2igU3 .ant-upload .index-module_addBtn__2m5lC {\n color: #86909C;\n}\n.index-module_tips__1ATcr {\n color: #4E5969;\n font-size: 12px;\n}\n";
921
+ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-module_inputImage__3VrvC","imageShow":"index-module_imageShow__3wD4d","imageWrap":"index-module_imageWrap__JkMJo","-webkit-mask":"index-module_mask__3LUIn","mask":"index-module_mask__3LUIn","deleteIcon":"index-module_deleteIcon__20Wzd","actions":"index-module_actions__2tY_V","icon":"index-module_icon__ZI-2P","imagePaste":"index-module_imagePaste__2X-K1","fakeBox":"index-module_fakeBox__2_3rA","addBtn":"index-module_addBtn__2m5lC","upload":"index-module_upload__2igU3","tips":"index-module_tips__1ATcr"};
922
922
  styleInject(css_248z$1);
923
923
 
924
924
  var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
@@ -939,7 +939,6 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
939
939
  _ref$accept = _ref.accept,
940
940
  accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
941
941
  _ref$canPreview = _ref.canPreview,
942
- canPreview = _ref$canPreview === void 0 ? true : _ref$canPreview,
943
942
  _ref$disabled = _ref.disabled,
944
943
  disabled = _ref$disabled === void 0 ? false : _ref$disabled,
945
944
  uniqueKey = _ref.uniqueKey,
@@ -1096,39 +1095,25 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
1096
1095
  }));
1097
1096
  };
1098
1097
  };
1099
- var handlePreview = function handlePreview(imgUrl) {
1100
- return function () {
1101
- setCurrentPreviewImg(imgUrl);
1102
- setVisible(true);
1103
- };
1104
- };
1105
1098
  var renderImages = function renderImages(images) {
1106
- return images.map(function (image, index) {
1099
+ return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, images.map(function (image, index) {
1107
1100
  var finalImage = "".concat(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image, "?x-oss-process=image/resize,h_60,w_60");
1101
+ var showImage = /^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image;
1108
1102
  return /*#__PURE__*/React.createElement("div", {
1109
1103
  className: styles$1.imageWrap,
1110
1104
  key: index
1111
- }, /*#__PURE__*/React.createElement("div", {
1112
- className: styles$1.mask
1113
- }, /*#__PURE__*/React.createElement("img", {
1114
- src: finalImage
1115
- }), /*#__PURE__*/React.createElement("div", {
1116
- className: styles$1.actions
1117
- }, canPreview && /*#__PURE__*/React.createElement(EyeOutlined, {
1118
- style: {
1119
- fontSize: '16px',
1120
- color: '#FFF',
1121
- marginRight: '8px'
1122
- },
1123
- onClick: handlePreview(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image)
1124
- }), /*#__PURE__*/React.createElement(DeleteOutlined, {
1125
- style: {
1126
- fontSize: '16px',
1127
- color: '#FFF'
1105
+ }, /*#__PURE__*/React.createElement(Image, {
1106
+ src: finalImage,
1107
+ preview: {
1108
+ src: showImage
1128
1109
  },
1110
+ width: '100%',
1111
+ height: '80%'
1112
+ }), /*#__PURE__*/React.createElement("div", {
1113
+ className: styles$1.deleteIcon,
1129
1114
  onClick: handleDelete(index)
1130
- }))));
1131
- });
1115
+ }, "\u5220\u9664"));
1116
+ }));
1132
1117
  };
1133
1118
  useEffect(function () {
1134
1119
  var _inputRef$current2;
@@ -11685,9 +11670,11 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
11685
11670
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11686
11671
 
11687
11672
  var getTableData = function getTableData(_ref, formData) {
11673
+ var _formData$brandIds;
11688
11674
  var current = _ref.current,
11689
11675
  pageSize = _ref.pageSize;
11690
11676
  var data = {
11677
+ brandIds: ((_formData$brandIds = formData.brandIds) === null || _formData$brandIds === void 0 ? void 0 : _formData$brandIds.length) ? formData.brandIds : null,
11691
11678
  skuCode: formData.skuCode || null,
11692
11679
  skuName: formData.skuName || null,
11693
11680
  goodName: formData.goodName || null,
@@ -11772,6 +11759,11 @@ var columns$1 = [{
11772
11759
  title: '商品ID',
11773
11760
  width: 200,
11774
11761
  ellipsis: true
11762
+ }, {
11763
+ dataIndex: 'brandName',
11764
+ title: '品牌名称',
11765
+ width: 200,
11766
+ ellipsis: true
11775
11767
  }, {
11776
11768
  dataIndex: 'marketPrice',
11777
11769
  title: '市场价',
@@ -11803,6 +11795,10 @@ var GoodList = function GoodList(props, ref) {
11803
11795
  _useState4 = _slicedToArray(_useState3, 2),
11804
11796
  selectIds = _useState4[0],
11805
11797
  setSelectIds = _useState4[1];
11798
+ var _useState5 = useState([]),
11799
+ _useState6 = _slicedToArray(_useState5, 2),
11800
+ brandList = _useState6[0],
11801
+ setBrandList = _useState6[1];
11806
11802
  useImperativeHandle(ref, function () {
11807
11803
  return {
11808
11804
  getSelectGoodList: function getSelectGoodList() {
@@ -11822,6 +11818,38 @@ var GoodList = function GoodList(props, ref) {
11822
11818
  params = _useAntdTable.params;
11823
11819
  var submit = search.submit,
11824
11820
  reset = search.reset;
11821
+ var setGoodBrandList = function setGoodBrandList() {
11822
+ var list = [];
11823
+ var pageNo = 0;
11824
+ var pageSize = 100;
11825
+ var getMore = function getMore() {
11826
+ extendRequest('/qy/gdfw/wdt/erp/goodBrand/list', {
11827
+ method: 'post',
11828
+ data: {
11829
+ pageSize: pageSize,
11830
+ pageNo: pageNo
11831
+ }
11832
+ }).then(function (res) {
11833
+ var _res$data2;
11834
+ if (res.success && (res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.detailList)) {
11835
+ var _res$data3, _res$data4;
11836
+ list.push.apply(list, _toConsumableArray((res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.detailList) || []));
11837
+ if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.detailList.length) === pageSize) {
11838
+ pageNo += 1;
11839
+ getMore();
11840
+ } else {
11841
+ setBrandList(list);
11842
+ }
11843
+ } else {
11844
+ reject(res);
11845
+ }
11846
+ }).catch(console.error);
11847
+ };
11848
+ getMore();
11849
+ };
11850
+ React.useEffect(function () {
11851
+ setGoodBrandList();
11852
+ }, []);
11825
11853
  var advanceSearchForm = /*#__PURE__*/React.createElement(Form, {
11826
11854
  layout: "inline",
11827
11855
  form: form
@@ -11869,6 +11897,32 @@ var GoodList = function GoodList(props, ref) {
11869
11897
  style: {
11870
11898
  width: 150
11871
11899
  }
11900
+ })), /*#__PURE__*/React.createElement(Form.Item, {
11901
+ name: "brandIds",
11902
+ style: {
11903
+ marginBottom: '12px'
11904
+ }
11905
+ }, /*#__PURE__*/React.createElement(Select, {
11906
+ mode: "multiple",
11907
+ showSearch: true,
11908
+ allowClear: true,
11909
+ filterOption: function filterOption(input, option) {
11910
+ return option.label.includes(input);
11911
+ },
11912
+ style: {
11913
+ width: 150
11914
+ },
11915
+ placeholder: "\u54C1\u724C",
11916
+ options: brandList.filter(function (item) {
11917
+ return !item.isDisabled;
11918
+ }).map(function (_ref2) {
11919
+ var value = _ref2.brandId,
11920
+ label = _ref2.brandName;
11921
+ return {
11922
+ value: value,
11923
+ label: label
11924
+ };
11925
+ })
11872
11926
  })), /*#__PURE__*/React.createElement(Form.Item, {
11873
11927
  style: {
11874
11928
  marginBottom: '12px'
@@ -12025,112 +12079,514 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
12025
12079
  };
12026
12080
  var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
12027
12081
 
12028
- // interface GoodsItem {
12029
- // title: string;
12030
- // pic: string;
12031
- // platform: string;
12032
- // skuId: string;
12033
- // styleId: string;
12034
- // }
12035
- var GoodItem$1 = function GoodItem(props) {
12036
- var _props$value = props.value,
12037
- value = _props$value === void 0 ? [] : _props$value,
12038
- type = props.type,
12039
- onChange = props.onChange,
12040
- disabled = props.disabled,
12041
- _props$showHeader = props.showHeader,
12042
- showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
12043
- width = props.width,
12044
- _props$shopList = props.shopList,
12045
- shopList = _props$shopList === void 0 ? [] : _props$shopList,
12046
- _props$shopId = props.shopId,
12047
- shopId = _props$shopId === void 0 ? '' : _props$shopId,
12048
- _props$maxLength = props.maxLength,
12049
- maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
12050
- _props$showChangeBtn = props.showChangeBtn,
12051
- showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
12052
- _props$tableSelect = props.tableSelect,
12053
- tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
12054
- _props$selectType = props.selectType,
12055
- selectType = _props$selectType === void 0 ? '' : _props$selectType,
12056
- _props$otherOperation = props.otherOperations,
12057
- otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
12058
- _props$canUpdateNumbe = props.canUpdateNumber,
12059
- canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
12060
- shopCode = props.shopCode,
12061
- _props$companyKey = props.companyKey,
12062
- companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
12063
- onSelect = props.onSelect,
12064
- onDelete = props.onDelete;
12065
- var refModal = useRef();
12066
- var handleDelete = function handleDelete(record, index) {
12067
- onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
12068
- var newList = _toConsumableArray(value).filter(function (item, i) {
12069
- return index !== i;
12070
- });
12071
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
12082
+ var getTableData$1 = function getTableData(_ref, formData) {
12083
+ var current = _ref.current,
12084
+ pageSize = _ref.pageSize;
12085
+ var data = {
12086
+ goodsSn: formData.goodsSn || null,
12087
+ goodsName: formData.goodsName || null,
12088
+ sku: formData.sku || null,
12089
+ skuId: formData.skuId || null
12072
12090
  };
12091
+ return extendRequest('/qy/gdfw/product/product/page', {
12092
+ method: 'post',
12093
+ data: _objectSpread2({
12094
+ pageSize: pageSize,
12095
+ pageNo: current,
12096
+ platform: 'WDT_ERP'
12097
+ }, data)
12098
+ }).then(function (res) {
12099
+ var _res$data = res.data,
12100
+ _res$data$productSkuL = _res$data.productSkuList,
12101
+ productSkuList = _res$data$productSkuL === void 0 ? [] : _res$data$productSkuL,
12102
+ _res$data$total = _res$data.total,
12103
+ total = _res$data$total === void 0 ? 0 : _res$data$total;
12104
+ var newProducts = productSkuList.map(function (item, index) {
12105
+ return _objectSpread2(_objectSpread2({}, item), {}, {
12106
+ index: index + 1
12107
+ });
12108
+ });
12109
+ return {
12110
+ total: total,
12111
+ list: newProducts
12112
+ };
12113
+ });
12114
+ };
12115
+ var columns$2 = [{
12116
+ dataIndex: 'index',
12117
+ title: 'NO',
12118
+ render: function render(val, record, index) {
12119
+ return /*#__PURE__*/React.createElement("div", {
12120
+ style: {
12121
+ width: 25
12122
+ }
12123
+ }, index + 1);
12124
+ },
12125
+ width: 100
12126
+ }, {
12127
+ dataIndex: 'sku',
12128
+ title: "SKU",
12129
+ ellipsis: true,
12130
+ width: 70
12131
+ }, {
12132
+ dataIndex: 'skuId',
12133
+ title: "SKU ID",
12134
+ ellipsis: true,
12135
+ width: 70
12136
+ }, {
12137
+ dataIndex: 'goodsName',
12138
+ title: "\u5546\u54C1\u540D\u79F0",
12139
+ ellipsis: true,
12140
+ width: 70
12141
+ }, {
12142
+ dataIndex: 'goodsShortName',
12143
+ title: "\u5546\u54C1\u7B80\u79F0",
12144
+ 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',
12163
+ title: "\u8D27\u53F7",
12164
+ ellipsis: true,
12165
+ width: 70
12166
+ }, {
12167
+ dataIndex: 'goodsId',
12168
+ title: "\u8D27\u53F7ID",
12169
+ ellipsis: true,
12170
+ width: 70
12171
+ }, {
12172
+ dataIndex: 'colorName',
12173
+ title: "\u989C\u8272\u540D\u79F0",
12174
+ ellipsis: true,
12175
+ width: 70
12176
+ }, {
12177
+ dataIndex: 'colorCode',
12178
+ title: "\u989C\u8272\u4EE3\u7801",
12179
+ ellipsis: true,
12180
+ width: 70
12181
+ }, {
12182
+ dataIndex: 'sizeName',
12183
+ title: "\u5C3A\u7801\u540D\u79F0",
12184
+ ellipsis: true,
12185
+ width: 70
12186
+ }, {
12187
+ dataIndex: 'sizeCode',
12188
+ title: "\u5C3A\u7801\u4EE3\u7801",
12189
+ ellipsis: true,
12190
+ width: 70
12191
+ }, {
12192
+ dataIndex: 'brandName',
12193
+ title: "\u54C1\u724C\u540D\u79F0",
12194
+ 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
12236
+ }, {
12237
+ dataIndex: 'taoCanSingleSl',
12238
+ title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
12239
+ ellipsis: true,
12240
+ width: 70
12241
+ }, {
12242
+ dataIndex: 'isGift',
12243
+ title: "\u662F\u5426\u8D60\u54C1",
12244
+ ellipsis: true,
12245
+ width: 70
12246
+ }];
12247
+ var GoodList$1 = function GoodList(props, ref) {
12073
12248
  var _useState = useState([]),
12074
12249
  _useState2 = _slicedToArray(_useState, 2),
12075
- selectedRowKeys = _useState2[0],
12076
- setSelectedRowKeys = _useState2[1];
12077
- useEffect(function () {
12078
- setSelectedRowKeys([]);
12079
- }, [tableSelect, selectType]);
12080
- var updateHandle = function updateHandle(val, index, columnType) {
12081
- if (value === null || value === void 0 ? void 0 : value.length) {
12082
- value[index][columnType] = val;
12083
- if (type === 'WDT_RETURN_GOODS') {
12084
- if (['sharePrice', 'num'].includes(columnType)) {
12085
- var totalMoney = null;
12086
- if (columnType === 'num') {
12087
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
12088
- } else {
12089
- totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
12090
- }
12091
- if (totalMoney !== null) {
12092
- value[index]['returnPrice'] = totalMoney.toString();
12093
- }
12094
- }
12095
- } else if (type === 'WDT_EXCHANGE_GOODS') {
12096
- if (['price', 'num'].includes(columnType)) {
12097
- var _totalMoney = null;
12098
- if (columnType === 'num') {
12099
- _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
12100
- } else {
12101
- _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
12102
- }
12103
- if (_totalMoney !== null) {
12104
- value[index]['exchangePrice'] = _totalMoney.toString();
12105
- }
12106
- }
12250
+ selectList = _useState2[0],
12251
+ setSelect = _useState2[1];
12252
+ var _useState3 = useState([]),
12253
+ _useState4 = _slicedToArray(_useState3, 2),
12254
+ selectIds = _useState4[0],
12255
+ setSelectIds = _useState4[1];
12256
+ useImperativeHandle(ref, function () {
12257
+ return {
12258
+ getSelectGoodList: function getSelectGoodList() {
12259
+ return selectList;
12107
12260
  }
12108
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
12261
+ };
12262
+ });
12263
+ var _Form$useForm = Form.useForm(),
12264
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
12265
+ form = _Form$useForm2[0];
12266
+ var _useAntdTable = useAntdTable(getTableData$1, {
12267
+ defaultPageSize: 10,
12268
+ form: form
12269
+ }),
12270
+ tableProps = _useAntdTable.tableProps,
12271
+ search = _useAntdTable.search,
12272
+ params = _useAntdTable.params;
12273
+ var submit = search.submit,
12274
+ reset = search.reset;
12275
+ var advanceSearchForm = /*#__PURE__*/React.createElement(Form, {
12276
+ layout: "inline",
12277
+ form: form
12278
+ }, /*#__PURE__*/React.createElement(Form.Item, {
12279
+ name: "goodsSn",
12280
+ style: {
12281
+ marginBottom: '12px'
12109
12282
  }
12110
- };
12111
- var COLUMNS_MAP = function COLUMNS_MAP() {
12112
- var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12113
- return function (type) {
12114
- var columns = [];
12115
- switch (type) {
12116
- case 'WDT_REISSUE_GOODS':
12117
- case 'WDT_GOODS':
12118
- columns = [{
12119
- dataIndex: 'goodId',
12120
- title: "\u5546\u54C1ID",
12121
- align: 'center',
12122
- ellipsis: true,
12123
- width: 70
12124
- }, {
12125
- dataIndex: 'goodNo',
12126
- title: "\u5546\u54C1\u7F16\u7801",
12127
- align: 'center',
12128
- ellipsis: true,
12129
- width: 180
12130
- }, {
12131
- dataIndex: 'goodName',
12132
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
12133
- align: 'center',
12283
+ }, /*#__PURE__*/React.createElement(Input, {
12284
+ placeholder: "\u5546\u54C1\u8D27\u53F7",
12285
+ allowClear: true,
12286
+ style: {
12287
+ width: 150
12288
+ }
12289
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12290
+ name: "goodsName",
12291
+ style: {
12292
+ marginBottom: '12px'
12293
+ }
12294
+ }, /*#__PURE__*/React.createElement(Input, {
12295
+ placeholder: "\u5546\u54C1\u540D\u79F0",
12296
+ allowClear: true,
12297
+ style: {
12298
+ width: 150
12299
+ }
12300
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12301
+ name: "sku",
12302
+ style: {
12303
+ marginBottom: '12px'
12304
+ }
12305
+ }, /*#__PURE__*/React.createElement(Input, {
12306
+ placeholder: "SKU",
12307
+ allowClear: true,
12308
+ style: {
12309
+ width: 150
12310
+ }
12311
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12312
+ name: "skuId",
12313
+ style: {
12314
+ marginBottom: '12px'
12315
+ }
12316
+ }, /*#__PURE__*/React.createElement(Input, {
12317
+ placeholder: "SKU ID",
12318
+ allowClear: true,
12319
+ style: {
12320
+ width: 150
12321
+ }
12322
+ })), /*#__PURE__*/React.createElement(Form.Item, {
12323
+ style: {
12324
+ marginBottom: '12px'
12325
+ }
12326
+ }, /*#__PURE__*/React.createElement(Button, {
12327
+ type: "primary",
12328
+ style: {
12329
+ marginRight: '8px'
12330
+ },
12331
+ onClick: submit
12332
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
12333
+ onClick: reset
12334
+ }, "\u91CD\u7F6E")));
12335
+ var rowSelection = {
12336
+ selectedRowKeys: selectIds,
12337
+ fixed: true,
12338
+ onSelect: function onSelect(record, selected) {
12339
+ if (selected) {
12340
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.specNo]));
12341
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
12342
+ } else {
12343
+ setSelectIds(selectIds.filter(function (t) {
12344
+ return t !== record.specNo;
12345
+ }));
12346
+ setSelect(selectList.filter(function (t) {
12347
+ return t.specNo !== record.specNo;
12348
+ }));
12349
+ }
12350
+ },
12351
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
12352
+ if (selected) {
12353
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
12354
+ return t.specNo;
12355
+ }))));
12356
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
12357
+ } else {
12358
+ setSelectIds(difference(selectIds, changeRows.map(function (t) {
12359
+ return t.specNo;
12360
+ })));
12361
+ var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
12362
+ return arrVal.specNo !== othVal.specNo;
12363
+ });
12364
+ setSelect(list);
12365
+ }
12366
+ }
12367
+ };
12368
+ var showTable = function showTable() {
12369
+ var handleDelete = function handleDelete(record) {
12370
+ setSelectIds(selectIds.filter(function (t) {
12371
+ return t !== record.specNo;
12372
+ }));
12373
+ setSelect(selectList.filter(function (t) {
12374
+ return t.specNo !== record.specNo;
12375
+ }));
12376
+ };
12377
+ var showColumns = [{
12378
+ dataIndex: '',
12379
+ title: "\u64CD\u4F5C",
12380
+ ellipsis: true,
12381
+ width: 100,
12382
+ render: function render(val, record) {
12383
+ return /*#__PURE__*/React.createElement(Button, {
12384
+ type: "link",
12385
+ onClick: function onClick() {
12386
+ return handleDelete(record);
12387
+ }
12388
+ }, "\u5220\u9664");
12389
+ }
12390
+ }].concat(takeRight(columns$2, columns$2.length - 1));
12391
+ return selectList.length ? /*#__PURE__*/React.createElement("div", {
12392
+ style: {
12393
+ width: '100%',
12394
+ maxWidth: '387px'
12395
+ }
12396
+ }, /*#__PURE__*/React.createElement(Table, {
12397
+ columns: showColumns,
12398
+ rowKey: 'specNo',
12399
+ dataSource: selectList,
12400
+ scroll: {
12401
+ x: '100%',
12402
+ y: 250
12403
+ },
12404
+ pagination: {
12405
+ size: 'small',
12406
+ total: selectIds.length,
12407
+ pageSize: 10,
12408
+ showSizeChanger: false
12409
+ }
12410
+ })) : null;
12411
+ };
12412
+ return /*#__PURE__*/React.createElement(React.Fragment, null, advanceSearchForm, /*#__PURE__*/React.createElement("div", {
12413
+ style: {
12414
+ marginTop: '4px'
12415
+ }
12416
+ }, /*#__PURE__*/React.createElement(Table, _objectSpread2({
12417
+ rowSelection: rowSelection,
12418
+ rowKey: "goodsId",
12419
+ columns: columns$2,
12420
+ scroll: {
12421
+ x: '100%',
12422
+ y: 250
12423
+ }
12424
+ }, tableProps))), /*#__PURE__*/React.createElement(Popover, {
12425
+ getPopupContainer: function getPopupContainer(triggerNode) {
12426
+ return triggerNode.parentElement;
12427
+ },
12428
+ content: showTable(),
12429
+ title: "\u5DF2\u9009\u62E9".concat(selectList.length, "\u4E2A\u5546\u54C1")
12430
+ }, /*#__PURE__*/React.createElement(Button, {
12431
+ danger: true,
12432
+ type: "text"
12433
+ }, "\u5DF2\u9009".concat(selectList.length > 99 ? '99+' : selectList.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React.createElement(CaretUpOutlined, null))));
12434
+ };
12435
+ var BsE3GoodList = /*#__PURE__*/forwardRef(GoodList$1);
12436
+
12437
+ var GoodsModal$4 = function GoodsModal(props, ref) {
12438
+ useImperativeHandle(ref, function () {
12439
+ return {
12440
+ open: function open() {
12441
+ setVisible(true);
12442
+ }
12443
+ };
12444
+ });
12445
+ var onSubmit = props.onSubmit,
12446
+ width = props.width;
12447
+ var _useState = useState(false),
12448
+ _useState2 = _slicedToArray(_useState, 2),
12449
+ visible = _useState2[0],
12450
+ setVisible = _useState2[1];
12451
+ var bsE3GoodListRef = useRef(null);
12452
+ var _onCancel = function onCancel() {
12453
+ setVisible(false);
12454
+ };
12455
+ var onOk = function onOk() {
12456
+ var _bsE3GoodListRef$curr;
12457
+ var selectedList = ((_bsE3GoodListRef$curr = bsE3GoodListRef.current) === null || _bsE3GoodListRef$curr === void 0 ? void 0 : _bsE3GoodListRef$curr.getSelectGoodList()) || [];
12458
+ onSubmit(selectedList);
12459
+ _onCancel();
12460
+ };
12461
+ return /*#__PURE__*/React.createElement(React.Fragment, null, visible && /*#__PURE__*/React.createElement(Modal, {
12462
+ title: '选择商品',
12463
+ okText: '确认',
12464
+ cancelText: '取消',
12465
+ visible: visible,
12466
+ width: width || 850,
12467
+ onCancel: function onCancel() {
12468
+ _onCancel();
12469
+ },
12470
+ onOk: onOk,
12471
+ wrapClassName: "goodModal"
12472
+ }, /*#__PURE__*/React.createElement(BsE3GoodList, {
12473
+ ref: bsE3GoodListRef
12474
+ })));
12475
+ };
12476
+ var BsE3GoodsModal = /*#__PURE__*/forwardRef(GoodsModal$4);
12477
+
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));
12546
+ }
12547
+ if (totalMoney !== null) {
12548
+ value[index]['returnPrice'] = totalMoney.toString();
12549
+ }
12550
+ }
12551
+ } else if (type === 'WDT_EXCHANGE_GOODS') {
12552
+ if (['price', 'num'].includes(columnType)) {
12553
+ var _totalMoney = null;
12554
+ if (columnType === 'num') {
12555
+ _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
12556
+ } else {
12557
+ _totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
12558
+ }
12559
+ if (_totalMoney !== null) {
12560
+ value[index]['exchangePrice'] = _totalMoney.toString();
12561
+ }
12562
+ }
12563
+ }
12564
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
12565
+ }
12566
+ };
12567
+ var COLUMNS_MAP = function COLUMNS_MAP() {
12568
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
12569
+ return function (type) {
12570
+ var columns = [];
12571
+ switch (type) {
12572
+ case 'WDT_REISSUE_GOODS':
12573
+ 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',
12134
12590
  ellipsis: true,
12135
12591
  width: 250
12136
12592
  }, {
@@ -12395,72 +12851,215 @@ var GoodItem$1 = function GoodItem(props) {
12395
12851
  }) : /*#__PURE__*/React.createElement("span", null, val);
12396
12852
  }
12397
12853
  }, {
12398
- dataIndex: 'price',
12399
- title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
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
+ }];
12921
+ }
12922
+ break;
12923
+ case 'BS_E3_GOODS':
12924
+ {
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",
12400
13036
  align: 'center',
12401
13037
  ellipsis: true,
12402
- width: 100,
12403
- render: function render(val, record, index) {
12404
- return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
12405
- style: {
12406
- width: 70
12407
- },
12408
- value: val,
12409
- min: 0,
12410
- onChange: function onChange(value) {
12411
- return updateHandle(value, index, 'price');
12412
- }
12413
- }) : /*#__PURE__*/React.createElement("span", null, val);
12414
- }
13038
+ width: 120
12415
13039
  }, {
12416
- dataIndex: 'exchangePrice',
12417
- title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
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",
12418
13048
  align: 'center',
12419
13049
  ellipsis: true,
12420
13050
  width: 100
12421
13051
  }, {
12422
- dataIndex: 'giftType',
12423
- title: "\u8D60\u54C1\u65B9\u5F0F",
13052
+ dataIndex: 'taoCanSingleSl',
13053
+ title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
12424
13054
  align: 'center',
12425
13055
  ellipsis: true,
12426
- width: 100,
12427
- render: function render(val) {
12428
- var giftTypeMap = {
12429
- 0: '非赠品',
12430
- 1: '自动赠送',
12431
- 2: '手工赠送',
12432
- 3: '回购自动送赠品',
12433
- 4: '前N有礼送赠品',
12434
- 6: '天猫优仓赠品',
12435
- 7: '淘宝CRM会员送赠'
12436
- };
12437
- return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
12438
- }
13056
+ width: 100
12439
13057
  }, {
12440
- dataIndex: 'type',
12441
- title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
13058
+ dataIndex: 'isGift',
13059
+ title: "\u662F\u5426\u8D60\u54C1",
12442
13060
  align: 'center',
12443
13061
  ellipsis: true,
12444
- width: 100,
12445
- render: function render(val, record, index) {
12446
- var options = [{
12447
- label: '单品',
12448
- value: '1'
12449
- }, {
12450
- label: '组合装',
12451
- value: '2'
12452
- }];
12453
- return !disabled ? /*#__PURE__*/React.createElement(Select, {
12454
- style: {
12455
- width: 70
12456
- },
12457
- options: options,
12458
- value: val,
12459
- onChange: function onChange(value) {
12460
- return updateHandle(value, index, 'type');
12461
- }
12462
- }) : /*#__PURE__*/React.createElement("span", null, val);
12463
- }
13062
+ width: 100
12464
13063
  }];
12465
13064
  }
12466
13065
  break;
@@ -12619,6 +13218,15 @@ var GoodItem$1 = function GoodItem(props) {
12619
13218
  }
12620
13219
  return item;
12621
13220
  });
13221
+ } else if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
13222
+ 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;
13229
+ });
12622
13230
  } else {
12623
13231
  newList = list.map(function (item) {
12624
13232
  var goodsId = item.goodsId,
@@ -12661,6 +13269,9 @@ var GoodItem$1 = function GoodItem(props) {
12661
13269
  fixed: true,
12662
13270
  onChange: onSelectChange
12663
13271
  };
13272
+ var handleCheckboxChange = function handleCheckboxChange(e) {
13273
+ onModeChange === null || onModeChange === void 0 ? void 0 : onModeChange(e.target.checked);
13274
+ };
12664
13275
  var tableConfig = useMemo(function () {
12665
13276
  var params = {};
12666
13277
  if (tableSelect) {
@@ -12672,7 +13283,10 @@ var GoodItem$1 = function GoodItem(props) {
12672
13283
  style: {
12673
13284
  float: 'right'
12674
13285
  }
12675
- }, /*#__PURE__*/React.createElement(Button, {
13286
+ }, showModeBtn && /*#__PURE__*/React.createElement(Checkbox, {
13287
+ checked: isStrict,
13288
+ 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, {
12676
13290
  type: "link",
12677
13291
  onClick: handleChangeGoods
12678
13292
  }, "\u9009\u62E9\u5546\u54C1"), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
@@ -12695,6 +13309,14 @@ var GoodItem$1 = function GoodItem(props) {
12695
13309
  shopId: shopId,
12696
13310
  maxLength: maxLength,
12697
13311
  companyKey: companyKey
13312
+ }) : ['BS_E3_REISSUE_GOODS', 'BS_E3_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(BsE3GoodsModal, {
13313
+ ref: refModal,
13314
+ onSubmit: onSubmit,
13315
+ width: width,
13316
+ shopList: shopList,
13317
+ shopId: shopId,
13318
+ maxLength: maxLength,
13319
+ companyKey: companyKey
12698
13320
  }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
12699
13321
  ref: refModal,
12700
13322
  onSubmit: onSubmit,
@@ -13314,19 +13936,194 @@ var BsReturnGoods = function BsReturnGoods(props) {
13314
13936
  })));
13315
13937
  };
13316
13938
 
13317
- var columnsNameMap = {
13318
- BS_SYSTEM_ORDER: {
13319
- typeName: '单据类型',
13320
- tagName: '标签'
13321
- },
13322
- WLN_SYSTEM_ORDER: {
13323
- typeName: '订单类型',
13324
- tagName: '标记'
13325
- },
13326
- WDT_SYSTEM_ORDER: {
13327
- typeName: '订单类型',
13328
- tagName: '订单标签'
13939
+ var singletonMap = new Map();
13940
+ var getWdtOrderListSingleton = function getWdtOrderListSingleton(orderNo) {
13941
+ if (!singletonMap.has(orderNo)) {
13942
+ var p = new Promise(function (resolve, reject) {
13943
+ var doReject = function doReject(err) {
13944
+ // 清空掉错误的请求记录
13945
+ singletonMap.delete(orderNo);
13946
+ reject(err);
13947
+ };
13948
+ extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13949
+ method: 'post',
13950
+ data: {
13951
+ billNo: orderNo
13952
+ }
13953
+ }).then(function (data) {
13954
+ if (data === null || data === void 0 ? void 0 : data.success) {
13955
+ var _data$data, _data$data$trades;
13956
+ if (data === null || data === void 0 ? void 0 : (_data$data = data.data) === null || _data$data === void 0 ? void 0 : (_data$data$trades = _data$data.trades) === null || _data$data$trades === void 0 ? void 0 : _data$data$trades.length) {
13957
+ data.data.trades = filterWdtOrders(data === null || data === void 0 ? void 0 : data.data, orderNo).map(function (item) {
13958
+ return _objectSpread2(_objectSpread2({}, item), {}, {
13959
+ billNo: item.tradeNo,
13960
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13961
+ billTag: item.tagName
13962
+ });
13963
+ });
13964
+ }
13965
+ resolve(data.data);
13966
+ // 延迟10秒清除,保证订单的时效性
13967
+ setTimeout(function () {
13968
+ singletonMap.delete(orderNo);
13969
+ }, 1000 * 10);
13970
+ } else {
13971
+ doReject(data);
13972
+ }
13973
+ }).catch(doReject);
13974
+ });
13975
+ singletonMap.set(orderNo, p);
13976
+ }
13977
+ return singletonMap.get(orderNo);
13978
+ };
13979
+ var wdtUtils = {
13980
+ getWdtOrderListSingleton: getWdtOrderListSingleton
13981
+ };
13982
+
13983
+ var singletonMap$1 = new Map();
13984
+ var getBsE3OrderListSingleton = function getBsE3OrderListSingleton(orderNo) {
13985
+ if (!singletonMap$1.has(orderNo)) {
13986
+ var p = new Promise(function (resolve, reject) {
13987
+ var doReject = function doReject(err) {
13988
+ // 清空掉错误的请求记录
13989
+ // singletonMap.delete(orderNo);
13990
+ reject(err);
13991
+ };
13992
+ extendRequest('/qy/gdfw/order/bse3OrderDetail', {
13993
+ method: 'post',
13994
+ data: {
13995
+ billNo: orderNo
13996
+ }
13997
+ }).then(function (data) {
13998
+ if (data === null || data === void 0 ? void 0 : data.success) {
13999
+ var _data$data, _data$data$orderList;
14000
+ 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
+ });
14020
+ }
14021
+ resolve(data.data);
14022
+ } else {
14023
+ doReject(data);
14024
+ }
14025
+ }).catch(doReject);
14026
+ });
14027
+ singletonMap$1.set(orderNo, p);
13329
14028
  }
14029
+ return singletonMap$1.get(orderNo);
14030
+ };
14031
+ var bsE3Utils = {
14032
+ getBsE3OrderListSingleton: getBsE3OrderListSingleton
14033
+ };
14034
+
14035
+ var columnsMap = {
14036
+ BS_SYSTEM_ORDER: [{
14037
+ title: '单据类型',
14038
+ dataIndex: 'billType',
14039
+ width: 150
14040
+ }, {
14041
+ title: '系统订单号',
14042
+ dataIndex: 'billNo',
14043
+ width: 150
14044
+ }, {
14045
+ title: '标签',
14046
+ dataIndex: 'billTag',
14047
+ width: 150
14048
+ }],
14049
+ WLN_SYSTEM_ORDER: [{
14050
+ title: '订单类型',
14051
+ dataIndex: 'billType',
14052
+ width: 150
14053
+ }, {
14054
+ title: '系统订单号',
14055
+ dataIndex: 'billNo',
14056
+ width: 150
14057
+ }, {
14058
+ title: '标记',
14059
+ dataIndex: 'billTag',
14060
+ width: 150
14061
+ }],
14062
+ WDT_SYSTEM_ORDER: [{
14063
+ title: '订单类型',
14064
+ dataIndex: 'billType',
14065
+ width: 150
14066
+ }, {
14067
+ title: '系统订单号',
14068
+ dataIndex: 'billNo',
14069
+ width: 150
14070
+ }, {
14071
+ title: '订单标签',
14072
+ dataIndex: 'billTag',
14073
+ width: 150
14074
+ }],
14075
+ BS_E3_SYSTEM_ORDER: [{
14076
+ title: '系统订单号',
14077
+ dataIndex: 'orderSn',
14078
+ width: 150,
14079
+ ellipsis: true
14080
+ }, {
14081
+ title: '订单状态',
14082
+ dataIndex: 'orderStatus',
14083
+ width: 100,
14084
+ ellipsis: true
14085
+ }, {
14086
+ title: '是否被拆分',
14087
+ dataIndex: 'isSplit',
14088
+ width: 70,
14089
+ ellipsis: true
14090
+ }, {
14091
+ title: '是否拆分子单',
14092
+ dataIndex: 'isSplitNew',
14093
+ width: 70,
14094
+ ellipsis: true
14095
+ }, {
14096
+ title: '是否被合并',
14097
+ dataIndex: 'isCombine',
14098
+ width: 70,
14099
+ ellipsis: true
14100
+ }, {
14101
+ title: '是否合并新单',
14102
+ dataIndex: 'isCombineNew',
14103
+ width: 70,
14104
+ ellipsis: true
14105
+ }, {
14106
+ title: '是否复制单',
14107
+ dataIndex: 'isCopy',
14108
+ width: 70,
14109
+ ellipsis: true
14110
+ }, {
14111
+ title: '是否换货单',
14112
+ dataIndex: 'isExchangeOrder',
14113
+ width: 70,
14114
+ ellipsis: true
14115
+ }, {
14116
+ title: '订单备注',
14117
+ dataIndex: 'orderMsg',
14118
+ width: 150,
14119
+ ellipsis: true
14120
+ }]
14121
+ };
14122
+ var rowKeyMap = {
14123
+ BS_SYSTEM_ORDER: 'billNo',
14124
+ WLN_SYSTEM_ORDER: 'billNo',
14125
+ WDT_SYSTEM_ORDER: 'billNo',
14126
+ BS_E3_SYSTEM_ORDER: 'orderSn'
13330
14127
  };
13331
14128
  var index$1 = (function (props) {
13332
14129
  var value = props.value,
@@ -13344,21 +14141,13 @@ var index$1 = (function (props) {
13344
14141
  getWlnOrderList(value.orderNo);
13345
14142
  } else if (type === 'WDT_SYSTEM_ORDER') {
13346
14143
  getWdtOrderList(value.orderNo);
14144
+ } else if (type === 'BS_E3_SYSTEM_ORDER') {
14145
+ getBsE3OrderList(value.orderNo);
13347
14146
  }
13348
14147
  }
13349
14148
  }, [value, type]);
13350
14149
  var columns = useMemo(function () {
13351
- var _columnsNameMap$type, _columnsNameMap$type2;
13352
- return [{
13353
- dataIndex: 'billType',
13354
- title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type = columnsNameMap[type]) === null || _columnsNameMap$type === void 0 ? void 0 : _columnsNameMap$type.typeName
13355
- }, {
13356
- dataIndex: 'billNo',
13357
- title: '系统订单号'
13358
- }, {
13359
- dataIndex: 'billTag',
13360
- title: columnsNameMap === null || columnsNameMap === void 0 ? void 0 : (_columnsNameMap$type2 = columnsNameMap[type]) === null || _columnsNameMap$type2 === void 0 ? void 0 : _columnsNameMap$type2.tagName
13361
- }];
14150
+ return columnsMap[type] || [];
13362
14151
  }, [type]);
13363
14152
  var getOrderList = /*#__PURE__*/function () {
13364
14153
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
@@ -13448,51 +14237,29 @@ var index$1 = (function (props) {
13448
14237
  }();
13449
14238
  var getWdtOrderList = /*#__PURE__*/function () {
13450
14239
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
13451
- var _yield$request3, success, data, trades;
13452
14240
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
13453
14241
  while (1) switch (_context3.prev = _context3.next) {
13454
14242
  case 0:
13455
- _context3.next = 2;
13456
- return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
13457
- method: 'post',
13458
- data: {
13459
- billNo: orderNo
13460
- }
13461
- });
13462
- case 2:
13463
- _yield$request3 = _context3.sent;
13464
- success = _yield$request3.success;
13465
- data = _yield$request3.data;
13466
- if (success) {
13467
- trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
14243
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14244
+ var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
13468
14245
  return (item.srcTid || '').split(',').includes(orderNo);
13469
- }).map(function (item) {
13470
- if (Array.isArray(item.goodDetails)) {
13471
- item.goodDetails = item.goodDetails.filter(function (good) {
13472
- return good.srcTid === orderNo;
13473
- });
13474
- }
13475
- return item;
13476
14246
  });
13477
- _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
13478
- orders: trades.map(function (item) {
13479
- return _objectSpread2(_objectSpread2({}, item), {}, {
13480
- billNo: item.tradeNo,
13481
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13482
- billTag: item.tagName
13483
- });
13484
- }),
13485
- showOrderInfo: trades.map(function (item) {
14247
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14248
+ orders: trades,
14249
+ showOrderInfo: trades.map(function (_ref4) {
14250
+ var billNo = _ref4.billNo,
14251
+ billType = _ref4.billType,
14252
+ billTag = _ref4.billTag;
13486
14253
  return {
13487
- billNo: item.tradeNo,
13488
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
13489
- billTag: item.tagName
14254
+ billNo: billNo,
14255
+ billType: billType,
14256
+ billTag: billTag
13490
14257
  };
13491
14258
  })
13492
14259
  }));
13493
- }
14260
+ });
13494
14261
  onceRef.current = false;
13495
- case 7:
14262
+ case 2:
13496
14263
  case "end":
13497
14264
  return _context3.stop();
13498
14265
  }
@@ -13502,6 +14269,31 @@ var index$1 = (function (props) {
13502
14269
  return _ref3.apply(this, arguments);
13503
14270
  };
13504
14271
  }();
14272
+ var getBsE3OrderList = /*#__PURE__*/function () {
14273
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderNo) {
14274
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
14275
+ while (1) switch (_context4.prev = _context4.next) {
14276
+ case 0:
14277
+ bsE3Utils.getBsE3OrderListSingleton(orderNo).then(function (data) {
14278
+ var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
14279
+ return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
14280
+ });
14281
+ _onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14282
+ orders: trades,
14283
+ showOrderInfo: trades
14284
+ }));
14285
+ });
14286
+ onceRef.current = false;
14287
+ case 2:
14288
+ case "end":
14289
+ return _context4.stop();
14290
+ }
14291
+ }, _callee4);
14292
+ }));
14293
+ return function getBsE3OrderList(_x4) {
14294
+ return _ref5.apply(this, arguments);
14295
+ };
14296
+ }();
13505
14297
  var rowSelection = {
13506
14298
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
13507
14299
  fixed: true,
@@ -13522,7 +14314,7 @@ var index$1 = (function (props) {
13522
14314
  dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
13523
14315
  columns: columns,
13524
14316
  rowSelection: rowSelection,
13525
- rowKey: 'billNo',
14317
+ rowKey: rowKeyMap[type] || 'billNo',
13526
14318
  size: "small",
13527
14319
  pagination: false,
13528
14320
  scroll: {
@@ -13561,8 +14353,11 @@ var componentMap$1 = {
13561
14353
  type: 'wdt',
13562
14354
  key: 'wdtGoods',
13563
14355
  name: '旺店通',
14356
+ orderNo: 'srcTid',
14357
+ goodDetailOrderNo: 'srcTid',
13564
14358
  eventNameMap: {
13565
14359
  type: 'wdtType',
14360
+ updateGoodsHandle: updateWdtGoodsHandle,
13566
14361
  selectListReturn: 'wdtSelectListReturn',
13567
14362
  selectList: 'wdtSelectList',
13568
14363
  reissueSelectList: 'wdtReissueSelectList',
@@ -13577,6 +14372,30 @@ var componentMap$1 = {
13577
14372
  returnDeleteGood: 'wdtReturnDeleteGood',
13578
14373
  exchangeDeleteGood: 'wdtExchangeDeleteGood'
13579
14374
  }
14375
+ },
14376
+ 'BS_E3_GOODS': {
14377
+ type: 'e3',
14378
+ key: 'bsE3Goods',
14379
+ name: '百胜E3',
14380
+ orderNo: 'dealCode',
14381
+ goodDetailOrderNo: 'originalDealCode',
14382
+ eventNameMap: {
14383
+ type: 'bsE3Type',
14384
+ updateGoodsHandle: updateBsE3GoodsHandle,
14385
+ selectListReturn: 'bsE3SelectListReturn',
14386
+ selectList: 'bsE3SelectList',
14387
+ reissueSelectList: 'bsE3ReissueSelectList',
14388
+ reissueSelectListReturn: 'bsE3ReissueSelectListReturn',
14389
+ reissueDeleteGood: 'bsE3ReissueDeleteGood',
14390
+ changeShopCode: 'bsE3ChangeShopCode',
14391
+ reissueType: 'bsE3ReissueType',
14392
+ returnType: 'bsE3ReturnType',
14393
+ returnSelectListReturn: 'bsE3ReturnSelectListReturn',
14394
+ returnSelectList: 'bsE3ReturnSelectList',
14395
+ deleteGood: 'bsE3DeleteGood',
14396
+ returnDeleteGood: 'bsE3ReturnDeleteGood',
14397
+ exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
14398
+ }
13580
14399
  }
13581
14400
  };
13582
14401
  var CommonGoods = function CommonGoods(props) {
@@ -13585,6 +14404,13 @@ var CommonGoods = function CommonGoods(props) {
13585
14404
  disabled = props.disabled,
13586
14405
  onChange = props.onChange,
13587
14406
  compType = props.type;
14407
+ console.log('value?.orders', value === null || value === void 0 ? void 0 : value.orders);
14408
+ // 合并单订单会包含","
14409
+ var showModeBtn = !['BS_E3_GOODS'].includes(compType) && ((value === null || value === void 0 ? void 0 : value.orders) || []).some(function (order) {
14410
+ var _order$componentMap$c;
14411
+ return order === null || order === void 0 ? void 0 : (_order$componentMap$c = order[componentMap$1[compType].orderNo]) === null || _order$componentMap$c === void 0 ? void 0 : _order$componentMap$c.includes(',');
14412
+ });
14413
+ var getOrderFlag = useRef(false);
13588
14414
  var _useState = useState(false),
13589
14415
  _useState2 = _slicedToArray(_useState, 2),
13590
14416
  tableSelect = _useState2[0],
@@ -13592,8 +14418,36 @@ var CommonGoods = function CommonGoods(props) {
13592
14418
  var withInfo = useRef(null);
13593
14419
  var valueRef = useRef(null);
13594
14420
  useEffect(function () {
14421
+ var _value$orders;
13595
14422
  valueRef.current = value;
14423
+ 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
+ getOrderFlag.current = true;
14425
+ getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
14426
+ }
13596
14427
  }, [value]);
14428
+ var getWdtOrderList = /*#__PURE__*/function () {
14429
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
14430
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
14431
+ while (1) switch (_context.prev = _context.next) {
14432
+ case 0:
14433
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14434
+ var orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (trade) {
14435
+ return (value.selectIds || []).includes(trade.tradeNo);
14436
+ });
14437
+ onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14438
+ orders: orders
14439
+ }));
14440
+ });
14441
+ case 1:
14442
+ case "end":
14443
+ return _context.stop();
14444
+ }
14445
+ }, _callee);
14446
+ }));
14447
+ return function getWdtOrderList(_x) {
14448
+ return _ref.apply(this, arguments);
14449
+ };
14450
+ }();
13597
14451
  useEffect(function () {
13598
14452
  pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
13599
14453
  if (disabled) return;
@@ -13651,7 +14505,7 @@ var CommonGoods = function CommonGoods(props) {
13651
14505
  });
13652
14506
  pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
13653
14507
  // console.log(data);
13654
- onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
14508
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
13655
14509
  shopCode: data.shopCode
13656
14510
  }));
13657
14511
  });
@@ -13691,6 +14545,24 @@ var CommonGoods = function CommonGoods(props) {
13691
14545
  var changeHandle = function changeHandle(list) {
13692
14546
  onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
13693
14547
  };
14548
+ var handleModeChange = function handleModeChange(isStrict) {
14549
+ // isStrict 是否只展示当前平台订单商品
14550
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({
14551
+ isStrict: isStrict
14552
+ }, componentMap$1[compType].key, getGoodDetails({
14553
+ mode: isStrict
14554
+ }))));
14555
+ };
14556
+ var getGoodDetails = function getGoodDetails(_ref2) {
14557
+ var mode = _ref2.mode;
14558
+ var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
14559
+ var goodDetails = updateHandle(value.orders || []);
14560
+ var orderNo = value.orderNo;
14561
+ return mode ? goodDetails.filter(function (goodItem) {
14562
+ var _componentMap$compTyp;
14563
+ return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp = componentMap$1[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.goodDetailOrderNo]) === orderNo;
14564
+ }) : goodDetails;
14565
+ };
13694
14566
  return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
13695
14567
  key: componentMap$1[compType].key
13696
14568
  }, props), {}, {
@@ -13707,7 +14579,10 @@ var CommonGoods = function CommonGoods(props) {
13707
14579
  },
13708
14580
  onChange: function onChange(val) {
13709
14581
  return changeHandle(val);
13710
- }
14582
+ },
14583
+ onModeChange: handleModeChange,
14584
+ showModeBtn: showModeBtn,
14585
+ isStrict: value === null || value === void 0 ? void 0 : value.isStrict
13711
14586
  }));
13712
14587
  };
13713
14588
 
@@ -13974,8 +14849,8 @@ var typeMap$1 = {
13974
14849
  key: 'wdtReissueGoods',
13975
14850
  name: '旺店通',
13976
14851
  typeName: 'wdtReissueType',
13977
- wdtSystemOrder: 'wdtSystemOrder',
13978
- wdtSystemOrderNo: 'wdtSystemOrderNo',
14852
+ systemOrder: 'wdtSystemOrder',
14853
+ systemOrderNo: 'wdtSystemOrderNo',
13979
14854
  reissueSelectList: 'wdtReissueSelectList',
13980
14855
  reissueSelectListReturn: 'wdtReissueSelectListReturn',
13981
14856
  reissueDeleteGood: 'wdtReissueDeleteGood',
@@ -13988,7 +14863,7 @@ var typeMap$1 = {
13988
14863
  }
13989
14864
  };
13990
14865
  var wdtReissue = function wdtReissue(props) {
13991
- var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type10, _typeMap$type26, _typeMap$type27, _value$typeMap$type$w2, _typeMap$type28, _typeMap$type29, _typeMap$type30;
14866
+ var _value$wdtSystemOrder, _typeMap$type7, _typeMap$type25, _typeMap$type26, _value$typeMap$type$s5, _typeMap$type27, _typeMap$type28, _typeMap$type29;
13992
14867
  var value = props.value,
13993
14868
  onChange = props.onChange,
13994
14869
  _props$reasonList = props.reasonList,
@@ -13996,177 +14871,148 @@ var wdtReissue = function wdtReissue(props) {
13996
14871
  disabled = props.disabled,
13997
14872
  type = props.type,
13998
14873
  other = _objectWithoutProperties(props, _excluded$g);
13999
- var valueRef = useRef({});
14000
- useEffect(function () {
14001
- var _typeMap$type, _typeMap$type4;
14002
- valueRef.current = value;
14003
- pubsub.subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
14004
- if (disabled) return;
14005
- if (value) {
14006
- var _typeMap$type2, _typeMap$type3;
14007
- var newValue = _objectSpread2({}, value);
14008
- newValue["".concat((_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.key)].filter(function (item) {
14009
- return item.sku !== data;
14010
- });
14011
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14012
- }
14013
- });
14014
- pubsub.subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
14015
- onChange(_objectSpread2(_objectSpread2({}, value), {}, {
14016
- shopCode: data.shopCode
14017
- }));
14018
- });
14019
- }, [value, disabled]);
14874
+ var showModeBtn = ((value === null || value === void 0 ? void 0 : (_value$wdtSystemOrder = value.wdtSystemOrder) === null || _value$wdtSystemOrder === void 0 ? void 0 : _value$wdtSystemOrder.orders) || []).some(function (order) {
14875
+ var _order$srcTid;
14876
+ return order === null || order === void 0 ? void 0 : (_order$srcTid = order.srcTid) === null || _order$srcTid === void 0 ? void 0 : _order$srcTid.includes(',');
14877
+ });
14878
+ var getOrderFlag = useRef(false);
14879
+ var _useState = useState(false),
14880
+ _useState2 = _slicedToArray(_useState, 2),
14881
+ isStrict = _useState2[0],
14882
+ setIsStrict = _useState2[1];
14020
14883
  useEffect(function () {
14021
- var _value$orders, _value$showOrderInfo;
14022
- if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
14023
- if (type === 'WDT_SYSTEM_ORDER') {
14024
- getWdtOrderList(value.orderNo);
14025
- }
14884
+ var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
14885
+ 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
+ var _value$typeMap$type$s4, _typeMap$type3;
14887
+ 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);
14026
14889
  }
14027
14890
  return;
14028
14891
  }, [value]);
14029
14892
  useEffect(function () {
14030
- var _typeMap$type5;
14031
- var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.wdtSystemOrderNo];
14032
- if (wdtSystemOrderNo) {
14033
- var _value$typeMap$type$t, _typeMap$type6;
14034
- if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
14035
- getGoodItems(wdtSystemOrderNo);
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
+ }))));
14036
14902
  }
14037
14903
  }
14038
14904
  return;
14039
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
14040
- useEffect(function () {
14041
- var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
14042
- var typeName = value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0];
14043
- var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.wdtSystemOrderNo];
14044
- if (['1'].includes(typeName)) {
14045
- wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
14046
- } else if (['2'].includes(typeName)) {
14047
- var newValue = _objectSpread2({}, value);
14048
- // newValue[`${typeMap?.[type]?.key}`] = [];
14049
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14050
- }
14051
- return;
14052
- }, [value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]]);
14053
- var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
14054
- var _value$typeMap$type$w, _typeMap$type11, _ref;
14055
- var orders = value === null || value === void 0 ? void 0 : (_value$typeMap$type$w = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.wdtSystemOrder]) === null || _value$typeMap$type$w === void 0 ? void 0 : _value$typeMap$type$w.orders;
14056
- var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
14057
- return orderItem.billNo === wdtSystemOrderNo;
14058
- });
14059
- if (order) {
14060
- var _typeMap$type12, _order$goodDetails;
14061
- var newValue = _objectSpread2({}, value);
14062
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
14063
- var _typeMap$type13, _typeMap$type14;
14064
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.formatDefaultField.money)] = 0;
14065
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.share)] = 0;
14066
- item.canUpdateNumber = true;
14067
- return item;
14068
- });
14069
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14070
- }
14071
- };
14905
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.systemOrderNo]]);
14072
14906
  var getWdtOrderList = /*#__PURE__*/function () {
14073
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
14074
- var _yield$request, success, data, _typeMap$type15, _typeMap$type16, orders, showOrderInfo;
14907
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
14075
14908
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14076
14909
  while (1) switch (_context.prev = _context.next) {
14077
14910
  case 0:
14078
- _context.next = 2;
14079
- return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
14080
- method: 'post',
14081
- data: {
14082
- billNo: orderNo
14083
- }
14084
- });
14085
- case 2:
14086
- _yield$request = _context.sent;
14087
- success = _yield$request.success;
14088
- data = _yield$request.data;
14089
- if (success) {
14090
- orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
14091
- return _objectSpread2(_objectSpread2({}, item), {}, {
14092
- billNo: item.tradeNo,
14093
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
14094
- billTag: item.tagName
14095
- });
14096
- });
14097
- showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
14911
+ wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
14912
+ var _typeMap$type8, _typeMap$type9;
14913
+ var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
14914
+ var showOrderInfo = orders.map(function (_ref2) {
14915
+ var billNo = _ref2.billNo,
14916
+ billType = _ref2.billType,
14917
+ billTag = _ref2.billTag;
14098
14918
  return {
14099
- billNo: item.tradeNo,
14100
- billType: WDT_ORDER_TYPE_MAP[item.tradeType],
14101
- billTag: item.tagName
14919
+ billNo: billNo,
14920
+ billType: billType,
14921
+ billTag: billTag
14102
14922
  };
14103
14923
  });
14104
- onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.wdtSystemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.wdtSystemOrder]), {}, {
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]), {}, {
14105
14925
  showOrderInfo: showOrderInfo,
14106
14926
  orders: orders
14107
14927
  }))));
14108
- }
14109
- case 6:
14928
+ });
14929
+ case 1:
14110
14930
  case "end":
14111
14931
  return _context.stop();
14112
14932
  }
14113
14933
  }, _callee);
14114
14934
  }));
14115
14935
  return function getWdtOrderList(_x) {
14116
- return _ref2.apply(this, arguments);
14936
+ return _ref.apply(this, arguments);
14117
14937
  };
14118
14938
  }();
14119
14939
  var changeTypeHandle = function changeTypeHandle(val) {
14120
- var _typeMap$type17, _typeMap$type18;
14940
+ var _value$typeMap$type$t2, _typeMap$type10, _typeMap$type11;
14941
+ 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;
14943
+ // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
14121
14944
  var newValue = _objectSpread2({}, value);
14122
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.typeName)] = val;
14123
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.key)] = [];
14945
+ newValue[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName] = val;
14946
+ 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({
14949
+ mode: isStrict
14950
+ });
14951
+ } else if (typeName === '2') {
14952
+ var _typeMap$type13;
14953
+ // 切换到非原单,清空列表
14954
+ newValue[(_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key] = [];
14955
+ }
14124
14956
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14125
- valueRef.current = newValue;
14126
- // if (['2'].includes(val[0])) {
14127
- // onChange?.(newValue);
14128
- // valueRef.current = newValue;
14129
- // }
14130
- // pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
14131
- // val: val[0],
14132
- // goodValue: newValue,
14133
- // });
14134
14957
  };
14135
-
14958
+ 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';
14961
+ setIsStrict(mode);
14962
+ 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({
14964
+ mode: mode
14965
+ }))));
14966
+ };
14967
+ 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];
14972
+ var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
14973
+ return order.tradeNo === systemOrderNo;
14974
+ });
14975
+ var goodDetails = (order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.length) ? updateWdtGoodsHandle([order]) : [];
14976
+ var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
14977
+ return mode ? goodDetails.filter(function (goodItem) {
14978
+ return !orderNo || goodItem.srcTid === orderNo;
14979
+ }) : goodDetails;
14980
+ };
14136
14981
  var changeGoodHandle = function changeGoodHandle(val) {
14137
- var _typeMap$type19;
14982
+ var _typeMap$type18;
14138
14983
  var newValue = _objectSpread2({}, value);
14139
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = (val || []).map(function (item) {
14140
- var _typeMap$type20, _typeMap$type21;
14141
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.formatDefaultField.money)] = 0;
14142
- item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.formatDefaultField.share)] = 0;
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;
14143
14988
  return item;
14144
14989
  });
14145
14990
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14146
14991
  };
14147
14992
  var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
14148
- var _typeMap$type22, _value$typeMap$type$t4, _typeMap$type23;
14993
+ var _typeMap$type21, _value$typeMap$type$t4, _typeMap$type22;
14149
14994
  var newValue = _objectSpread2({}, value);
14150
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.wdtSystemOrderNo)] = val;
14151
- if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0])) {
14152
- var _typeMap$type24;
14153
- newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)] = [];
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)] = [];
14154
14999
  }
14155
15000
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
14156
15001
  };
14157
15002
  //显示选择商品按钮 原单换不显示选择商品
14158
15003
  var showChangeBtn = useMemo(function () {
14159
- var _typeMap$type25;
14160
- return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]);
14161
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo]]);
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]]);
14162
15007
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
14163
- gutter: 8
15008
+ gutter: 8,
15009
+ wrap: true
14164
15010
  }, /*#__PURE__*/React.createElement(Col, {
14165
15011
  className: "gutter-row",
14166
15012
  xs: {
14167
15013
  span: 11
14168
15014
  },
14169
- md: {
15015
+ sm: {
14170
15016
  span: 6
14171
15017
  }
14172
15018
  }, /*#__PURE__*/React.createElement(Select, {
@@ -14175,12 +15021,12 @@ var wdtReissue = function wdtReissue(props) {
14175
15021
  },
14176
15022
  disabled: disabled,
14177
15023
  allowClear: false,
14178
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.wdtSystemOrderNo)],
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)],
14179
15025
  onChange: function onChange(val) {
14180
15026
  return changeSystemOrderHandle(val);
14181
15027
  },
14182
15028
  placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
14183
- }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$w2 = value[(_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.wdtSystemOrder]) === null || _value$typeMap$type$w2 === void 0 ? void 0 : _value$typeMap$type$w2.showOrderInfo) || []).map(function (item) {
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) {
14184
15030
  return /*#__PURE__*/React.createElement(Select.Option, {
14185
15031
  key: item.billNo,
14186
15032
  value: item.billNo,
@@ -14191,7 +15037,7 @@ var wdtReissue = function wdtReissue(props) {
14191
15037
  xs: {
14192
15038
  span: 11
14193
15039
  },
14194
- md: {
15040
+ sm: {
14195
15041
  span: 6
14196
15042
  }
14197
15043
  }, /*#__PURE__*/React.createElement(Cascader, {
@@ -14201,7 +15047,7 @@ var wdtReissue = function wdtReissue(props) {
14201
15047
  disabled: disabled,
14202
15048
  allowClear: false,
14203
15049
  options: reasonList,
14204
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.typeName)],
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)],
14205
15051
  onChange: function onChange(val) {
14206
15052
  return changeTypeHandle(val);
14207
15053
  }
@@ -14213,10 +15059,13 @@ var wdtReissue = function wdtReissue(props) {
14213
15059
  canUpdateNumber: showChangeBtn,
14214
15060
  showChangeBtn: showChangeBtn,
14215
15061
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
14216
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type30 = typeMap$1[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.key)],
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)],
14217
15063
  onChange: function onChange(val) {
14218
15064
  return changeGoodHandle(val);
14219
- }
15065
+ },
15066
+ onModeChange: handleModeChange,
15067
+ showModeBtn: showModeBtn,
15068
+ isStrict: isStrict
14220
15069
  })));
14221
15070
  };
14222
15071
 
@@ -14226,7 +15075,7 @@ styleInject(css_248z$a);
14226
15075
  var TabPane$1 = Tabs.TabPane;
14227
15076
  var Option$2 = Select.Option;
14228
15077
  var Search$1 = Input.Search;
14229
- var GoodsModal$4 = function GoodsModal(props) {
15078
+ var GoodsModal$5 = function GoodsModal(props) {
14230
15079
  var onSubmit = props.onSubmit,
14231
15080
  _onCancel = props.onCancel,
14232
15081
  visible = props.visible,
@@ -14677,7 +15526,7 @@ var Goods$1 = function Goods(props, ref) {
14677
15526
  };
14678
15527
  return /*#__PURE__*/React.createElement("div", {
14679
15528
  className: "goodsBox"
14680
- }, /*#__PURE__*/React.createElement(GoodsModal$4, {
15529
+ }, /*#__PURE__*/React.createElement(GoodsModal$5, {
14681
15530
  visible: visible,
14682
15531
  onSubmit: onSubmit,
14683
15532
  type: type,