@kmkf-fe-packages/basic-components 2.0.0-rc.0 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1677 -364
- package/dist/index.js +1675 -361
- package/dist/src/bs/component/GoodItem/bsE3ReissueGoodsColumns.d.ts +29 -0
- package/dist/src/bs/component/GoodItem/index.d.ts +7 -0
- package/dist/src/bs/component/model/BsE3GoodList.d.ts +36 -0
- package/dist/src/bs/component/model/BsE3GoodsModal.d.ts +12 -0
- package/dist/src/e3/Reissue/index.d.ts +3 -0
- package/dist/src/e3/common/index.d.ts +3 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/wdt/common/index.d.ts +3 -0
- package/package.json +3 -3
- package/dist/src/basics/FormItem/index.d.ts +0 -3
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,
|
|
7
|
-
import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight } from 'lodash';
|
|
6
|
+
import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, BS_E3_ORDER_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
|
|
7
|
+
import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty } 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-
|
|
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","
|
|
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,
|
|
@@ -954,18 +953,10 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
|
|
|
954
953
|
_useState2 = _slicedToArray(_useState, 2),
|
|
955
954
|
uploading = _useState2[0],
|
|
956
955
|
setUploading = _useState2[1];
|
|
957
|
-
var _useState3 = useState(
|
|
956
|
+
var _useState3 = useState(true),
|
|
958
957
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
var _useState5 = useState(''),
|
|
962
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
963
|
-
currentPreviewImg = _useState6[0],
|
|
964
|
-
setCurrentPreviewImg = _useState6[1];
|
|
965
|
-
var _useState7 = useState(true),
|
|
966
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
967
|
-
pasteDefaultStates = _useState8[0],
|
|
968
|
-
setPasteDefaultStates = _useState8[1];
|
|
958
|
+
pasteDefaultStates = _useState4[0],
|
|
959
|
+
setPasteDefaultStates = _useState4[1];
|
|
969
960
|
useEffect(function () {
|
|
970
961
|
valueRef.current = value;
|
|
971
962
|
}, [value]);
|
|
@@ -1096,39 +1087,25 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
|
|
|
1096
1087
|
}));
|
|
1097
1088
|
};
|
|
1098
1089
|
};
|
|
1099
|
-
var handlePreview = function handlePreview(imgUrl) {
|
|
1100
|
-
return function () {
|
|
1101
|
-
setCurrentPreviewImg(imgUrl);
|
|
1102
|
-
setVisible(true);
|
|
1103
|
-
};
|
|
1104
|
-
};
|
|
1105
1090
|
var renderImages = function renderImages(images) {
|
|
1106
|
-
return images.map(function (image, index) {
|
|
1091
|
+
return /*#__PURE__*/React.createElement(Image.PreviewGroup, null, images.map(function (image, index) {
|
|
1107
1092
|
var finalImage = "".concat(/^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image, "?x-oss-process=image/resize,h_60,w_60");
|
|
1093
|
+
var showImage = /^pic\/[\s\S]*$/.test(image) ? "".concat(hostUrl, "/").concat(image) : image;
|
|
1108
1094
|
return /*#__PURE__*/React.createElement("div", {
|
|
1109
1095
|
className: styles$1.imageWrap,
|
|
1110
1096
|
key: index
|
|
1111
|
-
}, /*#__PURE__*/React.createElement(
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
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'
|
|
1097
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
1098
|
+
src: finalImage,
|
|
1099
|
+
preview: {
|
|
1100
|
+
src: showImage
|
|
1128
1101
|
},
|
|
1102
|
+
width: '100%',
|
|
1103
|
+
height: '80%'
|
|
1104
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
1105
|
+
className: styles$1.deleteIcon,
|
|
1129
1106
|
onClick: handleDelete(index)
|
|
1130
|
-
}))
|
|
1131
|
-
});
|
|
1107
|
+
}, "\u5220\u9664"));
|
|
1108
|
+
}));
|
|
1132
1109
|
};
|
|
1133
1110
|
useEffect(function () {
|
|
1134
1111
|
var _inputRef$current2;
|
|
@@ -1187,21 +1164,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref, ref) {
|
|
|
1187
1164
|
beforeUpload: beforeUpload
|
|
1188
1165
|
}, resetProps), value.length >= maxCount ? null : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
1189
1166
|
className: "addBtn"
|
|
1190
|
-
}, "+"), /*#__PURE__*/React.createElement("div", null, uploadText)))
|
|
1191
|
-
width: 0,
|
|
1192
|
-
style: {
|
|
1193
|
-
display: visible ? '' : 'none'
|
|
1194
|
-
},
|
|
1195
|
-
src: currentPreviewImg,
|
|
1196
|
-
preview: {
|
|
1197
|
-
visible: visible,
|
|
1198
|
-
src: "".concat(currentPreviewImg),
|
|
1199
|
-
onVisibleChange: function onVisibleChange(value) {
|
|
1200
|
-
setCurrentPreviewImg('');
|
|
1201
|
-
setVisible(value);
|
|
1202
|
-
}
|
|
1203
|
-
}
|
|
1204
|
-
})));
|
|
1167
|
+
}, "+"), /*#__PURE__*/React.createElement("div", null, uploadText)))));
|
|
1205
1168
|
};
|
|
1206
1169
|
var index = /*#__PURE__*/forwardRef(ApaasUploadAsync);
|
|
1207
1170
|
|
|
@@ -10984,7 +10947,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
10984
10947
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10985
10948
|
changeIndex = _useState2[0],
|
|
10986
10949
|
setChangeIndex = _useState2[1]; //选中的包裹
|
|
10987
|
-
var
|
|
10950
|
+
var sendOptions = SendDataCenter.getInstance(platformType).getSendData();
|
|
10988
10951
|
useEffect(function () {
|
|
10989
10952
|
//没有值塞个默认值
|
|
10990
10953
|
if (!(value === null || value === void 0 ? void 0 : value.length) && type !== 1) {
|
|
@@ -11015,7 +10978,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
11015
10978
|
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
11016
10979
|
changeOrderInfo[type] = val;
|
|
11017
10980
|
changeOrderInfo['sendId'] = option.value;
|
|
11018
|
-
if (platformType === 'wdt' && type === 'sendName') {
|
|
10981
|
+
if ((platformType === 'wdt' || platformType === 'bsE3') && type === 'sendName') {
|
|
11019
10982
|
changeOrderInfo['sendSnapshotName'] = option.label;
|
|
11020
10983
|
}
|
|
11021
10984
|
var newList = _toConsumableArray(value);
|
|
@@ -11098,7 +11061,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
11098
11061
|
return changeInputHandle(e.target.value, 'sendId');
|
|
11099
11062
|
},
|
|
11100
11063
|
value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
|
|
11101
|
-
}), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React.createElement(Select, {
|
|
11064
|
+
}), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' || platformType === 'bsE3' ? /*#__PURE__*/React.createElement(Select, {
|
|
11102
11065
|
style: {
|
|
11103
11066
|
minWidth: '100px',
|
|
11104
11067
|
maxWidth: '180px'
|
|
@@ -11106,7 +11069,7 @@ var jstGoods = function jstGoods(props) {
|
|
|
11106
11069
|
disabled: disabled,
|
|
11107
11070
|
placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
|
|
11108
11071
|
showSearch: true,
|
|
11109
|
-
options:
|
|
11072
|
+
options: sendOptions,
|
|
11110
11073
|
filterOption: filterOption,
|
|
11111
11074
|
value: ((_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName) || null,
|
|
11112
11075
|
onChange: function onChange(value, option) {
|
|
@@ -11685,9 +11648,11 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
11685
11648
|
var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
|
|
11686
11649
|
|
|
11687
11650
|
var getTableData = function getTableData(_ref, formData) {
|
|
11651
|
+
var _formData$brandIds;
|
|
11688
11652
|
var current = _ref.current,
|
|
11689
11653
|
pageSize = _ref.pageSize;
|
|
11690
11654
|
var data = {
|
|
11655
|
+
brandIds: ((_formData$brandIds = formData.brandIds) === null || _formData$brandIds === void 0 ? void 0 : _formData$brandIds.length) ? formData.brandIds : null,
|
|
11691
11656
|
skuCode: formData.skuCode || null,
|
|
11692
11657
|
skuName: formData.skuName || null,
|
|
11693
11658
|
goodName: formData.goodName || null,
|
|
@@ -11772,6 +11737,11 @@ var columns$1 = [{
|
|
|
11772
11737
|
title: '商品ID',
|
|
11773
11738
|
width: 200,
|
|
11774
11739
|
ellipsis: true
|
|
11740
|
+
}, {
|
|
11741
|
+
dataIndex: 'brandName',
|
|
11742
|
+
title: '品牌名称',
|
|
11743
|
+
width: 200,
|
|
11744
|
+
ellipsis: true
|
|
11775
11745
|
}, {
|
|
11776
11746
|
dataIndex: 'marketPrice',
|
|
11777
11747
|
title: '市场价',
|
|
@@ -11803,6 +11773,10 @@ var GoodList = function GoodList(props, ref) {
|
|
|
11803
11773
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
11804
11774
|
selectIds = _useState4[0],
|
|
11805
11775
|
setSelectIds = _useState4[1];
|
|
11776
|
+
var _useState5 = useState([]),
|
|
11777
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
11778
|
+
brandList = _useState6[0],
|
|
11779
|
+
setBrandList = _useState6[1];
|
|
11806
11780
|
useImperativeHandle(ref, function () {
|
|
11807
11781
|
return {
|
|
11808
11782
|
getSelectGoodList: function getSelectGoodList() {
|
|
@@ -11822,6 +11796,38 @@ var GoodList = function GoodList(props, ref) {
|
|
|
11822
11796
|
params = _useAntdTable.params;
|
|
11823
11797
|
var submit = search.submit,
|
|
11824
11798
|
reset = search.reset;
|
|
11799
|
+
var setGoodBrandList = function setGoodBrandList() {
|
|
11800
|
+
var list = [];
|
|
11801
|
+
var pageNo = 0;
|
|
11802
|
+
var pageSize = 100;
|
|
11803
|
+
var getMore = function getMore() {
|
|
11804
|
+
extendRequest('/qy/gdfw/wdt/erp/goodBrand/list', {
|
|
11805
|
+
method: 'post',
|
|
11806
|
+
data: {
|
|
11807
|
+
pageSize: pageSize,
|
|
11808
|
+
pageNo: pageNo
|
|
11809
|
+
}
|
|
11810
|
+
}).then(function (res) {
|
|
11811
|
+
var _res$data2;
|
|
11812
|
+
if (res.success && (res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.detailList)) {
|
|
11813
|
+
var _res$data3, _res$data4;
|
|
11814
|
+
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) || []));
|
|
11815
|
+
if ((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.detailList.length) === pageSize) {
|
|
11816
|
+
pageNo += 1;
|
|
11817
|
+
getMore();
|
|
11818
|
+
} else {
|
|
11819
|
+
setBrandList(list);
|
|
11820
|
+
}
|
|
11821
|
+
} else {
|
|
11822
|
+
reject(res);
|
|
11823
|
+
}
|
|
11824
|
+
}).catch(console.error);
|
|
11825
|
+
};
|
|
11826
|
+
getMore();
|
|
11827
|
+
};
|
|
11828
|
+
React.useEffect(function () {
|
|
11829
|
+
setGoodBrandList();
|
|
11830
|
+
}, []);
|
|
11825
11831
|
var advanceSearchForm = /*#__PURE__*/React.createElement(Form, {
|
|
11826
11832
|
layout: "inline",
|
|
11827
11833
|
form: form
|
|
@@ -11869,6 +11875,32 @@ var GoodList = function GoodList(props, ref) {
|
|
|
11869
11875
|
style: {
|
|
11870
11876
|
width: 150
|
|
11871
11877
|
}
|
|
11878
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
11879
|
+
name: "brandIds",
|
|
11880
|
+
style: {
|
|
11881
|
+
marginBottom: '12px'
|
|
11882
|
+
}
|
|
11883
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
11884
|
+
mode: "multiple",
|
|
11885
|
+
showSearch: true,
|
|
11886
|
+
allowClear: true,
|
|
11887
|
+
filterOption: function filterOption(input, option) {
|
|
11888
|
+
return option.label.includes(input);
|
|
11889
|
+
},
|
|
11890
|
+
style: {
|
|
11891
|
+
width: 150
|
|
11892
|
+
},
|
|
11893
|
+
placeholder: "\u54C1\u724C",
|
|
11894
|
+
options: brandList.filter(function (item) {
|
|
11895
|
+
return !item.isDisabled;
|
|
11896
|
+
}).map(function (_ref2) {
|
|
11897
|
+
var value = _ref2.brandId,
|
|
11898
|
+
label = _ref2.brandName;
|
|
11899
|
+
return {
|
|
11900
|
+
value: value,
|
|
11901
|
+
label: label
|
|
11902
|
+
};
|
|
11903
|
+
})
|
|
11872
11904
|
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
11873
11905
|
style: {
|
|
11874
11906
|
marginBottom: '12px'
|
|
@@ -12025,107 +12057,664 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
12025
12057
|
};
|
|
12026
12058
|
var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
|
|
12027
12059
|
|
|
12028
|
-
|
|
12029
|
-
|
|
12030
|
-
|
|
12031
|
-
|
|
12032
|
-
|
|
12033
|
-
|
|
12034
|
-
|
|
12035
|
-
|
|
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));
|
|
12060
|
+
var getTableData$1 = function getTableData(_ref, formData) {
|
|
12061
|
+
var current = _ref.current,
|
|
12062
|
+
pageSize = _ref.pageSize;
|
|
12063
|
+
var data = {
|
|
12064
|
+
goodNo: formData.goodNo || null,
|
|
12065
|
+
goodName: formData.goodName || null,
|
|
12066
|
+
skuCode: formData.skuCode || null,
|
|
12067
|
+
skuId: formData.skuId || null
|
|
12072
12068
|
};
|
|
12069
|
+
return extendRequest('/qy/gdfw/product/product/page', {
|
|
12070
|
+
method: 'post',
|
|
12071
|
+
data: _objectSpread2({
|
|
12072
|
+
pageSize: pageSize,
|
|
12073
|
+
pageNo: current,
|
|
12074
|
+
platform: 'BS_E3_ERP'
|
|
12075
|
+
}, data)
|
|
12076
|
+
}).then(function (res) {
|
|
12077
|
+
var _res$data = res.data,
|
|
12078
|
+
_res$data$productSkuL = _res$data.productSkuList,
|
|
12079
|
+
productSkuList = _res$data$productSkuL === void 0 ? [] : _res$data$productSkuL,
|
|
12080
|
+
_res$data$total = _res$data.total,
|
|
12081
|
+
total = _res$data$total === void 0 ? 0 : _res$data$total;
|
|
12082
|
+
var newProducts = productSkuList.map(function (item, index) {
|
|
12083
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
12084
|
+
index: index + 1
|
|
12085
|
+
});
|
|
12086
|
+
});
|
|
12087
|
+
return {
|
|
12088
|
+
total: total,
|
|
12089
|
+
list: newProducts
|
|
12090
|
+
};
|
|
12091
|
+
});
|
|
12092
|
+
};
|
|
12093
|
+
var columns$2 = [{
|
|
12094
|
+
dataIndex: 'index',
|
|
12095
|
+
title: 'NO',
|
|
12096
|
+
render: function render(val, record, index) {
|
|
12097
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
12098
|
+
style: {
|
|
12099
|
+
width: 25
|
|
12100
|
+
}
|
|
12101
|
+
}, index + 1);
|
|
12102
|
+
},
|
|
12103
|
+
width: 80
|
|
12104
|
+
}, {
|
|
12105
|
+
dataIndex: 'specNo',
|
|
12106
|
+
title: "SKU",
|
|
12107
|
+
ellipsis: true,
|
|
12108
|
+
width: 200
|
|
12109
|
+
}, {
|
|
12110
|
+
dataIndex: 'specId',
|
|
12111
|
+
title: "SKU ID",
|
|
12112
|
+
ellipsis: true,
|
|
12113
|
+
width: 80
|
|
12114
|
+
}, {
|
|
12115
|
+
dataIndex: 'goodName',
|
|
12116
|
+
title: "\u5546\u54C1\u540D\u79F0",
|
|
12117
|
+
ellipsis: true,
|
|
12118
|
+
width: 250
|
|
12119
|
+
}, {
|
|
12120
|
+
dataIndex: 'goodShortName',
|
|
12121
|
+
title: "\u5546\u54C1\u7B80\u79F0",
|
|
12122
|
+
ellipsis: true,
|
|
12123
|
+
width: 250
|
|
12124
|
+
},
|
|
12125
|
+
// {
|
|
12126
|
+
// dataIndex: 'goodPicUrl',
|
|
12127
|
+
// title: `商品图片`,
|
|
12128
|
+
// ellipsis: true,
|
|
12129
|
+
// width: 100,
|
|
12130
|
+
// render: (picUrl: string) => {
|
|
12131
|
+
// return (
|
|
12132
|
+
// <img
|
|
12133
|
+
// style={{
|
|
12134
|
+
// width: '40px',
|
|
12135
|
+
// height: '40px',
|
|
12136
|
+
// objectFit: 'contain',
|
|
12137
|
+
// }}
|
|
12138
|
+
// src={picUrl}
|
|
12139
|
+
// ></img>
|
|
12140
|
+
// );
|
|
12141
|
+
// },
|
|
12142
|
+
// },
|
|
12143
|
+
{
|
|
12144
|
+
dataIndex: 'goodNo',
|
|
12145
|
+
title: "\u8D27\u53F7",
|
|
12146
|
+
ellipsis: true,
|
|
12147
|
+
width: 150
|
|
12148
|
+
}, {
|
|
12149
|
+
dataIndex: 'goodId',
|
|
12150
|
+
title: "\u8D27\u53F7ID",
|
|
12151
|
+
ellipsis: true,
|
|
12152
|
+
width: 100
|
|
12153
|
+
}, {
|
|
12154
|
+
dataIndex: 'colorName',
|
|
12155
|
+
title: "\u989C\u8272\u540D\u79F0",
|
|
12156
|
+
ellipsis: true,
|
|
12157
|
+
width: 100
|
|
12158
|
+
}, {
|
|
12159
|
+
dataIndex: 'colorCode',
|
|
12160
|
+
title: "\u989C\u8272\u4EE3\u7801",
|
|
12161
|
+
ellipsis: true,
|
|
12162
|
+
width: 100
|
|
12163
|
+
}, {
|
|
12164
|
+
dataIndex: 'sizeName',
|
|
12165
|
+
title: "\u5C3A\u7801\u540D\u79F0",
|
|
12166
|
+
ellipsis: true,
|
|
12167
|
+
width: 100
|
|
12168
|
+
}, {
|
|
12169
|
+
dataIndex: 'sizeCode',
|
|
12170
|
+
title: "\u5C3A\u7801\u4EE3\u7801",
|
|
12171
|
+
ellipsis: true,
|
|
12172
|
+
width: 100
|
|
12173
|
+
}, {
|
|
12174
|
+
dataIndex: 'brandName',
|
|
12175
|
+
title: "\u54C1\u724C\u540D\u79F0",
|
|
12176
|
+
ellipsis: true,
|
|
12177
|
+
width: 100
|
|
12178
|
+
}, {
|
|
12179
|
+
dataIndex: 'marketPrice',
|
|
12180
|
+
title: "\u5E02\u573A\u4EF7",
|
|
12181
|
+
ellipsis: true,
|
|
12182
|
+
width: 100
|
|
12183
|
+
}, {
|
|
12184
|
+
dataIndex: 'retailPrice',
|
|
12185
|
+
title: "\u552E\u4EF7",
|
|
12186
|
+
ellipsis: true,
|
|
12187
|
+
width: 100
|
|
12188
|
+
}];
|
|
12189
|
+
var GoodList$1 = function GoodList(props, ref) {
|
|
12073
12190
|
var _useState = useState([]),
|
|
12074
12191
|
_useState2 = _slicedToArray(_useState, 2),
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
|
|
12083
|
-
|
|
12084
|
-
|
|
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
|
-
}
|
|
12192
|
+
selectList = _useState2[0],
|
|
12193
|
+
setSelect = _useState2[1];
|
|
12194
|
+
var _useState3 = useState([]),
|
|
12195
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
12196
|
+
selectIds = _useState4[0],
|
|
12197
|
+
setSelectIds = _useState4[1];
|
|
12198
|
+
useImperativeHandle(ref, function () {
|
|
12199
|
+
return {
|
|
12200
|
+
getSelectGoodList: function getSelectGoodList() {
|
|
12201
|
+
return selectList;
|
|
12107
12202
|
}
|
|
12108
|
-
|
|
12203
|
+
};
|
|
12204
|
+
});
|
|
12205
|
+
var _Form$useForm = Form.useForm(),
|
|
12206
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
12207
|
+
form = _Form$useForm2[0];
|
|
12208
|
+
var _useAntdTable = useAntdTable(getTableData$1, {
|
|
12209
|
+
defaultPageSize: 10,
|
|
12210
|
+
form: form
|
|
12211
|
+
}),
|
|
12212
|
+
tableProps = _useAntdTable.tableProps,
|
|
12213
|
+
search = _useAntdTable.search,
|
|
12214
|
+
params = _useAntdTable.params;
|
|
12215
|
+
var submit = search.submit,
|
|
12216
|
+
reset = search.reset;
|
|
12217
|
+
var advanceSearchForm = /*#__PURE__*/React.createElement(Form, {
|
|
12218
|
+
layout: "inline",
|
|
12219
|
+
form: form
|
|
12220
|
+
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
12221
|
+
name: "goodNo",
|
|
12222
|
+
style: {
|
|
12223
|
+
marginBottom: '12px'
|
|
12109
12224
|
}
|
|
12110
|
-
}
|
|
12111
|
-
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
|
|
12115
|
-
|
|
12116
|
-
|
|
12117
|
-
|
|
12118
|
-
|
|
12119
|
-
|
|
12120
|
-
|
|
12121
|
-
|
|
12122
|
-
|
|
12123
|
-
|
|
12124
|
-
|
|
12125
|
-
|
|
12126
|
-
|
|
12127
|
-
|
|
12128
|
-
|
|
12225
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
12226
|
+
placeholder: "\u5546\u54C1\u8D27\u53F7",
|
|
12227
|
+
allowClear: true,
|
|
12228
|
+
style: {
|
|
12229
|
+
width: 150
|
|
12230
|
+
}
|
|
12231
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
12232
|
+
name: "goodName",
|
|
12233
|
+
style: {
|
|
12234
|
+
marginBottom: '12px'
|
|
12235
|
+
}
|
|
12236
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
12237
|
+
placeholder: "\u5546\u54C1\u540D\u79F0",
|
|
12238
|
+
allowClear: true,
|
|
12239
|
+
style: {
|
|
12240
|
+
width: 150
|
|
12241
|
+
}
|
|
12242
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
12243
|
+
name: "skuCode",
|
|
12244
|
+
style: {
|
|
12245
|
+
marginBottom: '12px'
|
|
12246
|
+
}
|
|
12247
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
12248
|
+
placeholder: "SKU",
|
|
12249
|
+
allowClear: true,
|
|
12250
|
+
style: {
|
|
12251
|
+
width: 150
|
|
12252
|
+
}
|
|
12253
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
12254
|
+
name: "skuId",
|
|
12255
|
+
style: {
|
|
12256
|
+
marginBottom: '12px'
|
|
12257
|
+
}
|
|
12258
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
12259
|
+
placeholder: "SKU ID",
|
|
12260
|
+
allowClear: true,
|
|
12261
|
+
style: {
|
|
12262
|
+
width: 150
|
|
12263
|
+
}
|
|
12264
|
+
})), /*#__PURE__*/React.createElement(Form.Item, {
|
|
12265
|
+
style: {
|
|
12266
|
+
marginBottom: '12px'
|
|
12267
|
+
}
|
|
12268
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
12269
|
+
type: "primary",
|
|
12270
|
+
style: {
|
|
12271
|
+
marginRight: '8px'
|
|
12272
|
+
},
|
|
12273
|
+
onClick: submit
|
|
12274
|
+
}, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
|
|
12275
|
+
onClick: reset
|
|
12276
|
+
}, "\u91CD\u7F6E")));
|
|
12277
|
+
var rowSelection = {
|
|
12278
|
+
selectedRowKeys: selectIds,
|
|
12279
|
+
fixed: true,
|
|
12280
|
+
onSelect: function onSelect(record, selected) {
|
|
12281
|
+
if (selected) {
|
|
12282
|
+
setSelectIds([].concat(_toConsumableArray(selectIds), [record.specNo]));
|
|
12283
|
+
setSelect([].concat(_toConsumableArray(selectList), [record]));
|
|
12284
|
+
} else {
|
|
12285
|
+
setSelectIds(selectIds.filter(function (t) {
|
|
12286
|
+
return t !== record.specNo;
|
|
12287
|
+
}));
|
|
12288
|
+
setSelect(selectList.filter(function (t) {
|
|
12289
|
+
return t.specNo !== record.specNo;
|
|
12290
|
+
}));
|
|
12291
|
+
}
|
|
12292
|
+
},
|
|
12293
|
+
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
|
|
12294
|
+
if (selected) {
|
|
12295
|
+
setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
|
|
12296
|
+
return t.specNo;
|
|
12297
|
+
}))));
|
|
12298
|
+
setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
|
|
12299
|
+
} else {
|
|
12300
|
+
setSelectIds(difference(selectIds, changeRows.map(function (t) {
|
|
12301
|
+
return t.specNo;
|
|
12302
|
+
})));
|
|
12303
|
+
var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
|
|
12304
|
+
return arrVal.specNo !== othVal.specNo;
|
|
12305
|
+
});
|
|
12306
|
+
setSelect(list);
|
|
12307
|
+
}
|
|
12308
|
+
}
|
|
12309
|
+
};
|
|
12310
|
+
var showTable = function showTable() {
|
|
12311
|
+
var handleDelete = function handleDelete(record) {
|
|
12312
|
+
setSelectIds(selectIds.filter(function (t) {
|
|
12313
|
+
return t !== record.specNo;
|
|
12314
|
+
}));
|
|
12315
|
+
setSelect(selectList.filter(function (t) {
|
|
12316
|
+
return t.specNo !== record.specNo;
|
|
12317
|
+
}));
|
|
12318
|
+
};
|
|
12319
|
+
var showColumns = [{
|
|
12320
|
+
dataIndex: '',
|
|
12321
|
+
title: "\u64CD\u4F5C",
|
|
12322
|
+
ellipsis: true,
|
|
12323
|
+
width: 100,
|
|
12324
|
+
render: function render(val, record) {
|
|
12325
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
12326
|
+
type: "link",
|
|
12327
|
+
onClick: function onClick() {
|
|
12328
|
+
return handleDelete(record);
|
|
12329
|
+
}
|
|
12330
|
+
}, "\u5220\u9664");
|
|
12331
|
+
}
|
|
12332
|
+
}].concat(takeRight(columns$2, columns$2.length - 1));
|
|
12333
|
+
return selectList.length ? /*#__PURE__*/React.createElement("div", {
|
|
12334
|
+
style: {
|
|
12335
|
+
width: '100%',
|
|
12336
|
+
maxWidth: '387px'
|
|
12337
|
+
}
|
|
12338
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
12339
|
+
columns: showColumns,
|
|
12340
|
+
rowKey: 'specNo',
|
|
12341
|
+
dataSource: selectList,
|
|
12342
|
+
scroll: {
|
|
12343
|
+
x: '100%',
|
|
12344
|
+
y: 250
|
|
12345
|
+
},
|
|
12346
|
+
pagination: {
|
|
12347
|
+
size: 'small',
|
|
12348
|
+
total: selectIds.length,
|
|
12349
|
+
pageSize: 10,
|
|
12350
|
+
showSizeChanger: false
|
|
12351
|
+
}
|
|
12352
|
+
})) : null;
|
|
12353
|
+
};
|
|
12354
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, advanceSearchForm, /*#__PURE__*/React.createElement("div", {
|
|
12355
|
+
style: {
|
|
12356
|
+
marginTop: '4px'
|
|
12357
|
+
}
|
|
12358
|
+
}, /*#__PURE__*/React.createElement(Table, _objectSpread2({
|
|
12359
|
+
rowSelection: rowSelection,
|
|
12360
|
+
rowKey: "specNo",
|
|
12361
|
+
columns: columns$2,
|
|
12362
|
+
scroll: {
|
|
12363
|
+
x: '100%',
|
|
12364
|
+
y: 250
|
|
12365
|
+
}
|
|
12366
|
+
}, tableProps))), /*#__PURE__*/React.createElement(Popover, {
|
|
12367
|
+
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
12368
|
+
return triggerNode.parentElement;
|
|
12369
|
+
},
|
|
12370
|
+
content: showTable(),
|
|
12371
|
+
title: "\u5DF2\u9009\u62E9".concat(selectList.length, "\u4E2A\u5546\u54C1")
|
|
12372
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
12373
|
+
danger: true,
|
|
12374
|
+
type: "text"
|
|
12375
|
+
}, "\u5DF2\u9009".concat(selectList.length > 99 ? '99+' : selectList.length, "\u4E2A\u5546\u54C1"), /*#__PURE__*/React.createElement(CaretUpOutlined, null))));
|
|
12376
|
+
};
|
|
12377
|
+
var BsE3GoodList = /*#__PURE__*/forwardRef(GoodList$1);
|
|
12378
|
+
|
|
12379
|
+
var GoodsModal$4 = function GoodsModal(props, ref) {
|
|
12380
|
+
useImperativeHandle(ref, function () {
|
|
12381
|
+
return {
|
|
12382
|
+
open: function open() {
|
|
12383
|
+
setVisible(true);
|
|
12384
|
+
}
|
|
12385
|
+
};
|
|
12386
|
+
});
|
|
12387
|
+
var onSubmit = props.onSubmit,
|
|
12388
|
+
width = props.width;
|
|
12389
|
+
var _useState = useState(false),
|
|
12390
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12391
|
+
visible = _useState2[0],
|
|
12392
|
+
setVisible = _useState2[1];
|
|
12393
|
+
var bsE3GoodListRef = useRef(null);
|
|
12394
|
+
var _onCancel = function onCancel() {
|
|
12395
|
+
setVisible(false);
|
|
12396
|
+
};
|
|
12397
|
+
var onOk = function onOk() {
|
|
12398
|
+
var _bsE3GoodListRef$curr;
|
|
12399
|
+
var selectedList = ((_bsE3GoodListRef$curr = bsE3GoodListRef.current) === null || _bsE3GoodListRef$curr === void 0 ? void 0 : _bsE3GoodListRef$curr.getSelectGoodList()) || [];
|
|
12400
|
+
onSubmit(selectedList);
|
|
12401
|
+
_onCancel();
|
|
12402
|
+
};
|
|
12403
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, visible && /*#__PURE__*/React.createElement(Modal, {
|
|
12404
|
+
title: '选择商品',
|
|
12405
|
+
okText: '确认',
|
|
12406
|
+
cancelText: '取消',
|
|
12407
|
+
visible: visible,
|
|
12408
|
+
width: width || 850,
|
|
12409
|
+
onCancel: function onCancel() {
|
|
12410
|
+
_onCancel();
|
|
12411
|
+
},
|
|
12412
|
+
onOk: onOk,
|
|
12413
|
+
wrapClassName: "goodModal"
|
|
12414
|
+
}, /*#__PURE__*/React.createElement(BsE3GoodList, {
|
|
12415
|
+
ref: bsE3GoodListRef
|
|
12416
|
+
})));
|
|
12417
|
+
};
|
|
12418
|
+
var BsE3GoodsModal = /*#__PURE__*/forwardRef(GoodsModal$4);
|
|
12419
|
+
|
|
12420
|
+
var columns$3 = [{
|
|
12421
|
+
dataIndex: 'sku',
|
|
12422
|
+
title: "SKU",
|
|
12423
|
+
width: 150
|
|
12424
|
+
}, {
|
|
12425
|
+
dataIndex: 'skuId',
|
|
12426
|
+
title: "SKU ID",
|
|
12427
|
+
width: 150
|
|
12428
|
+
}, {
|
|
12429
|
+
dataIndex: 'goodsName',
|
|
12430
|
+
title: "\u5546\u54C1\u540D\u79F0",
|
|
12431
|
+
width: 150
|
|
12432
|
+
}, {
|
|
12433
|
+
dataIndex: 'goodsShortName',
|
|
12434
|
+
title: "\u5546\u54C1\u7B80\u79F0",
|
|
12435
|
+
width: 150
|
|
12436
|
+
}, {
|
|
12437
|
+
dataIndex: 'picPath',
|
|
12438
|
+
title: "\u5546\u54C1\u56FE\u7247",
|
|
12439
|
+
width: 150
|
|
12440
|
+
}, {
|
|
12441
|
+
dataIndex: 'goodsSn',
|
|
12442
|
+
title: "\u8D27\u53F7",
|
|
12443
|
+
width: 150
|
|
12444
|
+
}, {
|
|
12445
|
+
dataIndex: 'goodsId',
|
|
12446
|
+
title: "\u8D27\u53F7ID",
|
|
12447
|
+
width: 150
|
|
12448
|
+
}, {
|
|
12449
|
+
dataIndex: 'colorName',
|
|
12450
|
+
title: "\u989C\u8272\u540D\u79F0",
|
|
12451
|
+
width: 150
|
|
12452
|
+
}, {
|
|
12453
|
+
dataIndex: 'colorCode',
|
|
12454
|
+
title: "\u989C\u8272\u4EE3\u7801",
|
|
12455
|
+
width: 150
|
|
12456
|
+
}, {
|
|
12457
|
+
dataIndex: 'sizeName',
|
|
12458
|
+
title: "\u5C3A\u7801\u540D\u79F0",
|
|
12459
|
+
width: 150
|
|
12460
|
+
}, {
|
|
12461
|
+
dataIndex: 'sizeCode',
|
|
12462
|
+
title: "\u5C3A\u7801\u4EE3\u7801",
|
|
12463
|
+
width: 150
|
|
12464
|
+
}, {
|
|
12465
|
+
dataIndex: 'brandName',
|
|
12466
|
+
title: "\u54C1\u724C\u540D\u79F0",
|
|
12467
|
+
width: 150
|
|
12468
|
+
}, {
|
|
12469
|
+
dataIndex: 'goodsNumber',
|
|
12470
|
+
title: "\u5546\u54C1\u6570\u91CF",
|
|
12471
|
+
width: 150
|
|
12472
|
+
}, {
|
|
12473
|
+
dataIndex: 'goodsPrice',
|
|
12474
|
+
title: "\u5546\u54C1\u5355\u4EF7",
|
|
12475
|
+
width: 150
|
|
12476
|
+
}, {
|
|
12477
|
+
dataIndex: 'shopPrice',
|
|
12478
|
+
title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
|
|
12479
|
+
width: 150
|
|
12480
|
+
}, {
|
|
12481
|
+
dataIndex: 'isGift',
|
|
12482
|
+
title: "\u662F\u5426\u8D60\u54C1",
|
|
12483
|
+
width: 150,
|
|
12484
|
+
render: function render(val) {
|
|
12485
|
+
return /*#__PURE__*/React.createElement("span", null, +val ? '是' : '否');
|
|
12486
|
+
}
|
|
12487
|
+
}];
|
|
12488
|
+
var renderFieldMap = {
|
|
12489
|
+
goodsNumber: function goodsNumber(_ref) {
|
|
12490
|
+
var disabled = _ref.disabled,
|
|
12491
|
+
updateHandle = _ref.updateHandle;
|
|
12492
|
+
return function (val, record, index) {
|
|
12493
|
+
return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
12494
|
+
style: {
|
|
12495
|
+
width: 70
|
|
12496
|
+
},
|
|
12497
|
+
value: val,
|
|
12498
|
+
min: 1,
|
|
12499
|
+
precision: 0,
|
|
12500
|
+
onChange: function onChange(num) {
|
|
12501
|
+
return updateHandle(num, index, 'goodsNumber');
|
|
12502
|
+
}
|
|
12503
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
12504
|
+
};
|
|
12505
|
+
},
|
|
12506
|
+
goodsPrice: function goodsPrice(_ref2) {
|
|
12507
|
+
var disabled = _ref2.disabled,
|
|
12508
|
+
updateHandle = _ref2.updateHandle;
|
|
12509
|
+
return function (val, record, index) {
|
|
12510
|
+
return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
12511
|
+
style: {
|
|
12512
|
+
width: 70
|
|
12513
|
+
},
|
|
12514
|
+
value: val,
|
|
12515
|
+
min: 0,
|
|
12516
|
+
onChange: function onChange(value) {
|
|
12517
|
+
return updateHandle(value, index, 'goodsPrice');
|
|
12518
|
+
}
|
|
12519
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
12520
|
+
};
|
|
12521
|
+
},
|
|
12522
|
+
isGift: function isGift(_ref3) {
|
|
12523
|
+
var disabled = _ref3.disabled,
|
|
12524
|
+
updateHandle = _ref3.updateHandle;
|
|
12525
|
+
return function (val, record, index) {
|
|
12526
|
+
var options = [{
|
|
12527
|
+
label: '是',
|
|
12528
|
+
value: 1
|
|
12529
|
+
}, {
|
|
12530
|
+
label: '否',
|
|
12531
|
+
value: 0
|
|
12532
|
+
}];
|
|
12533
|
+
return !disabled ? /*#__PURE__*/React.createElement(Select, {
|
|
12534
|
+
style: {
|
|
12535
|
+
width: 70
|
|
12536
|
+
},
|
|
12537
|
+
options: options,
|
|
12538
|
+
value: val,
|
|
12539
|
+
onChange: function onChange(value) {
|
|
12540
|
+
return updateHandle(value, index, 'isGift');
|
|
12541
|
+
},
|
|
12542
|
+
getPopupContainer: function getPopupContainer() {
|
|
12543
|
+
return document.getElementById('bsE3ReissueGoods');
|
|
12544
|
+
}
|
|
12545
|
+
}) : /*#__PURE__*/React.createElement("span", null, +val ? '是' : '否');
|
|
12546
|
+
};
|
|
12547
|
+
}
|
|
12548
|
+
};
|
|
12549
|
+
var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
|
|
12550
|
+
var disabled = _ref4.disabled,
|
|
12551
|
+
updateHandle = _ref4.updateHandle,
|
|
12552
|
+
operate = _ref4.operate;
|
|
12553
|
+
return columns$3.map(function (item) {
|
|
12554
|
+
var newItem = _objectSpread2({
|
|
12555
|
+
align: 'center',
|
|
12556
|
+
ellipsis: true
|
|
12557
|
+
}, item);
|
|
12558
|
+
if (operate && (renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex])) {
|
|
12559
|
+
return _objectSpread2(_objectSpread2({}, newItem), {}, {
|
|
12560
|
+
render: renderFieldMap === null || renderFieldMap === void 0 ? void 0 : renderFieldMap[item.dataIndex]({
|
|
12561
|
+
disabled: disabled,
|
|
12562
|
+
updateHandle: updateHandle
|
|
12563
|
+
})
|
|
12564
|
+
});
|
|
12565
|
+
}
|
|
12566
|
+
return newItem;
|
|
12567
|
+
});
|
|
12568
|
+
};
|
|
12569
|
+
|
|
12570
|
+
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
12571
|
+
var columns = _ref.columns,
|
|
12572
|
+
dataSource = _ref.dataSource,
|
|
12573
|
+
selectedRowKeys = _ref.selectedRowKeys,
|
|
12574
|
+
onChangeSelectedKeys = _ref.onChangeSelectedKeys;
|
|
12575
|
+
var _useState = useState(false),
|
|
12576
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12577
|
+
tradeGoodsVisible = _useState2[0],
|
|
12578
|
+
setTradeGoodsVisible = _useState2[1];
|
|
12579
|
+
var openModal = function openModal() {
|
|
12580
|
+
return setTradeGoodsVisible(true);
|
|
12581
|
+
};
|
|
12582
|
+
var closeModal = function closeModal() {
|
|
12583
|
+
return setTradeGoodsVisible(false);
|
|
12584
|
+
};
|
|
12585
|
+
var rowSelection = {
|
|
12586
|
+
selectedRowKeys: selectedRowKeys,
|
|
12587
|
+
onChange: onChangeSelectedKeys
|
|
12588
|
+
};
|
|
12589
|
+
console.debug('选择订单商品-dataSource', dataSource, selectedRowKeys);
|
|
12590
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
12591
|
+
type: "link",
|
|
12592
|
+
onClick: openModal
|
|
12593
|
+
}, "\u9009\u62E9\u8BA2\u5355\u5546\u54C1"), /*#__PURE__*/React.createElement(Modal, {
|
|
12594
|
+
title: "\u8BA2\u5355\u5546\u54C1",
|
|
12595
|
+
visible: tradeGoodsVisible,
|
|
12596
|
+
footer: null,
|
|
12597
|
+
onCancel: closeModal
|
|
12598
|
+
}, /*#__PURE__*/React.createElement(Table, {
|
|
12599
|
+
rowKey: "sku",
|
|
12600
|
+
rowSelection: rowSelection,
|
|
12601
|
+
columns: columns,
|
|
12602
|
+
dataSource: dataSource,
|
|
12603
|
+
pagination: false,
|
|
12604
|
+
scroll: {
|
|
12605
|
+
x: 500,
|
|
12606
|
+
y: 500
|
|
12607
|
+
}
|
|
12608
|
+
}), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length, "/", dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, ")")));
|
|
12609
|
+
};
|
|
12610
|
+
var GoodItem$1 = function GoodItem(props) {
|
|
12611
|
+
var _props$value = props.value,
|
|
12612
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
12613
|
+
type = props.type,
|
|
12614
|
+
onChange = props.onChange,
|
|
12615
|
+
disabled = props.disabled,
|
|
12616
|
+
_props$showHeader = props.showHeader,
|
|
12617
|
+
showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
|
|
12618
|
+
width = props.width,
|
|
12619
|
+
_props$shopList = props.shopList,
|
|
12620
|
+
shopList = _props$shopList === void 0 ? [] : _props$shopList,
|
|
12621
|
+
_props$shopId = props.shopId,
|
|
12622
|
+
shopId = _props$shopId === void 0 ? '' : _props$shopId,
|
|
12623
|
+
_props$maxLength = props.maxLength,
|
|
12624
|
+
maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
|
|
12625
|
+
_props$showChangeBtn = props.showChangeBtn,
|
|
12626
|
+
showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
|
|
12627
|
+
_props$showModeBtn = props.showModeBtn,
|
|
12628
|
+
showModeBtn = _props$showModeBtn === void 0 ? false : _props$showModeBtn,
|
|
12629
|
+
_props$isStrict = props.isStrict,
|
|
12630
|
+
isStrict = _props$isStrict === void 0 ? false : _props$isStrict,
|
|
12631
|
+
_props$tableSelect = props.tableSelect,
|
|
12632
|
+
tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
|
|
12633
|
+
_props$selectType = props.selectType,
|
|
12634
|
+
selectType = _props$selectType === void 0 ? '' : _props$selectType,
|
|
12635
|
+
_props$otherOperation = props.otherOperations,
|
|
12636
|
+
otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
|
|
12637
|
+
_props$canUpdateNumbe = props.canUpdateNumber,
|
|
12638
|
+
canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
|
|
12639
|
+
shopCode = props.shopCode,
|
|
12640
|
+
_props$companyKey = props.companyKey,
|
|
12641
|
+
companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
|
|
12642
|
+
onSelect = props.onSelect,
|
|
12643
|
+
onDelete = props.onDelete,
|
|
12644
|
+
onModeChange = props.onModeChange,
|
|
12645
|
+
tradeGoods = props.tradeGoods;
|
|
12646
|
+
var refModal = useRef();
|
|
12647
|
+
console.debug('表格数据', value);
|
|
12648
|
+
var handleDelete = function handleDelete(record, index) {
|
|
12649
|
+
onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
|
|
12650
|
+
var newList = _toConsumableArray(value).filter(function (item, i) {
|
|
12651
|
+
return index !== i;
|
|
12652
|
+
});
|
|
12653
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
|
|
12654
|
+
};
|
|
12655
|
+
var _useState3 = useState([]),
|
|
12656
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
12657
|
+
selectedRowKeys = _useState4[0],
|
|
12658
|
+
setSelectedRowKeys = _useState4[1];
|
|
12659
|
+
useEffect(function () {
|
|
12660
|
+
setSelectedRowKeys([]);
|
|
12661
|
+
}, [tableSelect, selectType]);
|
|
12662
|
+
// TODO: 商品订单中以选中商品
|
|
12663
|
+
var selectedGoods = useMemo(function () {
|
|
12664
|
+
return value === null || value === void 0 ? void 0 : value.map(function (v) {
|
|
12665
|
+
return v.sku;
|
|
12666
|
+
});
|
|
12667
|
+
}, [value]);
|
|
12668
|
+
var updateHandle = function updateHandle(val, index, columnType) {
|
|
12669
|
+
if (value === null || value === void 0 ? void 0 : value.length) {
|
|
12670
|
+
value[index][columnType] = val;
|
|
12671
|
+
if (type === 'WDT_RETURN_GOODS') {
|
|
12672
|
+
if (['sharePrice', 'num'].includes(columnType)) {
|
|
12673
|
+
var totalMoney = null;
|
|
12674
|
+
if (columnType === 'num') {
|
|
12675
|
+
totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].sharePrice));
|
|
12676
|
+
} else {
|
|
12677
|
+
totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
|
|
12678
|
+
}
|
|
12679
|
+
if (totalMoney !== null) {
|
|
12680
|
+
value[index]['returnPrice'] = totalMoney.toString();
|
|
12681
|
+
}
|
|
12682
|
+
}
|
|
12683
|
+
} else if (type === 'WDT_EXCHANGE_GOODS') {
|
|
12684
|
+
if (['price', 'num'].includes(columnType)) {
|
|
12685
|
+
var _totalMoney = null;
|
|
12686
|
+
if (columnType === 'num') {
|
|
12687
|
+
_totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].price));
|
|
12688
|
+
} else {
|
|
12689
|
+
_totalMoney = new BigNumber(value[index][columnType]).multipliedBy(new BigNumber(value[index].num));
|
|
12690
|
+
}
|
|
12691
|
+
if (_totalMoney !== null) {
|
|
12692
|
+
value[index]['exchangePrice'] = _totalMoney.toString();
|
|
12693
|
+
}
|
|
12694
|
+
}
|
|
12695
|
+
}
|
|
12696
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
|
|
12697
|
+
}
|
|
12698
|
+
};
|
|
12699
|
+
var COLUMNS_MAP = function COLUMNS_MAP() {
|
|
12700
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12701
|
+
var operate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
12702
|
+
return function (type) {
|
|
12703
|
+
var columns = [];
|
|
12704
|
+
switch (type) {
|
|
12705
|
+
case 'WDT_REISSUE_GOODS':
|
|
12706
|
+
case 'WDT_GOODS':
|
|
12707
|
+
columns = [{
|
|
12708
|
+
dataIndex: 'goodId',
|
|
12709
|
+
title: "\u5546\u54C1ID",
|
|
12710
|
+
align: 'center',
|
|
12711
|
+
ellipsis: true,
|
|
12712
|
+
width: 70
|
|
12713
|
+
}, {
|
|
12714
|
+
dataIndex: 'goodNo',
|
|
12715
|
+
title: "\u5546\u54C1\u7F16\u7801",
|
|
12716
|
+
align: 'center',
|
|
12717
|
+
ellipsis: true,
|
|
12129
12718
|
width: 180
|
|
12130
12719
|
}, {
|
|
12131
12720
|
dataIndex: 'goodName',
|
|
@@ -12464,6 +13053,161 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12464
13053
|
}];
|
|
12465
13054
|
}
|
|
12466
13055
|
break;
|
|
13056
|
+
case 'BS_E3_GOODS':
|
|
13057
|
+
{
|
|
13058
|
+
columns = [{
|
|
13059
|
+
dataIndex: 'sku',
|
|
13060
|
+
title: "SKU",
|
|
13061
|
+
align: 'center',
|
|
13062
|
+
ellipsis: true,
|
|
13063
|
+
width: 150
|
|
13064
|
+
}, {
|
|
13065
|
+
dataIndex: 'skuId',
|
|
13066
|
+
title: "SKU ID",
|
|
13067
|
+
align: 'center',
|
|
13068
|
+
ellipsis: true,
|
|
13069
|
+
width: 150
|
|
13070
|
+
}, {
|
|
13071
|
+
dataIndex: 'goodsName',
|
|
13072
|
+
title: "\u5546\u54C1\u540D\u79F0",
|
|
13073
|
+
align: 'center',
|
|
13074
|
+
ellipsis: true,
|
|
13075
|
+
width: 150
|
|
13076
|
+
}, {
|
|
13077
|
+
dataIndex: 'goodsShortName',
|
|
13078
|
+
title: "\u5546\u54C1\u7B80\u79F0",
|
|
13079
|
+
align: 'center',
|
|
13080
|
+
ellipsis: true,
|
|
13081
|
+
width: 100
|
|
13082
|
+
}, {
|
|
13083
|
+
dataIndex: 'picPath',
|
|
13084
|
+
title: "\u5546\u54C1\u56FE\u7247",
|
|
13085
|
+
align: 'center',
|
|
13086
|
+
ellipsis: true,
|
|
13087
|
+
width: 100,
|
|
13088
|
+
render: function render(val) {
|
|
13089
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
13090
|
+
width: 60,
|
|
13091
|
+
src: val
|
|
13092
|
+
});
|
|
13093
|
+
}
|
|
13094
|
+
}, {
|
|
13095
|
+
dataIndex: 'goodsSn',
|
|
13096
|
+
title: "\u8D27\u53F7",
|
|
13097
|
+
align: 'center',
|
|
13098
|
+
ellipsis: true,
|
|
13099
|
+
width: 150
|
|
13100
|
+
}, {
|
|
13101
|
+
dataIndex: 'goodsId',
|
|
13102
|
+
title: "\u8D27\u53F7ID",
|
|
13103
|
+
align: 'center',
|
|
13104
|
+
ellipsis: true,
|
|
13105
|
+
width: 150
|
|
13106
|
+
}, {
|
|
13107
|
+
dataIndex: 'colorName',
|
|
13108
|
+
title: "\u989C\u8272\u540D\u79F0",
|
|
13109
|
+
align: 'center',
|
|
13110
|
+
ellipsis: true,
|
|
13111
|
+
width: 100
|
|
13112
|
+
}, {
|
|
13113
|
+
dataIndex: 'colorCode',
|
|
13114
|
+
title: "\u989C\u8272\u4EE3\u7801",
|
|
13115
|
+
align: 'center',
|
|
13116
|
+
ellipsis: true,
|
|
13117
|
+
width: 150
|
|
13118
|
+
}, {
|
|
13119
|
+
dataIndex: 'sizeName',
|
|
13120
|
+
title: "\u5C3A\u7801\u540D\u79F0",
|
|
13121
|
+
align: 'center',
|
|
13122
|
+
ellipsis: true,
|
|
13123
|
+
width: 100
|
|
13124
|
+
}, {
|
|
13125
|
+
dataIndex: 'sizeCode',
|
|
13126
|
+
title: "\u5C3A\u7801\u4EE3\u7801",
|
|
13127
|
+
align: 'center',
|
|
13128
|
+
ellipsis: true,
|
|
13129
|
+
width: 100
|
|
13130
|
+
}, {
|
|
13131
|
+
dataIndex: 'brandName',
|
|
13132
|
+
title: "\u54C1\u724C\u540D\u79F0",
|
|
13133
|
+
align: 'center',
|
|
13134
|
+
ellipsis: true,
|
|
13135
|
+
width: 150
|
|
13136
|
+
}, {
|
|
13137
|
+
dataIndex: 'goodsNumber',
|
|
13138
|
+
title: "\u5546\u54C1\u6570\u91CF",
|
|
13139
|
+
align: 'center',
|
|
13140
|
+
ellipsis: true,
|
|
13141
|
+
width: 100
|
|
13142
|
+
}, {
|
|
13143
|
+
dataIndex: 'goodsPrice',
|
|
13144
|
+
title: "\u5546\u54C1\u5355\u4EF7",
|
|
13145
|
+
align: 'center',
|
|
13146
|
+
ellipsis: true,
|
|
13147
|
+
width: 120
|
|
13148
|
+
}, {
|
|
13149
|
+
dataIndex: 'shopPrice',
|
|
13150
|
+
title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
|
|
13151
|
+
align: 'center',
|
|
13152
|
+
ellipsis: true,
|
|
13153
|
+
width: 120
|
|
13154
|
+
}, {
|
|
13155
|
+
dataIndex: 'sharePrice',
|
|
13156
|
+
title: "\u5206\u644A\u4EF7",
|
|
13157
|
+
align: 'center',
|
|
13158
|
+
ellipsis: true,
|
|
13159
|
+
width: 120
|
|
13160
|
+
}, {
|
|
13161
|
+
dataIndex: 'sharePayment',
|
|
13162
|
+
title: "\u5206\u644A\u5B9E\u4ED8\u91D1\u989D",
|
|
13163
|
+
align: 'center',
|
|
13164
|
+
ellipsis: true,
|
|
13165
|
+
width: 120
|
|
13166
|
+
}, {
|
|
13167
|
+
dataIndex: 'payment',
|
|
13168
|
+
title: "\u5B9E\u4ED8\u91D1\u989D",
|
|
13169
|
+
align: 'center',
|
|
13170
|
+
ellipsis: true,
|
|
13171
|
+
width: 120
|
|
13172
|
+
}, {
|
|
13173
|
+
dataIndex: 'tcSku',
|
|
13174
|
+
title: "\u5957\u9910SKU",
|
|
13175
|
+
align: 'center',
|
|
13176
|
+
ellipsis: true,
|
|
13177
|
+
width: 150
|
|
13178
|
+
}, {
|
|
13179
|
+
dataIndex: 'tcGoodsNumber',
|
|
13180
|
+
title: "\u5957\u9910\u5957\u6570",
|
|
13181
|
+
align: 'center',
|
|
13182
|
+
ellipsis: true,
|
|
13183
|
+
width: 100
|
|
13184
|
+
}, {
|
|
13185
|
+
dataIndex: 'taoCanSingleSl',
|
|
13186
|
+
title: "\u5355\u4E2A\u5957\u9910\u6570\u91CF",
|
|
13187
|
+
align: 'center',
|
|
13188
|
+
ellipsis: true,
|
|
13189
|
+
width: 100
|
|
13190
|
+
}, {
|
|
13191
|
+
dataIndex: 'isGift',
|
|
13192
|
+
title: "\u662F\u5426\u8D60\u54C1",
|
|
13193
|
+
align: 'center',
|
|
13194
|
+
ellipsis: true,
|
|
13195
|
+
width: 100,
|
|
13196
|
+
render: function render(val) {
|
|
13197
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
13198
|
+
}
|
|
13199
|
+
}];
|
|
13200
|
+
}
|
|
13201
|
+
break;
|
|
13202
|
+
case 'BS_E3_REISSUE_GOODS':
|
|
13203
|
+
{
|
|
13204
|
+
columns = getBsE3ReissueGoodColumns({
|
|
13205
|
+
disabled: disabled,
|
|
13206
|
+
updateHandle: updateHandle,
|
|
13207
|
+
operate: operate
|
|
13208
|
+
});
|
|
13209
|
+
}
|
|
13210
|
+
break;
|
|
12467
13211
|
default:
|
|
12468
13212
|
columns = [{
|
|
12469
13213
|
dataIndex: 'mark',
|
|
@@ -12603,6 +13347,19 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12603
13347
|
}
|
|
12604
13348
|
return columnList;
|
|
12605
13349
|
}, [showHeader, value, disabled]);
|
|
13350
|
+
var orderColumns = useMemo(function () {
|
|
13351
|
+
var columns = COLUMNS_MAP('', false)(type);
|
|
13352
|
+
return [{
|
|
13353
|
+
dataIndex: '',
|
|
13354
|
+
title: '序号',
|
|
13355
|
+
align: 'center',
|
|
13356
|
+
ellipsis: true,
|
|
13357
|
+
width: 50,
|
|
13358
|
+
render: function render(val, record, index) {
|
|
13359
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
13360
|
+
}
|
|
13361
|
+
}].concat(_toConsumableArray(columns));
|
|
13362
|
+
}, []);
|
|
12606
13363
|
var onSubmit = function onSubmit(list) {
|
|
12607
13364
|
var newList = [];
|
|
12608
13365
|
if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
|
|
@@ -12619,6 +13376,39 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12619
13376
|
}
|
|
12620
13377
|
return item;
|
|
12621
13378
|
});
|
|
13379
|
+
} else if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
13380
|
+
newList = list.map(function (item) {
|
|
13381
|
+
var specNo = item.specNo,
|
|
13382
|
+
specId = item.specId,
|
|
13383
|
+
goodName = item.goodName,
|
|
13384
|
+
goodShortName = item.goodShortName,
|
|
13385
|
+
goodPicUrl = item.goodPicUrl,
|
|
13386
|
+
goodNo = item.goodNo,
|
|
13387
|
+
goodId = item.goodId,
|
|
13388
|
+
retailPrice = item.retailPrice;
|
|
13389
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13390
|
+
sku: specNo,
|
|
13391
|
+
skuId: specId,
|
|
13392
|
+
goodsName: goodName,
|
|
13393
|
+
goodsShortName: goodShortName,
|
|
13394
|
+
picPath: goodPicUrl,
|
|
13395
|
+
goodsSn: goodNo,
|
|
13396
|
+
goodsId: goodId,
|
|
13397
|
+
goodsPrice: retailPrice,
|
|
13398
|
+
shopPrice: retailPrice,
|
|
13399
|
+
sharePayment: '',
|
|
13400
|
+
sharePrice: '',
|
|
13401
|
+
payment: '',
|
|
13402
|
+
tcSku: '',
|
|
13403
|
+
tcGoodsNumber: '',
|
|
13404
|
+
taoCanSingleSl: '',
|
|
13405
|
+
isGift: '',
|
|
13406
|
+
uuid: uuid(),
|
|
13407
|
+
canDelete: true,
|
|
13408
|
+
goodsNumber: 1,
|
|
13409
|
+
canUpdateNumber: canUpdateNumber
|
|
13410
|
+
});
|
|
13411
|
+
});
|
|
12622
13412
|
} else {
|
|
12623
13413
|
newList = list.map(function (item) {
|
|
12624
13414
|
var goodsId = item.goodsId,
|
|
@@ -12661,6 +13451,9 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12661
13451
|
fixed: true,
|
|
12662
13452
|
onChange: onSelectChange
|
|
12663
13453
|
};
|
|
13454
|
+
var handleCheckboxChange = function handleCheckboxChange(e) {
|
|
13455
|
+
onModeChange === null || onModeChange === void 0 ? void 0 : onModeChange(e.target.checked);
|
|
13456
|
+
};
|
|
12664
13457
|
var tableConfig = useMemo(function () {
|
|
12665
13458
|
var params = {};
|
|
12666
13459
|
if (tableSelect) {
|
|
@@ -12672,10 +13465,18 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12672
13465
|
style: {
|
|
12673
13466
|
float: 'right'
|
|
12674
13467
|
}
|
|
12675
|
-
}, /*#__PURE__*/React.createElement(
|
|
13468
|
+
}, showModeBtn && /*#__PURE__*/React.createElement(Checkbox, {
|
|
13469
|
+
checked: isStrict,
|
|
13470
|
+
onChange: handleCheckboxChange
|
|
13471
|
+
}, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !isEmpty(tradeGoods) && /*#__PURE__*/React.createElement(SelectTradeGoods, {
|
|
13472
|
+
columns: orderColumns,
|
|
13473
|
+
dataSource: tradeGoods.originDataSource,
|
|
13474
|
+
selectedRowKeys: selectedGoods,
|
|
13475
|
+
onChangeSelectedKeys: tradeGoods.selectedGoodsChange
|
|
13476
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
12676
13477
|
type: "link",
|
|
12677
13478
|
onClick: handleChangeGoods
|
|
12678
|
-
},
|
|
13479
|
+
}, ['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type) ? '选择百胜ERP商品' : '选择商品'), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
|
|
12679
13480
|
columns: newColumns,
|
|
12680
13481
|
dataSource: value,
|
|
12681
13482
|
rowKey: 'uuid',
|
|
@@ -12695,6 +13496,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12695
13496
|
shopId: shopId,
|
|
12696
13497
|
maxLength: maxLength,
|
|
12697
13498
|
companyKey: companyKey
|
|
13499
|
+
}) : ['BS_E3_REISSUE_GOODS', 'BS_E3_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(BsE3GoodsModal, {
|
|
13500
|
+
ref: refModal,
|
|
13501
|
+
onSubmit: onSubmit,
|
|
13502
|
+
width: width,
|
|
13503
|
+
shopList: shopList,
|
|
13504
|
+
shopId: shopId,
|
|
13505
|
+
maxLength: maxLength,
|
|
13506
|
+
companyKey: companyKey
|
|
12698
13507
|
}) : /*#__PURE__*/React.createElement(GoodsModal$2, {
|
|
12699
13508
|
ref: refModal,
|
|
12700
13509
|
onSubmit: onSubmit,
|
|
@@ -13314,19 +14123,212 @@ var BsReturnGoods = function BsReturnGoods(props) {
|
|
|
13314
14123
|
})));
|
|
13315
14124
|
};
|
|
13316
14125
|
|
|
13317
|
-
var
|
|
13318
|
-
|
|
13319
|
-
|
|
13320
|
-
|
|
13321
|
-
|
|
13322
|
-
|
|
13323
|
-
|
|
13324
|
-
|
|
13325
|
-
|
|
13326
|
-
|
|
13327
|
-
|
|
13328
|
-
|
|
14126
|
+
var singletonMap = new Map();
|
|
14127
|
+
var getWdtOrderListSingleton = function getWdtOrderListSingleton(orderNo) {
|
|
14128
|
+
if (!singletonMap.has(orderNo)) {
|
|
14129
|
+
var p = new Promise(function (resolve, reject) {
|
|
14130
|
+
var doReject = function doReject(err) {
|
|
14131
|
+
// 清空掉错误的请求记录
|
|
14132
|
+
singletonMap.delete(orderNo);
|
|
14133
|
+
reject(err);
|
|
14134
|
+
};
|
|
14135
|
+
extendRequest('/qy/gdfw/order/wdtOrderDetail', {
|
|
14136
|
+
method: 'post',
|
|
14137
|
+
data: {
|
|
14138
|
+
billNo: orderNo
|
|
14139
|
+
}
|
|
14140
|
+
}).then(function (data) {
|
|
14141
|
+
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
14142
|
+
var _data$data, _data$data$trades;
|
|
14143
|
+
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) {
|
|
14144
|
+
data.data.trades = filterWdtOrders(data === null || data === void 0 ? void 0 : data.data, orderNo).map(function (item) {
|
|
14145
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
14146
|
+
billNo: item.tradeNo,
|
|
14147
|
+
billType: WDT_ORDER_TYPE_MAP[item.tradeType],
|
|
14148
|
+
billTag: item.tagName
|
|
14149
|
+
});
|
|
14150
|
+
});
|
|
14151
|
+
}
|
|
14152
|
+
resolve(data.data);
|
|
14153
|
+
// 延迟10秒清除,保证订单的时效性
|
|
14154
|
+
setTimeout(function () {
|
|
14155
|
+
singletonMap.delete(orderNo);
|
|
14156
|
+
}, 1000 * 10);
|
|
14157
|
+
} else {
|
|
14158
|
+
doReject(data);
|
|
14159
|
+
}
|
|
14160
|
+
}).catch(doReject);
|
|
14161
|
+
});
|
|
14162
|
+
singletonMap.set(orderNo, p);
|
|
14163
|
+
}
|
|
14164
|
+
return singletonMap.get(orderNo);
|
|
14165
|
+
};
|
|
14166
|
+
var wdtUtils = {
|
|
14167
|
+
getWdtOrderListSingleton: getWdtOrderListSingleton
|
|
14168
|
+
};
|
|
14169
|
+
|
|
14170
|
+
var singletonMap$1 = new Map();
|
|
14171
|
+
var getBsE3OrderListSingleton = function getBsE3OrderListSingleton(orderNo) {
|
|
14172
|
+
if (!singletonMap$1.has(orderNo)) {
|
|
14173
|
+
var p = new Promise(function (resolve, reject) {
|
|
14174
|
+
var doReject = function doReject(err) {
|
|
14175
|
+
// 清空掉错误的请求记录
|
|
14176
|
+
// singletonMap.delete(orderNo);
|
|
14177
|
+
reject(err);
|
|
14178
|
+
};
|
|
14179
|
+
extendRequest('/qy/gdfw/order/bse3OrderDetail', {
|
|
14180
|
+
method: 'post',
|
|
14181
|
+
data: {
|
|
14182
|
+
billNo: orderNo
|
|
14183
|
+
}
|
|
14184
|
+
}).then(function (data) {
|
|
14185
|
+
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
14186
|
+
var _data$data, _data$data$orderList;
|
|
14187
|
+
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) {
|
|
14188
|
+
data.data.orderList = filterBsE3Orders(data === null || data === void 0 ? void 0 : data.data, orderNo);
|
|
14189
|
+
}
|
|
14190
|
+
resolve(data.data);
|
|
14191
|
+
} else {
|
|
14192
|
+
doReject(data);
|
|
14193
|
+
}
|
|
14194
|
+
}).catch(doReject);
|
|
14195
|
+
});
|
|
14196
|
+
singletonMap$1.set(orderNo, p);
|
|
14197
|
+
}
|
|
14198
|
+
return singletonMap$1.get(orderNo);
|
|
14199
|
+
};
|
|
14200
|
+
var bsE3Utils = {
|
|
14201
|
+
getBsE3OrderListSingleton: getBsE3OrderListSingleton
|
|
14202
|
+
};
|
|
14203
|
+
|
|
14204
|
+
var columnsMap = {
|
|
14205
|
+
BS_SYSTEM_ORDER: [{
|
|
14206
|
+
title: '单据类型',
|
|
14207
|
+
dataIndex: 'billType',
|
|
14208
|
+
width: 150
|
|
14209
|
+
}, {
|
|
14210
|
+
title: '系统订单号',
|
|
14211
|
+
dataIndex: 'billNo',
|
|
14212
|
+
width: 150
|
|
14213
|
+
}, {
|
|
14214
|
+
title: '标签',
|
|
14215
|
+
dataIndex: 'billTag',
|
|
14216
|
+
width: 150
|
|
14217
|
+
}, {
|
|
14218
|
+
title: '主播名称',
|
|
14219
|
+
dataIndex: 'authorName',
|
|
14220
|
+
width: 150
|
|
14221
|
+
}, {
|
|
14222
|
+
title: '主播ID',
|
|
14223
|
+
dataIndex: 'authorId',
|
|
14224
|
+
width: 150
|
|
13329
14225
|
}
|
|
14226
|
+
// {
|
|
14227
|
+
// title: '直播活动',
|
|
14228
|
+
// dataIndex: 'liveActivites',
|
|
14229
|
+
// width: 150,
|
|
14230
|
+
// },
|
|
14231
|
+
],
|
|
14232
|
+
|
|
14233
|
+
WLN_SYSTEM_ORDER: [{
|
|
14234
|
+
title: '订单类型',
|
|
14235
|
+
dataIndex: 'billType',
|
|
14236
|
+
width: 150
|
|
14237
|
+
}, {
|
|
14238
|
+
title: '系统订单号',
|
|
14239
|
+
dataIndex: 'billNo',
|
|
14240
|
+
width: 150
|
|
14241
|
+
}, {
|
|
14242
|
+
title: '标记',
|
|
14243
|
+
dataIndex: 'billTag',
|
|
14244
|
+
width: 150
|
|
14245
|
+
}],
|
|
14246
|
+
WDT_SYSTEM_ORDER: [{
|
|
14247
|
+
title: '订单类型',
|
|
14248
|
+
dataIndex: 'billType',
|
|
14249
|
+
width: 150
|
|
14250
|
+
}, {
|
|
14251
|
+
title: '系统订单号',
|
|
14252
|
+
dataIndex: 'billNo',
|
|
14253
|
+
width: 150
|
|
14254
|
+
}, {
|
|
14255
|
+
title: '订单标签',
|
|
14256
|
+
dataIndex: 'billTag',
|
|
14257
|
+
width: 150
|
|
14258
|
+
}],
|
|
14259
|
+
BS_E3_SYSTEM_ORDER: [{
|
|
14260
|
+
title: '系统订单号',
|
|
14261
|
+
dataIndex: 'orderSn',
|
|
14262
|
+
width: 150,
|
|
14263
|
+
ellipsis: true
|
|
14264
|
+
}, {
|
|
14265
|
+
title: '订单状态',
|
|
14266
|
+
dataIndex: 'orderStatus',
|
|
14267
|
+
width: 100,
|
|
14268
|
+
ellipsis: true,
|
|
14269
|
+
render: function render(val) {
|
|
14270
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_ORDER_STATUS_MAP[val] || val);
|
|
14271
|
+
}
|
|
14272
|
+
}, {
|
|
14273
|
+
title: '是否被拆分',
|
|
14274
|
+
dataIndex: 'isSplit',
|
|
14275
|
+
width: 100,
|
|
14276
|
+
ellipsis: true,
|
|
14277
|
+
render: function render(val) {
|
|
14278
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
14279
|
+
}
|
|
14280
|
+
}, {
|
|
14281
|
+
title: '是否拆分子单',
|
|
14282
|
+
dataIndex: 'isSplitNew',
|
|
14283
|
+
width: 100,
|
|
14284
|
+
ellipsis: true,
|
|
14285
|
+
render: function render(val) {
|
|
14286
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
14287
|
+
}
|
|
14288
|
+
}, {
|
|
14289
|
+
title: '是否被合并',
|
|
14290
|
+
dataIndex: 'isCombine',
|
|
14291
|
+
width: 100,
|
|
14292
|
+
ellipsis: true,
|
|
14293
|
+
render: function render(val) {
|
|
14294
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
14295
|
+
}
|
|
14296
|
+
}, {
|
|
14297
|
+
title: '是否合并新单',
|
|
14298
|
+
dataIndex: 'isCombineNew',
|
|
14299
|
+
width: 100,
|
|
14300
|
+
ellipsis: true,
|
|
14301
|
+
render: function render(val) {
|
|
14302
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
14303
|
+
}
|
|
14304
|
+
}, {
|
|
14305
|
+
title: '是否复制单',
|
|
14306
|
+
dataIndex: 'isCopy',
|
|
14307
|
+
width: 100,
|
|
14308
|
+
ellipsis: true,
|
|
14309
|
+
render: function render(val) {
|
|
14310
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
14311
|
+
}
|
|
14312
|
+
}, {
|
|
14313
|
+
title: '是否换货单',
|
|
14314
|
+
dataIndex: 'isExchangeOrder',
|
|
14315
|
+
width: 100,
|
|
14316
|
+
ellipsis: true,
|
|
14317
|
+
render: function render(val) {
|
|
14318
|
+
return /*#__PURE__*/React.createElement("span", null, BS_E3_BOOLEAN_STATUS_MAP[val] || val);
|
|
14319
|
+
}
|
|
14320
|
+
}, {
|
|
14321
|
+
title: '订单备注',
|
|
14322
|
+
dataIndex: 'orderMsg',
|
|
14323
|
+
width: 150,
|
|
14324
|
+
ellipsis: true
|
|
14325
|
+
}]
|
|
14326
|
+
};
|
|
14327
|
+
var rowKeyMap = {
|
|
14328
|
+
BS_SYSTEM_ORDER: 'billNo',
|
|
14329
|
+
WLN_SYSTEM_ORDER: 'billNo',
|
|
14330
|
+
WDT_SYSTEM_ORDER: 'billNo',
|
|
14331
|
+
BS_E3_SYSTEM_ORDER: 'orderSn'
|
|
13330
14332
|
};
|
|
13331
14333
|
var index$1 = (function (props) {
|
|
13332
14334
|
var value = props.value,
|
|
@@ -13344,21 +14346,13 @@ var index$1 = (function (props) {
|
|
|
13344
14346
|
getWlnOrderList(value.orderNo);
|
|
13345
14347
|
} else if (type === 'WDT_SYSTEM_ORDER') {
|
|
13346
14348
|
getWdtOrderList(value.orderNo);
|
|
14349
|
+
} else if (type === 'BS_E3_SYSTEM_ORDER') {
|
|
14350
|
+
getBsE3OrderList(value.orderNo);
|
|
13347
14351
|
}
|
|
13348
14352
|
}
|
|
13349
|
-
}, [value, type]);
|
|
13350
|
-
var columns = useMemo(function () {
|
|
13351
|
-
|
|
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
|
-
}];
|
|
14353
|
+
}, [value, type]);
|
|
14354
|
+
var columns = useMemo(function () {
|
|
14355
|
+
return columnsMap[type] || [];
|
|
13362
14356
|
}, [type]);
|
|
13363
14357
|
var getOrderList = /*#__PURE__*/function () {
|
|
13364
14358
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
@@ -13384,11 +14378,15 @@ var index$1 = (function (props) {
|
|
|
13384
14378
|
return {
|
|
13385
14379
|
billNo: item.billNo,
|
|
13386
14380
|
billType: item.billType,
|
|
13387
|
-
billTag: item.billTag
|
|
14381
|
+
billTag: item.billTag,
|
|
14382
|
+
authorName: item.authorName,
|
|
14383
|
+
authorId: item.authorId
|
|
14384
|
+
// liveActivites: item.liveActivites,
|
|
13388
14385
|
};
|
|
13389
14386
|
})
|
|
13390
14387
|
}));
|
|
13391
14388
|
}
|
|
14389
|
+
|
|
13392
14390
|
onceRef.current = false;
|
|
13393
14391
|
case 7:
|
|
13394
14392
|
case "end":
|
|
@@ -13448,51 +14446,29 @@ var index$1 = (function (props) {
|
|
|
13448
14446
|
}();
|
|
13449
14447
|
var getWdtOrderList = /*#__PURE__*/function () {
|
|
13450
14448
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
|
|
13451
|
-
var _yield$request3, success, data, trades;
|
|
13452
14449
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
13453
14450
|
while (1) switch (_context3.prev = _context3.next) {
|
|
13454
14451
|
case 0:
|
|
13455
|
-
|
|
13456
|
-
|
|
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) {
|
|
14452
|
+
wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
|
|
14453
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
13468
14454
|
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
14455
|
});
|
|
13477
|
-
_onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
13478
|
-
orders: trades
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
billType
|
|
13482
|
-
billTag
|
|
13483
|
-
});
|
|
13484
|
-
}),
|
|
13485
|
-
showOrderInfo: trades.map(function (item) {
|
|
14456
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
14457
|
+
orders: trades,
|
|
14458
|
+
showOrderInfo: trades.map(function (_ref4) {
|
|
14459
|
+
var billNo = _ref4.billNo,
|
|
14460
|
+
billType = _ref4.billType,
|
|
14461
|
+
billTag = _ref4.billTag;
|
|
13486
14462
|
return {
|
|
13487
|
-
billNo:
|
|
13488
|
-
billType:
|
|
13489
|
-
billTag:
|
|
14463
|
+
billNo: billNo,
|
|
14464
|
+
billType: billType,
|
|
14465
|
+
billTag: billTag
|
|
13490
14466
|
};
|
|
13491
14467
|
})
|
|
13492
14468
|
}));
|
|
13493
|
-
}
|
|
14469
|
+
});
|
|
13494
14470
|
onceRef.current = false;
|
|
13495
|
-
case
|
|
14471
|
+
case 2:
|
|
13496
14472
|
case "end":
|
|
13497
14473
|
return _context3.stop();
|
|
13498
14474
|
}
|
|
@@ -13502,6 +14478,31 @@ var index$1 = (function (props) {
|
|
|
13502
14478
|
return _ref3.apply(this, arguments);
|
|
13503
14479
|
};
|
|
13504
14480
|
}();
|
|
14481
|
+
var getBsE3OrderList = /*#__PURE__*/function () {
|
|
14482
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(orderNo) {
|
|
14483
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
14484
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
14485
|
+
case 0:
|
|
14486
|
+
bsE3Utils.getBsE3OrderListSingleton(orderNo).then(function (data) {
|
|
14487
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
|
|
14488
|
+
return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
|
|
14489
|
+
});
|
|
14490
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
14491
|
+
orders: trades,
|
|
14492
|
+
showOrderInfo: trades
|
|
14493
|
+
}));
|
|
14494
|
+
});
|
|
14495
|
+
onceRef.current = false;
|
|
14496
|
+
case 2:
|
|
14497
|
+
case "end":
|
|
14498
|
+
return _context4.stop();
|
|
14499
|
+
}
|
|
14500
|
+
}, _callee4);
|
|
14501
|
+
}));
|
|
14502
|
+
return function getBsE3OrderList(_x4) {
|
|
14503
|
+
return _ref5.apply(this, arguments);
|
|
14504
|
+
};
|
|
14505
|
+
}();
|
|
13505
14506
|
var rowSelection = {
|
|
13506
14507
|
selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
|
|
13507
14508
|
fixed: true,
|
|
@@ -13522,7 +14523,7 @@ var index$1 = (function (props) {
|
|
|
13522
14523
|
dataSource: (value === null || value === void 0 ? void 0 : value.orders) || [],
|
|
13523
14524
|
columns: columns,
|
|
13524
14525
|
rowSelection: rowSelection,
|
|
13525
|
-
rowKey: 'billNo',
|
|
14526
|
+
rowKey: rowKeyMap[type] || 'billNo',
|
|
13526
14527
|
size: "small",
|
|
13527
14528
|
pagination: false,
|
|
13528
14529
|
scroll: {
|
|
@@ -13561,8 +14562,11 @@ var componentMap$1 = {
|
|
|
13561
14562
|
type: 'wdt',
|
|
13562
14563
|
key: 'wdtGoods',
|
|
13563
14564
|
name: '旺店通',
|
|
14565
|
+
orderNo: 'srcTid',
|
|
14566
|
+
goodDetailOrderNo: 'srcTid',
|
|
13564
14567
|
eventNameMap: {
|
|
13565
14568
|
type: 'wdtType',
|
|
14569
|
+
updateGoodsHandle: updateWdtGoodsHandle,
|
|
13566
14570
|
selectListReturn: 'wdtSelectListReturn',
|
|
13567
14571
|
selectList: 'wdtSelectList',
|
|
13568
14572
|
reissueSelectList: 'wdtReissueSelectList',
|
|
@@ -13577,6 +14581,30 @@ var componentMap$1 = {
|
|
|
13577
14581
|
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
13578
14582
|
exchangeDeleteGood: 'wdtExchangeDeleteGood'
|
|
13579
14583
|
}
|
|
14584
|
+
},
|
|
14585
|
+
'BS_E3_GOODS': {
|
|
14586
|
+
type: 'e3',
|
|
14587
|
+
key: 'bsE3Goods',
|
|
14588
|
+
name: '百胜E3',
|
|
14589
|
+
orderNo: 'dealCode',
|
|
14590
|
+
goodDetailOrderNo: 'originalDealCode',
|
|
14591
|
+
eventNameMap: {
|
|
14592
|
+
type: 'bsE3Type',
|
|
14593
|
+
updateGoodsHandle: updateBsE3GoodsHandle,
|
|
14594
|
+
selectListReturn: 'bsE3SelectListReturn',
|
|
14595
|
+
selectList: 'bsE3SelectList',
|
|
14596
|
+
reissueSelectList: 'bsE3ReissueSelectList',
|
|
14597
|
+
reissueSelectListReturn: 'bsE3ReissueSelectListReturn',
|
|
14598
|
+
reissueDeleteGood: 'bsE3ReissueDeleteGood',
|
|
14599
|
+
changeShopCode: 'bsE3ChangeShopCode',
|
|
14600
|
+
reissueType: 'bsE3ReissueType',
|
|
14601
|
+
returnType: 'bsE3ReturnType',
|
|
14602
|
+
returnSelectListReturn: 'bsE3ReturnSelectListReturn',
|
|
14603
|
+
returnSelectList: 'bsE3ReturnSelectList',
|
|
14604
|
+
deleteGood: 'bsE3DeleteGood',
|
|
14605
|
+
returnDeleteGood: 'bsE3ReturnDeleteGood',
|
|
14606
|
+
exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
|
|
14607
|
+
}
|
|
13580
14608
|
}
|
|
13581
14609
|
};
|
|
13582
14610
|
var CommonGoods = function CommonGoods(props) {
|
|
@@ -13585,6 +14613,13 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
13585
14613
|
disabled = props.disabled,
|
|
13586
14614
|
onChange = props.onChange,
|
|
13587
14615
|
compType = props.type;
|
|
14616
|
+
console.log('value?.orders', value === null || value === void 0 ? void 0 : value.orders);
|
|
14617
|
+
// 合并单订单会包含","
|
|
14618
|
+
var showModeBtn = !['BS_E3_GOODS'].includes(compType) && ((value === null || value === void 0 ? void 0 : value.orders) || []).some(function (order) {
|
|
14619
|
+
var _order$componentMap$c;
|
|
14620
|
+
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(',');
|
|
14621
|
+
});
|
|
14622
|
+
var getOrderFlag = useRef(false);
|
|
13588
14623
|
var _useState = useState(false),
|
|
13589
14624
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13590
14625
|
tableSelect = _useState2[0],
|
|
@@ -13592,8 +14627,36 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
13592
14627
|
var withInfo = useRef(null);
|
|
13593
14628
|
var valueRef = useRef(null);
|
|
13594
14629
|
useEffect(function () {
|
|
14630
|
+
var _value$orders;
|
|
13595
14631
|
valueRef.current = value;
|
|
14632
|
+
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)) {
|
|
14633
|
+
getOrderFlag.current = true;
|
|
14634
|
+
compType.indexOf('WDT') > -1 && getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
|
|
14635
|
+
}
|
|
13596
14636
|
}, [value]);
|
|
14637
|
+
var getWdtOrderList = /*#__PURE__*/function () {
|
|
14638
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
14639
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14640
|
+
while (1) switch (_context.prev = _context.next) {
|
|
14641
|
+
case 0:
|
|
14642
|
+
wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
|
|
14643
|
+
var orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (trade) {
|
|
14644
|
+
return (value.selectIds || []).includes(trade.tradeNo);
|
|
14645
|
+
});
|
|
14646
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
14647
|
+
orders: orders
|
|
14648
|
+
}));
|
|
14649
|
+
});
|
|
14650
|
+
case 1:
|
|
14651
|
+
case "end":
|
|
14652
|
+
return _context.stop();
|
|
14653
|
+
}
|
|
14654
|
+
}, _callee);
|
|
14655
|
+
}));
|
|
14656
|
+
return function getWdtOrderList(_x) {
|
|
14657
|
+
return _ref.apply(this, arguments);
|
|
14658
|
+
};
|
|
14659
|
+
}();
|
|
13597
14660
|
useEffect(function () {
|
|
13598
14661
|
pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
|
|
13599
14662
|
if (disabled) return;
|
|
@@ -13651,7 +14714,7 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
13651
14714
|
});
|
|
13652
14715
|
pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
13653
14716
|
// console.log(data);
|
|
13654
|
-
onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
14717
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
13655
14718
|
shopCode: data.shopCode
|
|
13656
14719
|
}));
|
|
13657
14720
|
});
|
|
@@ -13691,6 +14754,24 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
13691
14754
|
var changeHandle = function changeHandle(list) {
|
|
13692
14755
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
|
|
13693
14756
|
};
|
|
14757
|
+
var handleModeChange = function handleModeChange(isStrict) {
|
|
14758
|
+
// isStrict 是否只展示当前平台订单商品
|
|
14759
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({
|
|
14760
|
+
isStrict: isStrict
|
|
14761
|
+
}, componentMap$1[compType].key, getGoodDetails({
|
|
14762
|
+
mode: isStrict
|
|
14763
|
+
}))));
|
|
14764
|
+
};
|
|
14765
|
+
var getGoodDetails = function getGoodDetails(_ref2) {
|
|
14766
|
+
var mode = _ref2.mode;
|
|
14767
|
+
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
14768
|
+
var goodDetails = updateHandle(value.orders || []);
|
|
14769
|
+
var orderNo = value.orderNo;
|
|
14770
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
14771
|
+
var _componentMap$compTyp;
|
|
14772
|
+
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;
|
|
14773
|
+
}) : goodDetails;
|
|
14774
|
+
};
|
|
13694
14775
|
return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
13695
14776
|
key: componentMap$1[compType].key
|
|
13696
14777
|
}, props), {}, {
|
|
@@ -13707,7 +14788,10 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
13707
14788
|
},
|
|
13708
14789
|
onChange: function onChange(val) {
|
|
13709
14790
|
return changeHandle(val);
|
|
13710
|
-
}
|
|
14791
|
+
},
|
|
14792
|
+
onModeChange: handleModeChange,
|
|
14793
|
+
showModeBtn: showModeBtn,
|
|
14794
|
+
isStrict: value === null || value === void 0 ? void 0 : value.isStrict
|
|
13711
14795
|
}));
|
|
13712
14796
|
};
|
|
13713
14797
|
|
|
@@ -13974,8 +15058,8 @@ var typeMap$1 = {
|
|
|
13974
15058
|
key: 'wdtReissueGoods',
|
|
13975
15059
|
name: '旺店通',
|
|
13976
15060
|
typeName: 'wdtReissueType',
|
|
13977
|
-
|
|
13978
|
-
|
|
15061
|
+
systemOrder: 'wdtSystemOrder',
|
|
15062
|
+
systemOrderNo: 'wdtSystemOrderNo',
|
|
13979
15063
|
reissueSelectList: 'wdtReissueSelectList',
|
|
13980
15064
|
reissueSelectListReturn: 'wdtReissueSelectListReturn',
|
|
13981
15065
|
reissueDeleteGood: 'wdtReissueDeleteGood',
|
|
@@ -13984,11 +15068,12 @@ var typeMap$1 = {
|
|
|
13984
15068
|
formatDefaultField: {
|
|
13985
15069
|
money: 'orderPrice',
|
|
13986
15070
|
share: 'sharePrice'
|
|
13987
|
-
}
|
|
15071
|
+
},
|
|
15072
|
+
getOrderList: wdtUtils.getWdtOrderListSingleton
|
|
13988
15073
|
}
|
|
13989
15074
|
};
|
|
13990
15075
|
var wdtReissue = function wdtReissue(props) {
|
|
13991
|
-
var
|
|
15076
|
+
var _value$wdtSystemOrder, _typeMap$type24, _typeMap$type25, _value$typeMap$type$s5, _typeMap$type26, _typeMap$type27, _typeMap$type28;
|
|
13992
15077
|
var value = props.value,
|
|
13993
15078
|
onChange = props.onChange,
|
|
13994
15079
|
_props$reasonList = props.reasonList,
|
|
@@ -13996,177 +15081,172 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
13996
15081
|
disabled = props.disabled,
|
|
13997
15082
|
type = props.type,
|
|
13998
15083
|
other = _objectWithoutProperties(props, _excluded$g);
|
|
13999
|
-
var
|
|
14000
|
-
|
|
14001
|
-
|
|
14002
|
-
|
|
14003
|
-
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
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]);
|
|
15084
|
+
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) {
|
|
15085
|
+
var _order$srcTid;
|
|
15086
|
+
return order === null || order === void 0 ? void 0 : (_order$srcTid = order.srcTid) === null || _order$srcTid === void 0 ? void 0 : _order$srcTid.includes(',');
|
|
15087
|
+
});
|
|
15088
|
+
var getOrderFlag = useRef(false);
|
|
15089
|
+
var _useState = useState(false),
|
|
15090
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
15091
|
+
isStrict = _useState2[0],
|
|
15092
|
+
setIsStrict = _useState2[1];
|
|
14020
15093
|
useEffect(function () {
|
|
14021
|
-
var _value$
|
|
14022
|
-
if (!(value === null || value === void 0 ? void 0 : (_value$
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
15094
|
+
var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
|
|
15095
|
+
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)) {
|
|
15096
|
+
var _value$typeMap$type$s4, _typeMap$type3;
|
|
15097
|
+
getOrderFlag.current = true;
|
|
15098
|
+
getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.systemOrder]) === null || _value$typeMap$type$s4 === void 0 ? void 0 : _value$typeMap$type$s4.orderNo);
|
|
14026
15099
|
}
|
|
14027
15100
|
return;
|
|
14028
15101
|
}, [value]);
|
|
14029
|
-
useEffect(
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
}
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
var
|
|
14062
|
-
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
|
|
14063
|
-
var _typeMap$type13, _typeMap$type14;
|
|
14064
|
-
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.formatDefaultField.money)] = 0;
|
|
14065
|
-
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.share)] = 0;
|
|
14066
|
-
item.canUpdateNumber = true;
|
|
14067
|
-
return item;
|
|
14068
|
-
});
|
|
14069
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
14070
|
-
}
|
|
14071
|
-
};
|
|
14072
|
-
var getWdtOrderList = /*#__PURE__*/function () {
|
|
14073
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
14074
|
-
var _yield$request, success, data, _typeMap$type15, _typeMap$type16, orders, showOrderInfo;
|
|
15102
|
+
// useEffect(() => {
|
|
15103
|
+
// const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
|
|
15104
|
+
// if (systemOrderNo) {
|
|
15105
|
+
// if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
|
|
15106
|
+
// onChange?.({
|
|
15107
|
+
// ...value,
|
|
15108
|
+
// [typeMap[type]?.key]: getGoodDetails({
|
|
15109
|
+
// mode: isStrict
|
|
15110
|
+
// })
|
|
15111
|
+
// })
|
|
15112
|
+
// }
|
|
15113
|
+
// }
|
|
15114
|
+
// return;
|
|
15115
|
+
// }, [value?.[typeMap[type]?.systemOrderNo]]);
|
|
15116
|
+
// const getWdtOrderList = async (orderNo: string) => {
|
|
15117
|
+
// wdtUtils.getWdtOrderListSingleton(orderNo).then(data => {
|
|
15118
|
+
// const orders = data?.trades || [];
|
|
15119
|
+
// const showOrderInfo = orders.map(({ billNo, billType, billTag }: any) => {
|
|
15120
|
+
// return { billNo, billType, billTag }
|
|
15121
|
+
// });
|
|
15122
|
+
// onChange({
|
|
15123
|
+
// ...value,
|
|
15124
|
+
// [typeMap[type]?.systemOrder]: {
|
|
15125
|
+
// ...value[typeMap[type]?.systemOrder],
|
|
15126
|
+
// showOrderInfo,
|
|
15127
|
+
// orders,
|
|
15128
|
+
// },
|
|
15129
|
+
// });
|
|
15130
|
+
// })
|
|
15131
|
+
// };
|
|
15132
|
+
var getOrderList = /*#__PURE__*/function () {
|
|
15133
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
15134
|
+
var _typeMap$type4;
|
|
14075
15135
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14076
15136
|
while (1) switch (_context.prev = _context.next) {
|
|
14077
15137
|
case 0:
|
|
14078
|
-
|
|
14079
|
-
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
billNo
|
|
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) {
|
|
15138
|
+
(_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
|
|
15139
|
+
var _typeMap$type5, _typeMap$type6;
|
|
15140
|
+
var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
|
|
15141
|
+
var showOrderInfo = orders.map(function (_ref2) {
|
|
15142
|
+
var billNo = _ref2.billNo,
|
|
15143
|
+
billType = _ref2.billType,
|
|
15144
|
+
billTag = _ref2.billTag;
|
|
14098
15145
|
return {
|
|
14099
|
-
billNo:
|
|
14100
|
-
billType:
|
|
14101
|
-
billTag:
|
|
15146
|
+
billNo: billNo,
|
|
15147
|
+
billType: billType,
|
|
15148
|
+
billTag: billTag
|
|
14102
15149
|
};
|
|
14103
15150
|
});
|
|
14104
|
-
onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$
|
|
15151
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
|
|
14105
15152
|
showOrderInfo: showOrderInfo,
|
|
14106
15153
|
orders: orders
|
|
14107
15154
|
}))));
|
|
14108
|
-
}
|
|
14109
|
-
case
|
|
15155
|
+
});
|
|
15156
|
+
case 1:
|
|
14110
15157
|
case "end":
|
|
14111
15158
|
return _context.stop();
|
|
14112
15159
|
}
|
|
14113
15160
|
}, _callee);
|
|
14114
15161
|
}));
|
|
14115
|
-
return function
|
|
14116
|
-
return
|
|
15162
|
+
return function getOrderList(_x) {
|
|
15163
|
+
return _ref.apply(this, arguments);
|
|
14117
15164
|
};
|
|
14118
15165
|
}();
|
|
14119
15166
|
var changeTypeHandle = function changeTypeHandle(val) {
|
|
14120
|
-
var _typeMap$
|
|
15167
|
+
var _value$typeMap$type$t, _typeMap$type7, _typeMap$type8;
|
|
15168
|
+
var typeName = val === null || val === void 0 ? void 0 : val[0];
|
|
15169
|
+
if (typeName === (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) return;
|
|
15170
|
+
// const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
|
|
14121
15171
|
var newValue = _objectSpread2({}, value);
|
|
14122
|
-
newValue[
|
|
14123
|
-
|
|
15172
|
+
newValue[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName] = val;
|
|
15173
|
+
if (typeName === '1') {
|
|
15174
|
+
var _typeMap$type9;
|
|
15175
|
+
newValue[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = getGoodDetails({
|
|
15176
|
+
mode: isStrict
|
|
15177
|
+
});
|
|
15178
|
+
} else if (typeName === '2') {
|
|
15179
|
+
var _typeMap$type10;
|
|
15180
|
+
// 切换到非原单,清空列表
|
|
15181
|
+
newValue[(_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key] = [];
|
|
15182
|
+
}
|
|
14124
15183
|
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
15184
|
};
|
|
14135
|
-
|
|
15185
|
+
var handleModeChange = function handleModeChange(mode) {
|
|
15186
|
+
var _value$typeMap$type$t2, _typeMap$type11, _typeMap$type12;
|
|
15187
|
+
var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0]) === '1';
|
|
15188
|
+
setIsStrict(mode);
|
|
15189
|
+
if (!isOriginalOrder) return;
|
|
15190
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key, getGoodDetails({
|
|
15191
|
+
mode: mode
|
|
15192
|
+
}))));
|
|
15193
|
+
};
|
|
15194
|
+
var getGoodDetails = function getGoodDetails(_ref3) {
|
|
15195
|
+
var _typeMap$type13, _typeMap$type14, _order$goodDetails;
|
|
15196
|
+
var mode = _ref3.mode,
|
|
15197
|
+
sysOrderNo = _ref3.sysOrderNo;
|
|
15198
|
+
var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrder];
|
|
15199
|
+
var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.systemOrderNo];
|
|
15200
|
+
var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
|
|
15201
|
+
return order.tradeNo === systemOrderNo;
|
|
15202
|
+
});
|
|
15203
|
+
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]) : [];
|
|
15204
|
+
var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
|
|
15205
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
15206
|
+
return !orderNo || goodItem.srcTid === orderNo;
|
|
15207
|
+
}) : goodDetails;
|
|
15208
|
+
};
|
|
14136
15209
|
var changeGoodHandle = function changeGoodHandle(val) {
|
|
14137
|
-
var _typeMap$
|
|
15210
|
+
var _typeMap$type15;
|
|
14138
15211
|
var newValue = _objectSpread2({}, value);
|
|
14139
|
-
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
14140
|
-
var _typeMap$
|
|
14141
|
-
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
14142
|
-
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15212
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.key)] = (val || []).map(function (item) {
|
|
15213
|
+
var _typeMap$type16, _typeMap$type17;
|
|
15214
|
+
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.formatDefaultField.money)] = 0;
|
|
15215
|
+
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.share)] = 0;
|
|
14143
15216
|
return item;
|
|
14144
15217
|
});
|
|
14145
15218
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
14146
15219
|
};
|
|
14147
15220
|
var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
|
|
14148
|
-
var _typeMap$
|
|
15221
|
+
var _typeMap$type18, _value$typeMap$type$t3, _typeMap$type19, _value$typeMap$type$t4, _typeMap$type21;
|
|
14149
15222
|
var newValue = _objectSpread2({}, value);
|
|
14150
|
-
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
14151
|
-
if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$
|
|
14152
|
-
var _typeMap$
|
|
14153
|
-
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15223
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.systemOrderNo)] = val;
|
|
15224
|
+
if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
|
|
15225
|
+
var _typeMap$type20;
|
|
15226
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = [];
|
|
15227
|
+
} else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0])) {
|
|
15228
|
+
var _typeMap$type22;
|
|
15229
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)] = getGoodDetails({
|
|
15230
|
+
mode: isStrict,
|
|
15231
|
+
sysOrderNo: val
|
|
15232
|
+
});
|
|
14154
15233
|
}
|
|
14155
15234
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
14156
15235
|
};
|
|
14157
15236
|
//显示选择商品按钮 原单换不显示选择商品
|
|
14158
15237
|
var showChangeBtn = useMemo(function () {
|
|
14159
|
-
var _typeMap$
|
|
14160
|
-
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$
|
|
14161
|
-
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$
|
|
15238
|
+
var _typeMap$type23;
|
|
15239
|
+
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrderNo]);
|
|
15240
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrderNo]]);
|
|
14162
15241
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
|
|
14163
|
-
gutter: 8
|
|
15242
|
+
gutter: 8,
|
|
15243
|
+
wrap: true
|
|
14164
15244
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
14165
15245
|
className: "gutter-row",
|
|
14166
15246
|
xs: {
|
|
14167
15247
|
span: 11
|
|
14168
15248
|
},
|
|
14169
|
-
|
|
15249
|
+
sm: {
|
|
14170
15250
|
span: 6
|
|
14171
15251
|
}
|
|
14172
15252
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
@@ -14175,12 +15255,12 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
14175
15255
|
},
|
|
14176
15256
|
disabled: disabled,
|
|
14177
15257
|
allowClear: false,
|
|
14178
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15258
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrderNo)],
|
|
14179
15259
|
onChange: function onChange(val) {
|
|
14180
15260
|
return changeSystemOrderHandle(val);
|
|
14181
15261
|
},
|
|
14182
15262
|
placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
|
|
14183
|
-
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$
|
|
15263
|
+
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
|
|
14184
15264
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
14185
15265
|
key: item.billNo,
|
|
14186
15266
|
value: item.billNo,
|
|
@@ -14191,7 +15271,7 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
14191
15271
|
xs: {
|
|
14192
15272
|
span: 11
|
|
14193
15273
|
},
|
|
14194
|
-
|
|
15274
|
+
sm: {
|
|
14195
15275
|
span: 6
|
|
14196
15276
|
}
|
|
14197
15277
|
}, /*#__PURE__*/React.createElement(Cascader, {
|
|
@@ -14201,7 +15281,7 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
14201
15281
|
disabled: disabled,
|
|
14202
15282
|
allowClear: false,
|
|
14203
15283
|
options: reasonList,
|
|
14204
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15284
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.typeName)],
|
|
14205
15285
|
onChange: function onChange(val) {
|
|
14206
15286
|
return changeTypeHandle(val);
|
|
14207
15287
|
}
|
|
@@ -14213,10 +15293,13 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
14213
15293
|
canUpdateNumber: showChangeBtn,
|
|
14214
15294
|
showChangeBtn: showChangeBtn,
|
|
14215
15295
|
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$
|
|
15296
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.key)],
|
|
14217
15297
|
onChange: function onChange(val) {
|
|
14218
15298
|
return changeGoodHandle(val);
|
|
14219
|
-
}
|
|
15299
|
+
},
|
|
15300
|
+
onModeChange: handleModeChange,
|
|
15301
|
+
showModeBtn: showModeBtn,
|
|
15302
|
+
isStrict: isStrict
|
|
14220
15303
|
})));
|
|
14221
15304
|
};
|
|
14222
15305
|
|
|
@@ -14226,7 +15309,7 @@ styleInject(css_248z$a);
|
|
|
14226
15309
|
var TabPane$1 = Tabs.TabPane;
|
|
14227
15310
|
var Option$2 = Select.Option;
|
|
14228
15311
|
var Search$1 = Input.Search;
|
|
14229
|
-
var GoodsModal$
|
|
15312
|
+
var GoodsModal$5 = function GoodsModal(props) {
|
|
14230
15313
|
var onSubmit = props.onSubmit,
|
|
14231
15314
|
_onCancel = props.onCancel,
|
|
14232
15315
|
visible = props.visible,
|
|
@@ -14677,7 +15760,7 @@ var Goods$1 = function Goods(props, ref) {
|
|
|
14677
15760
|
};
|
|
14678
15761
|
return /*#__PURE__*/React.createElement("div", {
|
|
14679
15762
|
className: "goodsBox"
|
|
14680
|
-
}, /*#__PURE__*/React.createElement(GoodsModal$
|
|
15763
|
+
}, /*#__PURE__*/React.createElement(GoodsModal$5, {
|
|
14681
15764
|
visible: visible,
|
|
14682
15765
|
onSubmit: onSubmit,
|
|
14683
15766
|
type: type,
|
|
@@ -14990,4 +16073,234 @@ var CalculationInput = function CalculationInput(props) {
|
|
|
14990
16073
|
}, config === null || config === void 0 ? void 0 : config.unit));
|
|
14991
16074
|
};
|
|
14992
16075
|
|
|
14993
|
-
|
|
16076
|
+
var _excluded$k = ["value", "onChange", "reasonList", "disabled", "type"];
|
|
16077
|
+
var typeMap$2 = {
|
|
16078
|
+
BS_E3_REISSUE_GOODS: {
|
|
16079
|
+
key: 'bsE3ReissueGoods',
|
|
16080
|
+
typeName: 'bsE3ReissueType',
|
|
16081
|
+
systemOrder: 'bsE3SystemOrder',
|
|
16082
|
+
systemOrderNo: 'bsE3SystemOrderNo',
|
|
16083
|
+
getOrderList: bsE3Utils.getBsE3OrderListSingleton
|
|
16084
|
+
}
|
|
16085
|
+
};
|
|
16086
|
+
var bsE3Reissue = function bsE3Reissue(props) {
|
|
16087
|
+
var _typeMap$type21, _typeMap$type23, _typeMap$type24, _value$typeMap$type$s5, _typeMap$type25, _typeMap$type26, _typeMap$type27;
|
|
16088
|
+
var value = props.value,
|
|
16089
|
+
onChange = props.onChange,
|
|
16090
|
+
_props$reasonList = props.reasonList,
|
|
16091
|
+
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
16092
|
+
disabled = props.disabled,
|
|
16093
|
+
type = props.type,
|
|
16094
|
+
other = _objectWithoutProperties(props, _excluded$k);
|
|
16095
|
+
var getOrderFlag = useRef(false);
|
|
16096
|
+
var _useState = useState(false),
|
|
16097
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
16098
|
+
isStrict = _useState2[0],
|
|
16099
|
+
setIsStrict = _useState2[1];
|
|
16100
|
+
// TODO: 在修改场景下手动获取一次订单详情中数据
|
|
16101
|
+
useEffect(function () {
|
|
16102
|
+
var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
|
|
16103
|
+
if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$2[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.systemOrder]) === null || _value$typeMap$type$s === void 0 ? void 0 : (_value$typeMap$type$s2 = _value$typeMap$type$s.orders) === null || _value$typeMap$type$s2 === void 0 ? void 0 : _value$typeMap$type$s2.length) && (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s3 = value[(_typeMap$type2 = typeMap$2[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.systemOrder]) === null || _value$typeMap$type$s3 === void 0 ? void 0 : _value$typeMap$type$s3.orderNo)) {
|
|
16104
|
+
var _value$typeMap$type$s4, _typeMap$type3;
|
|
16105
|
+
getOrderFlag.current = true;
|
|
16106
|
+
getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$2[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.systemOrder]) === null || _value$typeMap$type$s4 === void 0 ? void 0 : _value$typeMap$type$s4.orderNo);
|
|
16107
|
+
}
|
|
16108
|
+
return;
|
|
16109
|
+
}, [value]);
|
|
16110
|
+
// useEffect(() => {
|
|
16111
|
+
// const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
|
|
16112
|
+
// if (systemOrderNo) {
|
|
16113
|
+
// if (['1'].includes(value?.[typeMap[type]?.typeName]?.[0])) {
|
|
16114
|
+
// onChange?.({
|
|
16115
|
+
// ...value,
|
|
16116
|
+
// [typeMap[type]?.key]: getGoodDetails({
|
|
16117
|
+
// mode: isStrict
|
|
16118
|
+
// })
|
|
16119
|
+
// })
|
|
16120
|
+
// }
|
|
16121
|
+
// }
|
|
16122
|
+
// return;
|
|
16123
|
+
// }, [value?.[typeMap[type]?.systemOrderNo]]);
|
|
16124
|
+
var getOrderList = /*#__PURE__*/function () {
|
|
16125
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
16126
|
+
var _typeMap$type4;
|
|
16127
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
16128
|
+
while (1) switch (_context.prev = _context.next) {
|
|
16129
|
+
case 0:
|
|
16130
|
+
(_typeMap$type4 = typeMap$2[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
|
|
16131
|
+
var _typeMap$type5, _typeMap$type6;
|
|
16132
|
+
var orders = (data === null || data === void 0 ? void 0 : data.orderList) || [];
|
|
16133
|
+
var showOrderInfo = orders.map(function (_ref2) {
|
|
16134
|
+
var orderSn = _ref2.orderSn;
|
|
16135
|
+
return {
|
|
16136
|
+
billNo: orderSn
|
|
16137
|
+
};
|
|
16138
|
+
});
|
|
16139
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$2[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$2[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
|
|
16140
|
+
showOrderInfo: showOrderInfo,
|
|
16141
|
+
orders: orders
|
|
16142
|
+
}))));
|
|
16143
|
+
});
|
|
16144
|
+
case 1:
|
|
16145
|
+
case "end":
|
|
16146
|
+
return _context.stop();
|
|
16147
|
+
}
|
|
16148
|
+
}, _callee);
|
|
16149
|
+
}));
|
|
16150
|
+
return function getOrderList(_x) {
|
|
16151
|
+
return _ref.apply(this, arguments);
|
|
16152
|
+
};
|
|
16153
|
+
}();
|
|
16154
|
+
var changeTypeHandle = function changeTypeHandle(val) {
|
|
16155
|
+
var _typeMap$type7;
|
|
16156
|
+
var typeName = val === null || val === void 0 ? void 0 : val[0];
|
|
16157
|
+
// if (typeName === value?.[typeMap[type]?.typeName]?.[0]) return
|
|
16158
|
+
// const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
|
|
16159
|
+
var newValue = _objectSpread2({}, value);
|
|
16160
|
+
newValue[(_typeMap$type7 = typeMap$2[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.typeName] = val;
|
|
16161
|
+
if (typeName === '1') {
|
|
16162
|
+
var _typeMap$type8;
|
|
16163
|
+
newValue[(_typeMap$type8 = typeMap$2[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.key] = getGoodDetails({
|
|
16164
|
+
mode: isStrict
|
|
16165
|
+
});
|
|
16166
|
+
} else if (typeName === '2') {
|
|
16167
|
+
var _typeMap$type9;
|
|
16168
|
+
// 切换到非原单,清空列表
|
|
16169
|
+
newValue[(_typeMap$type9 = typeMap$2[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key] = [];
|
|
16170
|
+
}
|
|
16171
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
16172
|
+
};
|
|
16173
|
+
var handleModeChange = function handleModeChange(mode) {
|
|
16174
|
+
var _value$typeMap$type$t, _typeMap$type10, _typeMap$type11;
|
|
16175
|
+
var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type10 = typeMap$2[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0]) === '1';
|
|
16176
|
+
setIsStrict(mode);
|
|
16177
|
+
if (!isOriginalOrder) return;
|
|
16178
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type11 = typeMap$2[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.key, getGoodDetails({
|
|
16179
|
+
mode: mode
|
|
16180
|
+
}))));
|
|
16181
|
+
};
|
|
16182
|
+
var getGoodDetails = function getGoodDetails(_ref3) {
|
|
16183
|
+
var _typeMap$type12, _typeMap$type13, _order$orderDetailGet;
|
|
16184
|
+
var mode = _ref3.mode,
|
|
16185
|
+
sysOrderNo = _ref3.sysOrderNo;
|
|
16186
|
+
var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type12 = typeMap$2[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.systemOrder];
|
|
16187
|
+
var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type13 = typeMap$2[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.systemOrderNo];
|
|
16188
|
+
var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
|
|
16189
|
+
return order.orderSn === systemOrderNo;
|
|
16190
|
+
});
|
|
16191
|
+
var goodDetails = (order === null || order === void 0 ? void 0 : (_order$orderDetailGet = order.orderDetailGets) === null || _order$orderDetailGet === void 0 ? void 0 : _order$orderDetailGet.length) ? updateBsE3GoodsHandle([order]) : [];
|
|
16192
|
+
var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
|
|
16193
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
16194
|
+
return !orderNo || goodItem.originalOrderSn === orderNo;
|
|
16195
|
+
}) : goodDetails;
|
|
16196
|
+
};
|
|
16197
|
+
var changeGoodHandle = function changeGoodHandle(val) {
|
|
16198
|
+
var _typeMap$type14;
|
|
16199
|
+
var newValue = _objectSpread2({}, value);
|
|
16200
|
+
newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type14 = typeMap$2[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key)] = val || [];
|
|
16201
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
16202
|
+
};
|
|
16203
|
+
var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
|
|
16204
|
+
var _typeMap$type15, _value$typeMap$type$t2, _typeMap$type16, _value$typeMap$type$t3, _typeMap$type18;
|
|
16205
|
+
var newValue = _objectSpread2({}, value);
|
|
16206
|
+
newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type15 = typeMap$2[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.systemOrderNo)] = val;
|
|
16207
|
+
if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type16 = typeMap$2[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
|
|
16208
|
+
var _typeMap$type17;
|
|
16209
|
+
newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type17 = typeMap$2[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.key)] = [];
|
|
16210
|
+
} else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type18 = typeMap$2[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
|
|
16211
|
+
var _typeMap$type19;
|
|
16212
|
+
newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type19 = typeMap$2[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = getGoodDetails({
|
|
16213
|
+
mode: isStrict,
|
|
16214
|
+
sysOrderNo: val
|
|
16215
|
+
});
|
|
16216
|
+
}
|
|
16217
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
16218
|
+
};
|
|
16219
|
+
//显示选择商品按钮 原单换不显示选择商品
|
|
16220
|
+
var showChangeBtn = useMemo(function () {
|
|
16221
|
+
var _typeMap$type20;
|
|
16222
|
+
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap$2[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.systemOrderNo]);
|
|
16223
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type21 = typeMap$2[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.systemOrderNo]]);
|
|
16224
|
+
var selectedGoodsChange = useCallback(function (skuList) {
|
|
16225
|
+
var _typeMap$type22, _getGoodDetails;
|
|
16226
|
+
var newValue = _objectSpread2({}, value);
|
|
16227
|
+
newValue["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type22 = typeMap$2[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)] = (_getGoodDetails = getGoodDetails({
|
|
16228
|
+
mode: isStrict
|
|
16229
|
+
})) === null || _getGoodDetails === void 0 ? void 0 : _getGoodDetails.filter(function (item) {
|
|
16230
|
+
return skuList.includes(item.sku);
|
|
16231
|
+
});
|
|
16232
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
16233
|
+
}, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type23 = typeMap$2[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.key)], isStrict]);
|
|
16234
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
|
|
16235
|
+
gutter: 8,
|
|
16236
|
+
wrap: true,
|
|
16237
|
+
id: "bsE3ReissueGoods"
|
|
16238
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
16239
|
+
className: "gutter-row",
|
|
16240
|
+
xs: {
|
|
16241
|
+
span: 11
|
|
16242
|
+
},
|
|
16243
|
+
sm: {
|
|
16244
|
+
span: 6
|
|
16245
|
+
}
|
|
16246
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
16247
|
+
style: {
|
|
16248
|
+
marginBottom: '8px'
|
|
16249
|
+
},
|
|
16250
|
+
disabled: disabled,
|
|
16251
|
+
allowClear: false,
|
|
16252
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type24 = typeMap$2[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrderNo)],
|
|
16253
|
+
onChange: function onChange(val) {
|
|
16254
|
+
return changeSystemOrderHandle(val);
|
|
16255
|
+
},
|
|
16256
|
+
placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
|
|
16257
|
+
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type25 = typeMap$2[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
|
|
16258
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
16259
|
+
key: item.billNo,
|
|
16260
|
+
value: item.billNo,
|
|
16261
|
+
label: item.billNo
|
|
16262
|
+
}, item.billNo);
|
|
16263
|
+
}))), /*#__PURE__*/React.createElement(Col, {
|
|
16264
|
+
className: "gutter-row",
|
|
16265
|
+
xs: {
|
|
16266
|
+
span: 11
|
|
16267
|
+
},
|
|
16268
|
+
sm: {
|
|
16269
|
+
span: 6
|
|
16270
|
+
}
|
|
16271
|
+
}, /*#__PURE__*/React.createElement(Cascader, {
|
|
16272
|
+
style: {
|
|
16273
|
+
marginBottom: '8px'
|
|
16274
|
+
},
|
|
16275
|
+
disabled: disabled,
|
|
16276
|
+
allowClear: false,
|
|
16277
|
+
options: reasonList,
|
|
16278
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type26 = typeMap$2[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.typeName)],
|
|
16279
|
+
onChange: function onChange(val) {
|
|
16280
|
+
return changeTypeHandle(val);
|
|
16281
|
+
}
|
|
16282
|
+
}))), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
16283
|
+
key: 'reissueGoods'
|
|
16284
|
+
}, other), {}, {
|
|
16285
|
+
type: type,
|
|
16286
|
+
disabled: disabled,
|
|
16287
|
+
canUpdateNumber: showChangeBtn,
|
|
16288
|
+
showChangeBtn: showChangeBtn,
|
|
16289
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
16290
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$2 === null || typeMap$2 === void 0 ? void 0 : (_typeMap$type27 = typeMap$2[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.key)],
|
|
16291
|
+
onChange: function onChange(val) {
|
|
16292
|
+
return changeGoodHandle(val);
|
|
16293
|
+
},
|
|
16294
|
+
onModeChange: handleModeChange,
|
|
16295
|
+
showModeBtn: false,
|
|
16296
|
+
isStrict: isStrict,
|
|
16297
|
+
tradeGoods: {
|
|
16298
|
+
originDataSource: getGoodDetails({
|
|
16299
|
+
mode: isStrict
|
|
16300
|
+
}),
|
|
16301
|
+
selectedGoodsChange: selectedGoodsChange
|
|
16302
|
+
}
|
|
16303
|
+
})));
|
|
16304
|
+
};
|
|
16305
|
+
|
|
16306
|
+
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods };
|