@kmkf-fe-packages/basic-components 2.0.78 → 2.0.79-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.esm.js +280 -41
- package/dist/index.js +279 -40
- package/dist/src/bs/component/GoodItem/index.d.ts +2 -0
- package/dist/src/common/CommonGoods/constants/index.d.ts +5 -0
- package/package.json +3 -3
package/README.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
|
|
|
3
3
|
import { EyeOutlined, DeleteOutlined, CloseOutlined, CopyOutlined, CloseCircleOutlined, CaretUpOutlined, MinusCircleFilled, VideoCameraTwoTone } 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, GyAddressData, request as request$1, ExpressData, uuid, servers, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterKmOrders, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog } from '@kmkf-fe-packages/kmkf-utils';
|
|
6
|
+
import { AddressData, BsAddressData, WdtAddressData, GyAddressData, request as request$1, ExpressData, uuid, servers, columnsGoodsList, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, isNull, filterWdtOrders, WDT_ORDER_TYPE_MAP, tradeStatusMap, filterBsE3Orders, filterGyOrders, GY_DELIVERY_STATE_MAPPING, filterJstOrders, filterKmOrders, getIsPlatformCodesIncludeOrderNos, BS_SYSTEM_ORDER_CONFIG, KM_SYSTEM_ORDER_CONFIG, WLN_SYSTEM_ORDER_CONFIG, WDT_SYSTEM_ORDER_CONFIG, BS_E3_SYSTEM_ORDER_CONFIG, GY_SYSTEM_ORDER_CONFIG, JST_SYSTEM_ORDER_CONFIG, updateWlnGoodsHandle, updateWdtGoodsHandle, updateBsE3GoodsHandle, updateGyGoodsHandle, updateJstGoodsHandle, updateKmGoodsHandle, jstMergeIdenticalGoods, msgTypeCh, pushGyLog } from '@kmkf-fe-packages/kmkf-utils';
|
|
7
7
|
import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, uniqBy, cloneDeep, difference, differenceWith, isBoolean, isEqual, takeRight, reject, isEmpty, intersection } from 'lodash';
|
|
8
8
|
import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
|
|
9
9
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
@@ -13607,6 +13607,7 @@ var getTableData$2 = function getTableData(_ref, formData) {
|
|
|
13607
13607
|
var current = _ref.current,
|
|
13608
13608
|
pageSize = _ref.pageSize;
|
|
13609
13609
|
var data = {
|
|
13610
|
+
goodShortName: formData.goodShortName || null,
|
|
13610
13611
|
goodNo: formData.goodNo || null,
|
|
13611
13612
|
goodName: formData.goodName || null,
|
|
13612
13613
|
skuCode: formData.skuCode || null,
|
|
@@ -15808,7 +15809,7 @@ var getColumns$5 = function getColumns() {
|
|
|
15808
15809
|
ellipsis: true,
|
|
15809
15810
|
align: 'center',
|
|
15810
15811
|
render: function render(val, record, index) {
|
|
15811
|
-
return (record.qty || 0) * (+record.salePrice || 0);
|
|
15812
|
+
return ((record.qty || 0) * (+record.salePrice || 0)).toFixed(2);
|
|
15812
15813
|
}
|
|
15813
15814
|
}, {
|
|
15814
15815
|
dataIndex: 'batchId',
|
|
@@ -16084,7 +16085,7 @@ var getColumns$5 = function getColumns() {
|
|
|
16084
16085
|
dataIndex: 'saleAmount',
|
|
16085
16086
|
title: '总金额',
|
|
16086
16087
|
render: function render(val, record) {
|
|
16087
|
-
return (record.qty || 0) * (+record.salePrice || 0);
|
|
16088
|
+
return ((record.qty || 0) * (+record.salePrice || 0)).toFixed(2);
|
|
16088
16089
|
}
|
|
16089
16090
|
}, {
|
|
16090
16091
|
dataIndex: 'batchId',
|
|
@@ -16193,7 +16194,7 @@ var getColumns$5 = function getColumns() {
|
|
|
16193
16194
|
dataIndex: 'saleAmount',
|
|
16194
16195
|
title: '总金额',
|
|
16195
16196
|
render: function render(val, record) {
|
|
16196
|
-
return (record.qty || 0) * (+record.salePrice || 0);
|
|
16197
|
+
return ((record.qty || 0) * (+record.salePrice || 0)).toFixed(2);
|
|
16197
16198
|
}
|
|
16198
16199
|
}, {
|
|
16199
16200
|
dataIndex: 'isGift',
|
|
@@ -17003,6 +17004,14 @@ var GoodsModalMap = {
|
|
|
17003
17004
|
KM_REISSUE_GOODS: KmGoodsModal,
|
|
17004
17005
|
OTHER_GOODS: GoodsModal$2
|
|
17005
17006
|
};
|
|
17007
|
+
var systemOrderNoMap = {
|
|
17008
|
+
GY_GOODS: 'code',
|
|
17009
|
+
KM_GOODS: 'sid',
|
|
17010
|
+
WDT_GOODS: 'tradeNo',
|
|
17011
|
+
BS_E3_GOODS: 'orderSn',
|
|
17012
|
+
JST_GOODS: 'oId',
|
|
17013
|
+
WLN_GOODS: 'tradeNo'
|
|
17014
|
+
};
|
|
17006
17015
|
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
17007
17016
|
var columns = _ref.columns,
|
|
17008
17017
|
dataSource = _ref.dataSource,
|
|
@@ -17010,35 +17019,59 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17010
17019
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
17011
17020
|
onChangeSelectedKeys = _ref.onChangeSelectedKeys,
|
|
17012
17021
|
_ref$uniqueKey = _ref.uniqueKey,
|
|
17013
|
-
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey
|
|
17014
|
-
|
|
17022
|
+
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey,
|
|
17023
|
+
_ref$isGoods = _ref.isGoods,
|
|
17024
|
+
isGoods = _ref$isGoods === void 0 ? false : _ref$isGoods,
|
|
17025
|
+
_ref$systemOrders = _ref.systemOrders,
|
|
17026
|
+
systemOrders = _ref$systemOrders === void 0 ? [] : _ref$systemOrders,
|
|
17027
|
+
_ref$selectedSystemOr = _ref.selectedSystemOrders,
|
|
17028
|
+
selectedSystemOrders = _ref$selectedSystemOr === void 0 ? [] : _ref$selectedSystemOr,
|
|
17029
|
+
_ref$type = _ref.type,
|
|
17030
|
+
type = _ref$type === void 0 ? '' : _ref$type,
|
|
17031
|
+
width = _ref.width;
|
|
17032
|
+
var _useState = useState(),
|
|
17015
17033
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17016
|
-
|
|
17017
|
-
|
|
17034
|
+
selectSystemNo = _useState2[0],
|
|
17035
|
+
setSelectSystemNo = _useState2[1];
|
|
17036
|
+
var _useState3 = useState(false),
|
|
17037
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17038
|
+
tradeGoodsVisible = _useState4[0],
|
|
17039
|
+
setTradeGoodsVisible = _useState4[1];
|
|
17018
17040
|
var openModal = function openModal() {
|
|
17019
|
-
if (getDataSourceAsync) {
|
|
17041
|
+
if (getDataSourceAsync && !(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length)) {
|
|
17020
17042
|
getDataSourceAsync().then(function () {
|
|
17021
17043
|
setTradeGoodsVisible(true);
|
|
17022
17044
|
});
|
|
17023
17045
|
} else {
|
|
17024
17046
|
setTradeGoodsVisible(true);
|
|
17025
17047
|
}
|
|
17048
|
+
if (isGoods) {
|
|
17049
|
+
var codeList = selectedSystemOrders === null || selectedSystemOrders === void 0 ? void 0 : selectedSystemOrders.map(function (item) {
|
|
17050
|
+
return item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]];
|
|
17051
|
+
});
|
|
17052
|
+
setSelectSystemNo(codeList || []);
|
|
17053
|
+
}
|
|
17026
17054
|
};
|
|
17027
17055
|
var closeModal = function closeModal() {
|
|
17028
17056
|
return setTradeGoodsVisible(false);
|
|
17029
17057
|
};
|
|
17030
|
-
var
|
|
17058
|
+
var filterDataSource = useMemo(function () {
|
|
17059
|
+
return (selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.length) ? dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (item) {
|
|
17060
|
+
return selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.includes(item.systemOrderNo);
|
|
17061
|
+
}) : dataSource;
|
|
17062
|
+
}, [dataSource, selectSystemNo]);
|
|
17063
|
+
var currentTradeOriginGoods = intersection(filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17031
17064
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17032
17065
|
}), selectedRowKeys);
|
|
17033
|
-
var unCurrentTradeOriginGoods = difference(selectedRowKeys,
|
|
17066
|
+
var unCurrentTradeOriginGoods = difference(selectedRowKeys, filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17034
17067
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17035
17068
|
}));
|
|
17036
17069
|
var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
|
|
17037
|
-
// console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
|
|
17038
17070
|
onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
|
|
17039
17071
|
};
|
|
17040
17072
|
var rowSelection = {
|
|
17041
17073
|
selectedRowKeys: selectedRowKeys,
|
|
17074
|
+
fixed: true,
|
|
17042
17075
|
onChange: handleChangeSelectedKeys
|
|
17043
17076
|
};
|
|
17044
17077
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -17048,18 +17081,41 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17048
17081
|
title: "\u8BA2\u5355\u5546\u54C1",
|
|
17049
17082
|
visible: tradeGoodsVisible,
|
|
17050
17083
|
footer: null,
|
|
17051
|
-
onCancel: closeModal
|
|
17052
|
-
|
|
17084
|
+
onCancel: closeModal,
|
|
17085
|
+
width: width || 850
|
|
17086
|
+
}, isGoods && /*#__PURE__*/React.createElement(Row, {
|
|
17087
|
+
style: {
|
|
17088
|
+
marginBottom: '20px'
|
|
17089
|
+
}
|
|
17090
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
17091
|
+
span: 12
|
|
17092
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
17093
|
+
placeholder: "\u7B5B\u9009\u7CFB\u7EDF\u8BA2\u5355\u5546\u54C1",
|
|
17094
|
+
style: {
|
|
17095
|
+
width: '100%'
|
|
17096
|
+
},
|
|
17097
|
+
mode: "multiple",
|
|
17098
|
+
value: selectSystemNo,
|
|
17099
|
+
onChange: function onChange(val) {
|
|
17100
|
+
return setSelectSystemNo(val);
|
|
17101
|
+
},
|
|
17102
|
+
options: systemOrders === null || systemOrders === void 0 ? void 0 : systemOrders.map(function (item) {
|
|
17103
|
+
return {
|
|
17104
|
+
label: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]],
|
|
17105
|
+
value: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]]
|
|
17106
|
+
};
|
|
17107
|
+
})
|
|
17108
|
+
}))), /*#__PURE__*/React.createElement(Table, {
|
|
17053
17109
|
rowKey: uniqueKey,
|
|
17054
17110
|
rowSelection: rowSelection,
|
|
17055
17111
|
columns: columns,
|
|
17056
|
-
dataSource:
|
|
17112
|
+
dataSource: filterDataSource,
|
|
17057
17113
|
pagination: false,
|
|
17058
17114
|
scroll: {
|
|
17059
17115
|
x: 500,
|
|
17060
17116
|
y: 500
|
|
17061
17117
|
}
|
|
17062
|
-
}), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/",
|
|
17118
|
+
}), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/", filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.length, ")")));
|
|
17063
17119
|
};
|
|
17064
17120
|
var getButtonText = function getButtonText() {
|
|
17065
17121
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -17069,7 +17125,7 @@ var getButtonText = function getButtonText() {
|
|
|
17069
17125
|
if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
17070
17126
|
return '选择百胜ERP商品';
|
|
17071
17127
|
}
|
|
17072
|
-
if (['WDT_REISSUE_GOODS'].includes(type)) {
|
|
17128
|
+
if (['WDT_GOODS', 'WDT_REISSUE_GOODS'].includes(type)) {
|
|
17073
17129
|
return '选择旺店通商品';
|
|
17074
17130
|
}
|
|
17075
17131
|
if (['GY_GOODS', 'GY_REISSUE_GOODS', 'GY_RETURN_GOODS'].includes(type)) {
|
|
@@ -17120,11 +17176,15 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17120
17176
|
onDelete = props.onDelete,
|
|
17121
17177
|
onModeChange = props.onModeChange,
|
|
17122
17178
|
tradeGoods = props.tradeGoods,
|
|
17123
|
-
form = props.form
|
|
17179
|
+
form = props.form,
|
|
17180
|
+
systemOrders = props.systemOrders,
|
|
17181
|
+
selectedSystemOrders = props.selectedSystemOrders;
|
|
17124
17182
|
var uniqueKey = (tradeGoods === null || tradeGoods === void 0 ? void 0 : tradeGoods.uniqueKey) || 'uuid';
|
|
17125
17183
|
// 监听聚水潭退货商品
|
|
17126
17184
|
var jstReturnGoods = Form === null || Form === void 0 ? void 0 : Form.useWatch('3979edfd6d', form);
|
|
17127
17185
|
var isShowSelectTradeGoods = type !== 'JST_EXCHANGE_GOODS' || (jstReturnGoods === null || jstReturnGoods === void 0 ? void 0 : jstReturnGoods.jstSystemOrderNo);
|
|
17186
|
+
// 判断是否为商品信息组件
|
|
17187
|
+
var isGoods = type && ['WDT_GOODS', 'BS_E3_GOODS', 'GY_GOODS', 'JST_GOODS', 'WLN_GOODS', 'KM_GOODS'].includes(type) || false;
|
|
17128
17188
|
var refModal = useRef();
|
|
17129
17189
|
console.debug('表格数据', value);
|
|
17130
17190
|
var handleDelete = function handleDelete(record, index) {
|
|
@@ -17134,14 +17194,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17134
17194
|
});
|
|
17135
17195
|
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
|
|
17136
17196
|
};
|
|
17137
|
-
var
|
|
17138
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
17139
|
-
selectedRowKeys = _useState4[0],
|
|
17140
|
-
setSelectedRowKeys = _useState4[1];
|
|
17141
|
-
var _useState5 = useState(null),
|
|
17197
|
+
var _useState5 = useState([]),
|
|
17142
17198
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
17143
|
-
|
|
17144
|
-
|
|
17199
|
+
selectedRowKeys = _useState6[0],
|
|
17200
|
+
setSelectedRowKeys = _useState6[1];
|
|
17201
|
+
var _useState7 = useState(null),
|
|
17202
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
17203
|
+
hoveredRowIndex = _useState8[0],
|
|
17204
|
+
setHoveredRowIndex = _useState8[1];
|
|
17145
17205
|
useEffect(function () {
|
|
17146
17206
|
setSelectedRowKeys([]);
|
|
17147
17207
|
}, [tableSelect, selectType]);
|
|
@@ -17370,12 +17430,17 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17370
17430
|
checked: isStrict,
|
|
17371
17431
|
onChange: handleCheckboxChange
|
|
17372
17432
|
}, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !isEmpty(tradeGoods) && isShowSelectTradeGoods && /*#__PURE__*/React.createElement(SelectTradeGoods, {
|
|
17433
|
+
isGoods: isGoods,
|
|
17373
17434
|
uniqueKey: uniqueKey,
|
|
17435
|
+
type: type,
|
|
17374
17436
|
columns: orderColumns,
|
|
17375
17437
|
dataSource: tradeGoods.originDataSource,
|
|
17376
17438
|
getDataSourceAsync: tradeGoods.getDataSourceAsync,
|
|
17377
17439
|
selectedRowKeys: selectedGoods,
|
|
17378
|
-
onChangeSelectedKeys: tradeGoods.selectedGoodsChange
|
|
17440
|
+
onChangeSelectedKeys: tradeGoods.selectedGoodsChange,
|
|
17441
|
+
systemOrders: systemOrders,
|
|
17442
|
+
selectedSystemOrders: selectedSystemOrders,
|
|
17443
|
+
width: width
|
|
17379
17444
|
}), showErpGoodsBtn && /*#__PURE__*/React.createElement(Button, {
|
|
17380
17445
|
type: "link",
|
|
17381
17446
|
onClick: handleChangeGoods
|
|
@@ -18226,7 +18291,7 @@ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
|
|
|
18226
18291
|
extendRequest('/qy/gdfw/order/wlnOrderList', {
|
|
18227
18292
|
method: 'post',
|
|
18228
18293
|
data: {
|
|
18229
|
-
|
|
18294
|
+
billCode: orderNo
|
|
18230
18295
|
}
|
|
18231
18296
|
}).then(function (data) {
|
|
18232
18297
|
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
@@ -18658,6 +18723,85 @@ var index$3 = (function (props) {
|
|
|
18658
18723
|
}));
|
|
18659
18724
|
});
|
|
18660
18725
|
|
|
18726
|
+
var isErpType$1 = {
|
|
18727
|
+
isWdt: function isWdt(type) {
|
|
18728
|
+
return ['WDT_GOODS'].includes(type);
|
|
18729
|
+
},
|
|
18730
|
+
isBsE3: function isBsE3(type) {
|
|
18731
|
+
return ['BS_E3_GOODS'].includes(type);
|
|
18732
|
+
},
|
|
18733
|
+
isGy: function isGy(type) {
|
|
18734
|
+
return ['GY_GOODS'].includes(type);
|
|
18735
|
+
},
|
|
18736
|
+
isWln: function isWln(type) {
|
|
18737
|
+
return ['WLN_GOODS'].includes(type);
|
|
18738
|
+
}
|
|
18739
|
+
};
|
|
18740
|
+
var processAllOrders = function processAllOrders(_ref) {
|
|
18741
|
+
var data = _ref.data,
|
|
18742
|
+
orderNo = _ref.orderNo,
|
|
18743
|
+
type = _ref.type;
|
|
18744
|
+
var newList = [];
|
|
18745
|
+
// 根据商品类型处理数据
|
|
18746
|
+
if (isErpType$1.isWdt(type)) {
|
|
18747
|
+
newList = processWdtOrders({
|
|
18748
|
+
data: data,
|
|
18749
|
+
orderNo: orderNo
|
|
18750
|
+
});
|
|
18751
|
+
} else if (isErpType$1.isBsE3(type)) {
|
|
18752
|
+
newList = processBsE3Orders({
|
|
18753
|
+
data: data,
|
|
18754
|
+
orderNo: orderNo
|
|
18755
|
+
});
|
|
18756
|
+
} else if (isErpType$1.isGy(type)) {
|
|
18757
|
+
newList = processGyOrders({
|
|
18758
|
+
data: data,
|
|
18759
|
+
orderNo: orderNo
|
|
18760
|
+
});
|
|
18761
|
+
} else if (isErpType$1.isWln(type)) {
|
|
18762
|
+
newList = processWlnOrders({
|
|
18763
|
+
data: data
|
|
18764
|
+
});
|
|
18765
|
+
} else {
|
|
18766
|
+
newList = processDefaultOrders({
|
|
18767
|
+
data: data
|
|
18768
|
+
});
|
|
18769
|
+
}
|
|
18770
|
+
return newList;
|
|
18771
|
+
};
|
|
18772
|
+
var processWdtOrders = function processWdtOrders(_ref2) {
|
|
18773
|
+
var data = _ref2.data,
|
|
18774
|
+
orderNo = _ref2.orderNo;
|
|
18775
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18776
|
+
return (item.srcTid || '').split(',').includes(orderNo);
|
|
18777
|
+
});
|
|
18778
|
+
return trades;
|
|
18779
|
+
};
|
|
18780
|
+
var processBsE3Orders = function processBsE3Orders(_ref3) {
|
|
18781
|
+
var data = _ref3.data,
|
|
18782
|
+
orderNo = _ref3.orderNo;
|
|
18783
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
|
|
18784
|
+
return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
|
|
18785
|
+
});
|
|
18786
|
+
return trades;
|
|
18787
|
+
};
|
|
18788
|
+
var processGyOrders = function processGyOrders(_ref4) {
|
|
18789
|
+
var data = _ref4.data,
|
|
18790
|
+
orderNo = _ref4.orderNo;
|
|
18791
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18792
|
+
return getIsPlatformCodesIncludeOrderNos(item.platformCode, orderNo);
|
|
18793
|
+
});
|
|
18794
|
+
return trades;
|
|
18795
|
+
};
|
|
18796
|
+
var processWlnOrders = function processWlnOrders(_ref5) {
|
|
18797
|
+
var data = _ref5.data;
|
|
18798
|
+
return (data === null || data === void 0 ? void 0 : data.orders) || [];
|
|
18799
|
+
};
|
|
18800
|
+
var processDefaultOrders = function processDefaultOrders(_ref6) {
|
|
18801
|
+
var data = _ref6.data;
|
|
18802
|
+
return data || [];
|
|
18803
|
+
};
|
|
18804
|
+
|
|
18661
18805
|
var WlnGoods = function WlnGoods(props) {
|
|
18662
18806
|
var value = props.value,
|
|
18663
18807
|
disabled = props.disabled,
|
|
@@ -18667,15 +18811,53 @@ var WlnGoods = function WlnGoods(props) {
|
|
|
18667
18811
|
wlnGoods: list
|
|
18668
18812
|
}));
|
|
18669
18813
|
};
|
|
18814
|
+
// 找到该订单号下所有商品
|
|
18815
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails() {
|
|
18816
|
+
var goodDetails = updateWlnGoodsHandle((value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
18817
|
+
return goodDetails;
|
|
18818
|
+
};
|
|
18819
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
18820
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
18821
|
+
return (value === null || value === void 0 ? void 0 : value.orderNo) ? wlnUtils === null || wlnUtils === void 0 ? void 0 : wlnUtils.getOrderListSingleton(value === null || value === void 0 ? void 0 : value.orderNo).then(function (data) {
|
|
18822
|
+
var list = processAllOrders({
|
|
18823
|
+
data: data,
|
|
18824
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
18825
|
+
type: 'WLN_GOODS'
|
|
18826
|
+
});
|
|
18827
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
18828
|
+
allOrders: list || []
|
|
18829
|
+
}));
|
|
18830
|
+
}) : Promise.resolve();
|
|
18831
|
+
};
|
|
18832
|
+
var selectedGoodsChange = useCallback(function (skuList) {
|
|
18833
|
+
var _uniqBy;
|
|
18834
|
+
var newValue = _objectSpread2({}, value);
|
|
18835
|
+
// 原订单商品
|
|
18836
|
+
var originTradeGoodList = getAllTradeGoodsDetails() || [];
|
|
18837
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
18838
|
+
var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value.wlnGoods) || [];
|
|
18839
|
+
newValue['wlnGoods'] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
18840
|
+
return skuList.includes(item.uuid);
|
|
18841
|
+
});
|
|
18842
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
18843
|
+
}, [value === null || value === void 0 ? void 0 : value.wlnGoods]);
|
|
18670
18844
|
return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18671
18845
|
key: 'wlnGoods'
|
|
18672
18846
|
}, props), {}, {
|
|
18673
18847
|
disabled: disabled,
|
|
18674
18848
|
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
18675
18849
|
value: value === null || value === void 0 ? void 0 : value.wlnGoods,
|
|
18676
|
-
showChangeBtn:
|
|
18850
|
+
showChangeBtn: true,
|
|
18851
|
+
showErpGoodsBtn: false,
|
|
18677
18852
|
onChange: function onChange(val) {
|
|
18678
18853
|
return changeHandle(val);
|
|
18854
|
+
},
|
|
18855
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
18856
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
18857
|
+
tradeGoods: {
|
|
18858
|
+
originDataSource: getAllTradeGoodsDetails(),
|
|
18859
|
+
selectedGoodsChange: selectedGoodsChange,
|
|
18860
|
+
getDataSourceAsync: getDataSourceAsync
|
|
18679
18861
|
}
|
|
18680
18862
|
}));
|
|
18681
18863
|
};
|
|
@@ -18704,7 +18886,8 @@ var componentMap$1 = {
|
|
|
18704
18886
|
deleteGood: 'wdtDeleteGood',
|
|
18705
18887
|
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
18706
18888
|
exchangeDeleteGood: 'wdtExchangeDeleteGood'
|
|
18707
|
-
}
|
|
18889
|
+
},
|
|
18890
|
+
getOrderList: wdtUtils.getWdtOrderListSingleton
|
|
18708
18891
|
},
|
|
18709
18892
|
BS_E3_GOODS: {
|
|
18710
18893
|
type: 'e3',
|
|
@@ -18729,7 +18912,8 @@ var componentMap$1 = {
|
|
|
18729
18912
|
deleteGood: 'bsE3DeleteGood',
|
|
18730
18913
|
returnDeleteGood: 'bsE3ReturnDeleteGood',
|
|
18731
18914
|
exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
|
|
18732
|
-
}
|
|
18915
|
+
},
|
|
18916
|
+
getOrderList: bsE3Utils.getBsE3OrderListSingleton
|
|
18733
18917
|
},
|
|
18734
18918
|
GY_GOODS: {
|
|
18735
18919
|
type: 'gy',
|
|
@@ -18754,7 +18938,8 @@ var componentMap$1 = {
|
|
|
18754
18938
|
deleteGood: 'gyDeleteGood',
|
|
18755
18939
|
returnDeleteGood: 'gyReturnDeleteGood',
|
|
18756
18940
|
exchangeDeleteGood: 'gyExchangeDeleteGood'
|
|
18757
|
-
}
|
|
18941
|
+
},
|
|
18942
|
+
getOrderList: gyUtils.getGyOrderListSingleton
|
|
18758
18943
|
},
|
|
18759
18944
|
JST_GOODS: {
|
|
18760
18945
|
type: 'jst',
|
|
@@ -18779,7 +18964,8 @@ var componentMap$1 = {
|
|
|
18779
18964
|
deleteGood: 'jstDeleteGood',
|
|
18780
18965
|
returnDeleteGood: 'jstReturnDeleteGood',
|
|
18781
18966
|
exchangeDeleteGood: 'jstExchangeDeleteGood'
|
|
18782
|
-
}
|
|
18967
|
+
},
|
|
18968
|
+
getOrderList: jstUtils.getJstOrderListSingleton
|
|
18783
18969
|
},
|
|
18784
18970
|
KM_GOODS: {
|
|
18785
18971
|
type: 'km',
|
|
@@ -18804,11 +18990,12 @@ var componentMap$1 = {
|
|
|
18804
18990
|
deleteGood: 'kmDeleteGood',
|
|
18805
18991
|
returnDeleteGood: 'kmReturnDeleteGood',
|
|
18806
18992
|
exchangeDeleteGood: 'kmExchangeDeleteGood'
|
|
18807
|
-
}
|
|
18993
|
+
},
|
|
18994
|
+
getOrderList: kmUtils.getOrderListSingleton
|
|
18808
18995
|
}
|
|
18809
18996
|
};
|
|
18810
18997
|
var CommonGoods = function CommonGoods(props) {
|
|
18811
|
-
var _withInfo$current3, _withInfo$current4;
|
|
18998
|
+
var _componentMap$compTyp5, _withInfo$current3, _withInfo$current4;
|
|
18812
18999
|
var value = props.value,
|
|
18813
19000
|
disabled = props.disabled,
|
|
18814
19001
|
onChange = props.onChange,
|
|
@@ -18910,7 +19097,6 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18910
19097
|
});
|
|
18911
19098
|
}
|
|
18912
19099
|
}), pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
18913
|
-
// console.log(data);
|
|
18914
19100
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
18915
19101
|
shopCode: data.shopCode
|
|
18916
19102
|
}));
|
|
@@ -18966,15 +19152,58 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18966
19152
|
var getGoodDetails = function getGoodDetails(_ref2) {
|
|
18967
19153
|
var mode = _ref2.mode;
|
|
18968
19154
|
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
18969
|
-
var goodDetails = updateHandle(value.orders || [], {
|
|
19155
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.orders) || [], {
|
|
18970
19156
|
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
18971
19157
|
});
|
|
18972
|
-
var orderNo = value.orderNo;
|
|
19158
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
18973
19159
|
return mode ? goodDetails.filter(function (goodItem) {
|
|
18974
19160
|
var _componentMap$compTyp;
|
|
18975
19161
|
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;
|
|
18976
19162
|
}) : goodDetails;
|
|
18977
19163
|
};
|
|
19164
|
+
// 找到该订单号下所有商品
|
|
19165
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails(_ref3) {
|
|
19166
|
+
var mode = _ref3.mode;
|
|
19167
|
+
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
19168
|
+
console.log('value?.allOrders', value, (value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
19169
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
|
|
19170
|
+
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
19171
|
+
});
|
|
19172
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
19173
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
19174
|
+
var _componentMap$compTyp2;
|
|
19175
|
+
return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp2 = componentMap$1[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.goodDetailOrderNo]) === orderNo;
|
|
19176
|
+
}) : goodDetails;
|
|
19177
|
+
};
|
|
19178
|
+
var selectedGoodsChange = useCallback(function (skuList) {
|
|
19179
|
+
var _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
|
|
19180
|
+
var newValue = _objectSpread2({}, value);
|
|
19181
|
+
var isStrict = value.isStrict;
|
|
19182
|
+
// 原订单商品
|
|
19183
|
+
var originTradeGoodList = getAllTradeGoodsDetails({
|
|
19184
|
+
mode: isStrict
|
|
19185
|
+
}) || [];
|
|
19186
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
19187
|
+
var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(componentMap$1 === null || componentMap$1 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$1[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.key)]) || [];
|
|
19188
|
+
newValue["".concat(componentMap$1 === null || componentMap$1 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$1[compType]) === null || _componentMap$compTyp4 === void 0 ? void 0 : _componentMap$compTyp4.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
19189
|
+
return skuList.includes(item.uuid);
|
|
19190
|
+
});
|
|
19191
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
19192
|
+
}, [value === null || value === void 0 ? void 0 : value["".concat(componentMap$1 === null || componentMap$1 === void 0 ? void 0 : (_componentMap$compTyp5 = componentMap$1[compType]) === null || _componentMap$compTyp5 === void 0 ? void 0 : _componentMap$compTyp5.key)], value === null || value === void 0 ? void 0 : value.isStrict]);
|
|
19193
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
19194
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
19195
|
+
var _componentMap$compTyp6;
|
|
19196
|
+
return (value === null || value === void 0 ? void 0 : value.orderNo) ? (_componentMap$compTyp6 = componentMap$1[compType]) === null || _componentMap$compTyp6 === void 0 ? void 0 : _componentMap$compTyp6.getOrderList(value === null || value === void 0 ? void 0 : value.orderNo).then(function (data) {
|
|
19197
|
+
var list = processAllOrders({
|
|
19198
|
+
data: data,
|
|
19199
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
19200
|
+
type: compType
|
|
19201
|
+
});
|
|
19202
|
+
onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
19203
|
+
allOrders: list || []
|
|
19204
|
+
}));
|
|
19205
|
+
}) : Promise.resolve();
|
|
19206
|
+
};
|
|
18978
19207
|
return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18979
19208
|
key: componentMap$1[compType].key
|
|
18980
19209
|
}, props), {}, {
|
|
@@ -18994,7 +19223,16 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18994
19223
|
},
|
|
18995
19224
|
onModeChange: handleModeChange,
|
|
18996
19225
|
showModeBtn: showModeBtn,
|
|
18997
|
-
isStrict: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19226
|
+
isStrict: value === null || value === void 0 ? void 0 : value.isStrict,
|
|
19227
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
19228
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
19229
|
+
tradeGoods: {
|
|
19230
|
+
originDataSource: getAllTradeGoodsDetails({
|
|
19231
|
+
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19232
|
+
}),
|
|
19233
|
+
getDataSourceAsync: getDataSourceAsync,
|
|
19234
|
+
selectedGoodsChange: selectedGoodsChange
|
|
19235
|
+
}
|
|
18998
19236
|
}));
|
|
18999
19237
|
};
|
|
19000
19238
|
|
|
@@ -20664,7 +20902,7 @@ var MsgStatus = function MsgStatus(props) {
|
|
|
20664
20902
|
onClick: function onClick() {
|
|
20665
20903
|
return setChangeIndex(index);
|
|
20666
20904
|
}
|
|
20667
|
-
}, msgTypeCh[key], item.ruleName);
|
|
20905
|
+
}, msgTypeCh[key] || key, item.ruleName);
|
|
20668
20906
|
}))) : null, type === 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
20669
20907
|
showSearch: true,
|
|
20670
20908
|
value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
|
|
@@ -21209,6 +21447,7 @@ var GyReissue = function GyReissue(props) {
|
|
|
21209
21447
|
sysOrderNo: val
|
|
21210
21448
|
});
|
|
21211
21449
|
}
|
|
21450
|
+
valueRef.current = newValue;
|
|
21212
21451
|
pushGyLog('afterChangeSystemOrder', newValue);
|
|
21213
21452
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
21214
21453
|
};
|
|
@@ -21270,7 +21509,7 @@ var GyReissue = function GyReissue(props) {
|
|
|
21270
21509
|
span: 12
|
|
21271
21510
|
},
|
|
21272
21511
|
sm: {
|
|
21273
|
-
span:
|
|
21512
|
+
span: 4
|
|
21274
21513
|
}
|
|
21275
21514
|
}, /*#__PURE__*/React.createElement(Cascader, {
|
|
21276
21515
|
style: {
|
|
@@ -21565,7 +21804,7 @@ var GyReturnGoods = function GyReturnGoods(props) {
|
|
|
21565
21804
|
span: 12
|
|
21566
21805
|
},
|
|
21567
21806
|
sm: {
|
|
21568
|
-
span:
|
|
21807
|
+
span: 4
|
|
21569
21808
|
}
|
|
21570
21809
|
}, /*#__PURE__*/React.createElement(Cascader, {
|
|
21571
21810
|
style: {
|
package/dist/index.js
CHANGED
|
@@ -13619,6 +13619,7 @@ var getTableData$2 = function getTableData(_ref, formData) {
|
|
|
13619
13619
|
var current = _ref.current,
|
|
13620
13620
|
pageSize = _ref.pageSize;
|
|
13621
13621
|
var data = {
|
|
13622
|
+
goodShortName: formData.goodShortName || null,
|
|
13622
13623
|
goodNo: formData.goodNo || null,
|
|
13623
13624
|
goodName: formData.goodName || null,
|
|
13624
13625
|
skuCode: formData.skuCode || null,
|
|
@@ -15820,7 +15821,7 @@ var getColumns$5 = function getColumns() {
|
|
|
15820
15821
|
ellipsis: true,
|
|
15821
15822
|
align: 'center',
|
|
15822
15823
|
render: function render(val, record, index) {
|
|
15823
|
-
return (record.qty || 0) * (+record.salePrice || 0);
|
|
15824
|
+
return ((record.qty || 0) * (+record.salePrice || 0)).toFixed(2);
|
|
15824
15825
|
}
|
|
15825
15826
|
}, {
|
|
15826
15827
|
dataIndex: 'batchId',
|
|
@@ -16096,7 +16097,7 @@ var getColumns$5 = function getColumns() {
|
|
|
16096
16097
|
dataIndex: 'saleAmount',
|
|
16097
16098
|
title: '总金额',
|
|
16098
16099
|
render: function render(val, record) {
|
|
16099
|
-
return (record.qty || 0) * (+record.salePrice || 0);
|
|
16100
|
+
return ((record.qty || 0) * (+record.salePrice || 0)).toFixed(2);
|
|
16100
16101
|
}
|
|
16101
16102
|
}, {
|
|
16102
16103
|
dataIndex: 'batchId',
|
|
@@ -16205,7 +16206,7 @@ var getColumns$5 = function getColumns() {
|
|
|
16205
16206
|
dataIndex: 'saleAmount',
|
|
16206
16207
|
title: '总金额',
|
|
16207
16208
|
render: function render(val, record) {
|
|
16208
|
-
return (record.qty || 0) * (+record.salePrice || 0);
|
|
16209
|
+
return ((record.qty || 0) * (+record.salePrice || 0)).toFixed(2);
|
|
16209
16210
|
}
|
|
16210
16211
|
}, {
|
|
16211
16212
|
dataIndex: 'isGift',
|
|
@@ -17015,6 +17016,14 @@ var GoodsModalMap = {
|
|
|
17015
17016
|
KM_REISSUE_GOODS: KmGoodsModal,
|
|
17016
17017
|
OTHER_GOODS: GoodsModal$2
|
|
17017
17018
|
};
|
|
17019
|
+
var systemOrderNoMap = {
|
|
17020
|
+
GY_GOODS: 'code',
|
|
17021
|
+
KM_GOODS: 'sid',
|
|
17022
|
+
WDT_GOODS: 'tradeNo',
|
|
17023
|
+
BS_E3_GOODS: 'orderSn',
|
|
17024
|
+
JST_GOODS: 'oId',
|
|
17025
|
+
WLN_GOODS: 'tradeNo'
|
|
17026
|
+
};
|
|
17018
17027
|
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
17019
17028
|
var columns = _ref.columns,
|
|
17020
17029
|
dataSource = _ref.dataSource,
|
|
@@ -17022,35 +17031,59 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17022
17031
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
17023
17032
|
onChangeSelectedKeys = _ref.onChangeSelectedKeys,
|
|
17024
17033
|
_ref$uniqueKey = _ref.uniqueKey,
|
|
17025
|
-
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey
|
|
17026
|
-
|
|
17034
|
+
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey,
|
|
17035
|
+
_ref$isGoods = _ref.isGoods,
|
|
17036
|
+
isGoods = _ref$isGoods === void 0 ? false : _ref$isGoods,
|
|
17037
|
+
_ref$systemOrders = _ref.systemOrders,
|
|
17038
|
+
systemOrders = _ref$systemOrders === void 0 ? [] : _ref$systemOrders,
|
|
17039
|
+
_ref$selectedSystemOr = _ref.selectedSystemOrders,
|
|
17040
|
+
selectedSystemOrders = _ref$selectedSystemOr === void 0 ? [] : _ref$selectedSystemOr,
|
|
17041
|
+
_ref$type = _ref.type,
|
|
17042
|
+
type = _ref$type === void 0 ? '' : _ref$type,
|
|
17043
|
+
width = _ref.width;
|
|
17044
|
+
var _useState = React.useState(),
|
|
17027
17045
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17028
|
-
|
|
17029
|
-
|
|
17046
|
+
selectSystemNo = _useState2[0],
|
|
17047
|
+
setSelectSystemNo = _useState2[1];
|
|
17048
|
+
var _useState3 = React.useState(false),
|
|
17049
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17050
|
+
tradeGoodsVisible = _useState4[0],
|
|
17051
|
+
setTradeGoodsVisible = _useState4[1];
|
|
17030
17052
|
var openModal = function openModal() {
|
|
17031
|
-
if (getDataSourceAsync) {
|
|
17053
|
+
if (getDataSourceAsync && !(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length)) {
|
|
17032
17054
|
getDataSourceAsync().then(function () {
|
|
17033
17055
|
setTradeGoodsVisible(true);
|
|
17034
17056
|
});
|
|
17035
17057
|
} else {
|
|
17036
17058
|
setTradeGoodsVisible(true);
|
|
17037
17059
|
}
|
|
17060
|
+
if (isGoods) {
|
|
17061
|
+
var codeList = selectedSystemOrders === null || selectedSystemOrders === void 0 ? void 0 : selectedSystemOrders.map(function (item) {
|
|
17062
|
+
return item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]];
|
|
17063
|
+
});
|
|
17064
|
+
setSelectSystemNo(codeList || []);
|
|
17065
|
+
}
|
|
17038
17066
|
};
|
|
17039
17067
|
var closeModal = function closeModal() {
|
|
17040
17068
|
return setTradeGoodsVisible(false);
|
|
17041
17069
|
};
|
|
17042
|
-
var
|
|
17070
|
+
var filterDataSource = React.useMemo(function () {
|
|
17071
|
+
return (selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.length) ? dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (item) {
|
|
17072
|
+
return selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.includes(item.systemOrderNo);
|
|
17073
|
+
}) : dataSource;
|
|
17074
|
+
}, [dataSource, selectSystemNo]);
|
|
17075
|
+
var currentTradeOriginGoods = lodash.intersection(filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17043
17076
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17044
17077
|
}), selectedRowKeys);
|
|
17045
|
-
var unCurrentTradeOriginGoods = lodash.difference(selectedRowKeys,
|
|
17078
|
+
var unCurrentTradeOriginGoods = lodash.difference(selectedRowKeys, filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17046
17079
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17047
17080
|
}));
|
|
17048
17081
|
var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
|
|
17049
|
-
// console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
|
|
17050
17082
|
onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
|
|
17051
17083
|
};
|
|
17052
17084
|
var rowSelection = {
|
|
17053
17085
|
selectedRowKeys: selectedRowKeys,
|
|
17086
|
+
fixed: true,
|
|
17054
17087
|
onChange: handleChangeSelectedKeys
|
|
17055
17088
|
};
|
|
17056
17089
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
@@ -17060,18 +17093,41 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17060
17093
|
title: "\u8BA2\u5355\u5546\u54C1",
|
|
17061
17094
|
visible: tradeGoodsVisible,
|
|
17062
17095
|
footer: null,
|
|
17063
|
-
onCancel: closeModal
|
|
17064
|
-
|
|
17096
|
+
onCancel: closeModal,
|
|
17097
|
+
width: width || 850
|
|
17098
|
+
}, isGoods && /*#__PURE__*/React__default['default'].createElement(antd.Row, {
|
|
17099
|
+
style: {
|
|
17100
|
+
marginBottom: '20px'
|
|
17101
|
+
}
|
|
17102
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
|
|
17103
|
+
span: 12
|
|
17104
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
17105
|
+
placeholder: "\u7B5B\u9009\u7CFB\u7EDF\u8BA2\u5355\u5546\u54C1",
|
|
17106
|
+
style: {
|
|
17107
|
+
width: '100%'
|
|
17108
|
+
},
|
|
17109
|
+
mode: "multiple",
|
|
17110
|
+
value: selectSystemNo,
|
|
17111
|
+
onChange: function onChange(val) {
|
|
17112
|
+
return setSelectSystemNo(val);
|
|
17113
|
+
},
|
|
17114
|
+
options: systemOrders === null || systemOrders === void 0 ? void 0 : systemOrders.map(function (item) {
|
|
17115
|
+
return {
|
|
17116
|
+
label: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]],
|
|
17117
|
+
value: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]]
|
|
17118
|
+
};
|
|
17119
|
+
})
|
|
17120
|
+
}))), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
17065
17121
|
rowKey: uniqueKey,
|
|
17066
17122
|
rowSelection: rowSelection,
|
|
17067
17123
|
columns: columns,
|
|
17068
|
-
dataSource:
|
|
17124
|
+
dataSource: filterDataSource,
|
|
17069
17125
|
pagination: false,
|
|
17070
17126
|
scroll: {
|
|
17071
17127
|
x: 500,
|
|
17072
17128
|
y: 500
|
|
17073
17129
|
}
|
|
17074
|
-
}), /*#__PURE__*/React__default['default'].createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/",
|
|
17130
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/", filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.length, ")")));
|
|
17075
17131
|
};
|
|
17076
17132
|
var getButtonText = function getButtonText() {
|
|
17077
17133
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -17081,7 +17137,7 @@ var getButtonText = function getButtonText() {
|
|
|
17081
17137
|
if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
17082
17138
|
return '选择百胜ERP商品';
|
|
17083
17139
|
}
|
|
17084
|
-
if (['WDT_REISSUE_GOODS'].includes(type)) {
|
|
17140
|
+
if (['WDT_GOODS', 'WDT_REISSUE_GOODS'].includes(type)) {
|
|
17085
17141
|
return '选择旺店通商品';
|
|
17086
17142
|
}
|
|
17087
17143
|
if (['GY_GOODS', 'GY_REISSUE_GOODS', 'GY_RETURN_GOODS'].includes(type)) {
|
|
@@ -17132,11 +17188,15 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17132
17188
|
onDelete = props.onDelete,
|
|
17133
17189
|
onModeChange = props.onModeChange,
|
|
17134
17190
|
tradeGoods = props.tradeGoods,
|
|
17135
|
-
form = props.form
|
|
17191
|
+
form = props.form,
|
|
17192
|
+
systemOrders = props.systemOrders,
|
|
17193
|
+
selectedSystemOrders = props.selectedSystemOrders;
|
|
17136
17194
|
var uniqueKey = (tradeGoods === null || tradeGoods === void 0 ? void 0 : tradeGoods.uniqueKey) || 'uuid';
|
|
17137
17195
|
// 监听聚水潭退货商品
|
|
17138
17196
|
var jstReturnGoods = antd.Form === null || antd.Form === void 0 ? void 0 : antd.Form.useWatch('3979edfd6d', form);
|
|
17139
17197
|
var isShowSelectTradeGoods = type !== 'JST_EXCHANGE_GOODS' || (jstReturnGoods === null || jstReturnGoods === void 0 ? void 0 : jstReturnGoods.jstSystemOrderNo);
|
|
17198
|
+
// 判断是否为商品信息组件
|
|
17199
|
+
var isGoods = type && ['WDT_GOODS', 'BS_E3_GOODS', 'GY_GOODS', 'JST_GOODS', 'WLN_GOODS', 'KM_GOODS'].includes(type) || false;
|
|
17140
17200
|
var refModal = React.useRef();
|
|
17141
17201
|
console.debug('表格数据', value);
|
|
17142
17202
|
var handleDelete = function handleDelete(record, index) {
|
|
@@ -17146,14 +17206,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17146
17206
|
});
|
|
17147
17207
|
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
|
|
17148
17208
|
};
|
|
17149
|
-
var
|
|
17150
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
17151
|
-
selectedRowKeys = _useState4[0],
|
|
17152
|
-
setSelectedRowKeys = _useState4[1];
|
|
17153
|
-
var _useState5 = React.useState(null),
|
|
17209
|
+
var _useState5 = React.useState([]),
|
|
17154
17210
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
17155
|
-
|
|
17156
|
-
|
|
17211
|
+
selectedRowKeys = _useState6[0],
|
|
17212
|
+
setSelectedRowKeys = _useState6[1];
|
|
17213
|
+
var _useState7 = React.useState(null),
|
|
17214
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
17215
|
+
hoveredRowIndex = _useState8[0],
|
|
17216
|
+
setHoveredRowIndex = _useState8[1];
|
|
17157
17217
|
React.useEffect(function () {
|
|
17158
17218
|
setSelectedRowKeys([]);
|
|
17159
17219
|
}, [tableSelect, selectType]);
|
|
@@ -17382,12 +17442,17 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17382
17442
|
checked: isStrict,
|
|
17383
17443
|
onChange: handleCheckboxChange
|
|
17384
17444
|
}, "\u5408\u5E76\u5355\uFF0C\u52FE\u9009\u540E\u53EA\u5C55\u793A\u5F53\u524D\u5E73\u53F0\u8BA2\u5355\u5546\u54C1"), !lodash.isEmpty(tradeGoods) && isShowSelectTradeGoods && /*#__PURE__*/React__default['default'].createElement(SelectTradeGoods, {
|
|
17445
|
+
isGoods: isGoods,
|
|
17385
17446
|
uniqueKey: uniqueKey,
|
|
17447
|
+
type: type,
|
|
17386
17448
|
columns: orderColumns,
|
|
17387
17449
|
dataSource: tradeGoods.originDataSource,
|
|
17388
17450
|
getDataSourceAsync: tradeGoods.getDataSourceAsync,
|
|
17389
17451
|
selectedRowKeys: selectedGoods,
|
|
17390
|
-
onChangeSelectedKeys: tradeGoods.selectedGoodsChange
|
|
17452
|
+
onChangeSelectedKeys: tradeGoods.selectedGoodsChange,
|
|
17453
|
+
systemOrders: systemOrders,
|
|
17454
|
+
selectedSystemOrders: selectedSystemOrders,
|
|
17455
|
+
width: width
|
|
17391
17456
|
}), showErpGoodsBtn && /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
17392
17457
|
type: "link",
|
|
17393
17458
|
onClick: handleChangeGoods
|
|
@@ -18238,7 +18303,7 @@ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
|
|
|
18238
18303
|
extendRequest('/qy/gdfw/order/wlnOrderList', {
|
|
18239
18304
|
method: 'post',
|
|
18240
18305
|
data: {
|
|
18241
|
-
|
|
18306
|
+
billCode: orderNo
|
|
18242
18307
|
}
|
|
18243
18308
|
}).then(function (data) {
|
|
18244
18309
|
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
@@ -18670,6 +18735,85 @@ var index$3 = (function (props) {
|
|
|
18670
18735
|
}));
|
|
18671
18736
|
});
|
|
18672
18737
|
|
|
18738
|
+
var isErpType$1 = {
|
|
18739
|
+
isWdt: function isWdt(type) {
|
|
18740
|
+
return ['WDT_GOODS'].includes(type);
|
|
18741
|
+
},
|
|
18742
|
+
isBsE3: function isBsE3(type) {
|
|
18743
|
+
return ['BS_E3_GOODS'].includes(type);
|
|
18744
|
+
},
|
|
18745
|
+
isGy: function isGy(type) {
|
|
18746
|
+
return ['GY_GOODS'].includes(type);
|
|
18747
|
+
},
|
|
18748
|
+
isWln: function isWln(type) {
|
|
18749
|
+
return ['WLN_GOODS'].includes(type);
|
|
18750
|
+
}
|
|
18751
|
+
};
|
|
18752
|
+
var processAllOrders = function processAllOrders(_ref) {
|
|
18753
|
+
var data = _ref.data,
|
|
18754
|
+
orderNo = _ref.orderNo,
|
|
18755
|
+
type = _ref.type;
|
|
18756
|
+
var newList = [];
|
|
18757
|
+
// 根据商品类型处理数据
|
|
18758
|
+
if (isErpType$1.isWdt(type)) {
|
|
18759
|
+
newList = processWdtOrders({
|
|
18760
|
+
data: data,
|
|
18761
|
+
orderNo: orderNo
|
|
18762
|
+
});
|
|
18763
|
+
} else if (isErpType$1.isBsE3(type)) {
|
|
18764
|
+
newList = processBsE3Orders({
|
|
18765
|
+
data: data,
|
|
18766
|
+
orderNo: orderNo
|
|
18767
|
+
});
|
|
18768
|
+
} else if (isErpType$1.isGy(type)) {
|
|
18769
|
+
newList = processGyOrders({
|
|
18770
|
+
data: data,
|
|
18771
|
+
orderNo: orderNo
|
|
18772
|
+
});
|
|
18773
|
+
} else if (isErpType$1.isWln(type)) {
|
|
18774
|
+
newList = processWlnOrders({
|
|
18775
|
+
data: data
|
|
18776
|
+
});
|
|
18777
|
+
} else {
|
|
18778
|
+
newList = processDefaultOrders({
|
|
18779
|
+
data: data
|
|
18780
|
+
});
|
|
18781
|
+
}
|
|
18782
|
+
return newList;
|
|
18783
|
+
};
|
|
18784
|
+
var processWdtOrders = function processWdtOrders(_ref2) {
|
|
18785
|
+
var data = _ref2.data,
|
|
18786
|
+
orderNo = _ref2.orderNo;
|
|
18787
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18788
|
+
return (item.srcTid || '').split(',').includes(orderNo);
|
|
18789
|
+
});
|
|
18790
|
+
return trades;
|
|
18791
|
+
};
|
|
18792
|
+
var processBsE3Orders = function processBsE3Orders(_ref3) {
|
|
18793
|
+
var data = _ref3.data,
|
|
18794
|
+
orderNo = _ref3.orderNo;
|
|
18795
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
|
|
18796
|
+
return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
|
|
18797
|
+
});
|
|
18798
|
+
return trades;
|
|
18799
|
+
};
|
|
18800
|
+
var processGyOrders = function processGyOrders(_ref4) {
|
|
18801
|
+
var data = _ref4.data,
|
|
18802
|
+
orderNo = _ref4.orderNo;
|
|
18803
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18804
|
+
return kmkfUtils.getIsPlatformCodesIncludeOrderNos(item.platformCode, orderNo);
|
|
18805
|
+
});
|
|
18806
|
+
return trades;
|
|
18807
|
+
};
|
|
18808
|
+
var processWlnOrders = function processWlnOrders(_ref5) {
|
|
18809
|
+
var data = _ref5.data;
|
|
18810
|
+
return (data === null || data === void 0 ? void 0 : data.orders) || [];
|
|
18811
|
+
};
|
|
18812
|
+
var processDefaultOrders = function processDefaultOrders(_ref6) {
|
|
18813
|
+
var data = _ref6.data;
|
|
18814
|
+
return data || [];
|
|
18815
|
+
};
|
|
18816
|
+
|
|
18673
18817
|
var WlnGoods = function WlnGoods(props) {
|
|
18674
18818
|
var value = props.value,
|
|
18675
18819
|
disabled = props.disabled,
|
|
@@ -18679,15 +18823,53 @@ var WlnGoods = function WlnGoods(props) {
|
|
|
18679
18823
|
wlnGoods: list
|
|
18680
18824
|
}));
|
|
18681
18825
|
};
|
|
18826
|
+
// 找到该订单号下所有商品
|
|
18827
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails() {
|
|
18828
|
+
var goodDetails = kmkfUtils.updateWlnGoodsHandle((value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
18829
|
+
return goodDetails;
|
|
18830
|
+
};
|
|
18831
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
18832
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
18833
|
+
return (value === null || value === void 0 ? void 0 : value.orderNo) ? wlnUtils === null || wlnUtils === void 0 ? void 0 : wlnUtils.getOrderListSingleton(value === null || value === void 0 ? void 0 : value.orderNo).then(function (data) {
|
|
18834
|
+
var list = processAllOrders({
|
|
18835
|
+
data: data,
|
|
18836
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
18837
|
+
type: 'WLN_GOODS'
|
|
18838
|
+
});
|
|
18839
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
18840
|
+
allOrders: list || []
|
|
18841
|
+
}));
|
|
18842
|
+
}) : Promise.resolve();
|
|
18843
|
+
};
|
|
18844
|
+
var selectedGoodsChange = React.useCallback(function (skuList) {
|
|
18845
|
+
var _uniqBy;
|
|
18846
|
+
var newValue = _objectSpread2({}, value);
|
|
18847
|
+
// 原订单商品
|
|
18848
|
+
var originTradeGoodList = getAllTradeGoodsDetails() || [];
|
|
18849
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
18850
|
+
var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value.wlnGoods) || [];
|
|
18851
|
+
newValue['wlnGoods'] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
18852
|
+
return skuList.includes(item.uuid);
|
|
18853
|
+
});
|
|
18854
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
18855
|
+
}, [value === null || value === void 0 ? void 0 : value.wlnGoods]);
|
|
18682
18856
|
return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18683
18857
|
key: 'wlnGoods'
|
|
18684
18858
|
}, props), {}, {
|
|
18685
18859
|
disabled: disabled,
|
|
18686
18860
|
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
18687
18861
|
value: value === null || value === void 0 ? void 0 : value.wlnGoods,
|
|
18688
|
-
showChangeBtn:
|
|
18862
|
+
showChangeBtn: true,
|
|
18863
|
+
showErpGoodsBtn: false,
|
|
18689
18864
|
onChange: function onChange(val) {
|
|
18690
18865
|
return changeHandle(val);
|
|
18866
|
+
},
|
|
18867
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
18868
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
18869
|
+
tradeGoods: {
|
|
18870
|
+
originDataSource: getAllTradeGoodsDetails(),
|
|
18871
|
+
selectedGoodsChange: selectedGoodsChange,
|
|
18872
|
+
getDataSourceAsync: getDataSourceAsync
|
|
18691
18873
|
}
|
|
18692
18874
|
}));
|
|
18693
18875
|
};
|
|
@@ -18716,7 +18898,8 @@ var componentMap$1 = {
|
|
|
18716
18898
|
deleteGood: 'wdtDeleteGood',
|
|
18717
18899
|
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
18718
18900
|
exchangeDeleteGood: 'wdtExchangeDeleteGood'
|
|
18719
|
-
}
|
|
18901
|
+
},
|
|
18902
|
+
getOrderList: wdtUtils.getWdtOrderListSingleton
|
|
18720
18903
|
},
|
|
18721
18904
|
BS_E3_GOODS: {
|
|
18722
18905
|
type: 'e3',
|
|
@@ -18741,7 +18924,8 @@ var componentMap$1 = {
|
|
|
18741
18924
|
deleteGood: 'bsE3DeleteGood',
|
|
18742
18925
|
returnDeleteGood: 'bsE3ReturnDeleteGood',
|
|
18743
18926
|
exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
|
|
18744
|
-
}
|
|
18927
|
+
},
|
|
18928
|
+
getOrderList: bsE3Utils.getBsE3OrderListSingleton
|
|
18745
18929
|
},
|
|
18746
18930
|
GY_GOODS: {
|
|
18747
18931
|
type: 'gy',
|
|
@@ -18766,7 +18950,8 @@ var componentMap$1 = {
|
|
|
18766
18950
|
deleteGood: 'gyDeleteGood',
|
|
18767
18951
|
returnDeleteGood: 'gyReturnDeleteGood',
|
|
18768
18952
|
exchangeDeleteGood: 'gyExchangeDeleteGood'
|
|
18769
|
-
}
|
|
18953
|
+
},
|
|
18954
|
+
getOrderList: gyUtils.getGyOrderListSingleton
|
|
18770
18955
|
},
|
|
18771
18956
|
JST_GOODS: {
|
|
18772
18957
|
type: 'jst',
|
|
@@ -18791,7 +18976,8 @@ var componentMap$1 = {
|
|
|
18791
18976
|
deleteGood: 'jstDeleteGood',
|
|
18792
18977
|
returnDeleteGood: 'jstReturnDeleteGood',
|
|
18793
18978
|
exchangeDeleteGood: 'jstExchangeDeleteGood'
|
|
18794
|
-
}
|
|
18979
|
+
},
|
|
18980
|
+
getOrderList: jstUtils.getJstOrderListSingleton
|
|
18795
18981
|
},
|
|
18796
18982
|
KM_GOODS: {
|
|
18797
18983
|
type: 'km',
|
|
@@ -18816,11 +19002,12 @@ var componentMap$1 = {
|
|
|
18816
19002
|
deleteGood: 'kmDeleteGood',
|
|
18817
19003
|
returnDeleteGood: 'kmReturnDeleteGood',
|
|
18818
19004
|
exchangeDeleteGood: 'kmExchangeDeleteGood'
|
|
18819
|
-
}
|
|
19005
|
+
},
|
|
19006
|
+
getOrderList: kmUtils.getOrderListSingleton
|
|
18820
19007
|
}
|
|
18821
19008
|
};
|
|
18822
19009
|
var CommonGoods = function CommonGoods(props) {
|
|
18823
|
-
var _withInfo$current3, _withInfo$current4;
|
|
19010
|
+
var _componentMap$compTyp5, _withInfo$current3, _withInfo$current4;
|
|
18824
19011
|
var value = props.value,
|
|
18825
19012
|
disabled = props.disabled,
|
|
18826
19013
|
onChange = props.onChange,
|
|
@@ -18922,7 +19109,6 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18922
19109
|
});
|
|
18923
19110
|
}
|
|
18924
19111
|
}), pubsub__default['default'].subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
18925
|
-
// console.log(data);
|
|
18926
19112
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
18927
19113
|
shopCode: data.shopCode
|
|
18928
19114
|
}));
|
|
@@ -18978,15 +19164,58 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18978
19164
|
var getGoodDetails = function getGoodDetails(_ref2) {
|
|
18979
19165
|
var mode = _ref2.mode;
|
|
18980
19166
|
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
18981
|
-
var goodDetails = updateHandle(value.orders || [], {
|
|
19167
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.orders) || [], {
|
|
18982
19168
|
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
18983
19169
|
});
|
|
18984
|
-
var orderNo = value.orderNo;
|
|
19170
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
18985
19171
|
return mode ? goodDetails.filter(function (goodItem) {
|
|
18986
19172
|
var _componentMap$compTyp;
|
|
18987
19173
|
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;
|
|
18988
19174
|
}) : goodDetails;
|
|
18989
19175
|
};
|
|
19176
|
+
// 找到该订单号下所有商品
|
|
19177
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails(_ref3) {
|
|
19178
|
+
var mode = _ref3.mode;
|
|
19179
|
+
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
19180
|
+
console.log('value?.allOrders', value, (value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
19181
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
|
|
19182
|
+
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
19183
|
+
});
|
|
19184
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
19185
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
19186
|
+
var _componentMap$compTyp2;
|
|
19187
|
+
return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp2 = componentMap$1[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.goodDetailOrderNo]) === orderNo;
|
|
19188
|
+
}) : goodDetails;
|
|
19189
|
+
};
|
|
19190
|
+
var selectedGoodsChange = React.useCallback(function (skuList) {
|
|
19191
|
+
var _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
|
|
19192
|
+
var newValue = _objectSpread2({}, value);
|
|
19193
|
+
var isStrict = value.isStrict;
|
|
19194
|
+
// 原订单商品
|
|
19195
|
+
var originTradeGoodList = getAllTradeGoodsDetails({
|
|
19196
|
+
mode: isStrict
|
|
19197
|
+
}) || [];
|
|
19198
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
19199
|
+
var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(componentMap$1 === null || componentMap$1 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$1[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.key)]) || [];
|
|
19200
|
+
newValue["".concat(componentMap$1 === null || componentMap$1 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$1[compType]) === null || _componentMap$compTyp4 === void 0 ? void 0 : _componentMap$compTyp4.key)] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
19201
|
+
return skuList.includes(item.uuid);
|
|
19202
|
+
});
|
|
19203
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
19204
|
+
}, [value === null || value === void 0 ? void 0 : value["".concat(componentMap$1 === null || componentMap$1 === void 0 ? void 0 : (_componentMap$compTyp5 = componentMap$1[compType]) === null || _componentMap$compTyp5 === void 0 ? void 0 : _componentMap$compTyp5.key)], value === null || value === void 0 ? void 0 : value.isStrict]);
|
|
19205
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
19206
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
19207
|
+
var _componentMap$compTyp6;
|
|
19208
|
+
return (value === null || value === void 0 ? void 0 : value.orderNo) ? (_componentMap$compTyp6 = componentMap$1[compType]) === null || _componentMap$compTyp6 === void 0 ? void 0 : _componentMap$compTyp6.getOrderList(value === null || value === void 0 ? void 0 : value.orderNo).then(function (data) {
|
|
19209
|
+
var list = processAllOrders({
|
|
19210
|
+
data: data,
|
|
19211
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
19212
|
+
type: compType
|
|
19213
|
+
});
|
|
19214
|
+
onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
19215
|
+
allOrders: list || []
|
|
19216
|
+
}));
|
|
19217
|
+
}) : Promise.resolve();
|
|
19218
|
+
};
|
|
18990
19219
|
return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18991
19220
|
key: componentMap$1[compType].key
|
|
18992
19221
|
}, props), {}, {
|
|
@@ -19006,7 +19235,16 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
19006
19235
|
},
|
|
19007
19236
|
onModeChange: handleModeChange,
|
|
19008
19237
|
showModeBtn: showModeBtn,
|
|
19009
|
-
isStrict: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19238
|
+
isStrict: value === null || value === void 0 ? void 0 : value.isStrict,
|
|
19239
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
19240
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
19241
|
+
tradeGoods: {
|
|
19242
|
+
originDataSource: getAllTradeGoodsDetails({
|
|
19243
|
+
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19244
|
+
}),
|
|
19245
|
+
getDataSourceAsync: getDataSourceAsync,
|
|
19246
|
+
selectedGoodsChange: selectedGoodsChange
|
|
19247
|
+
}
|
|
19010
19248
|
}));
|
|
19011
19249
|
};
|
|
19012
19250
|
|
|
@@ -20676,7 +20914,7 @@ var MsgStatus = function MsgStatus(props) {
|
|
|
20676
20914
|
onClick: function onClick() {
|
|
20677
20915
|
return setChangeIndex(index);
|
|
20678
20916
|
}
|
|
20679
|
-
}, kmkfUtils.msgTypeCh[key], item.ruleName);
|
|
20917
|
+
}, kmkfUtils.msgTypeCh[key] || key, item.ruleName);
|
|
20680
20918
|
}))) : null, type === 1 ? /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Select, _objectSpread2(_objectSpread2({}, other), {}, {
|
|
20681
20919
|
showSearch: true,
|
|
20682
20920
|
value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
|
|
@@ -21221,6 +21459,7 @@ var GyReissue = function GyReissue(props) {
|
|
|
21221
21459
|
sysOrderNo: val
|
|
21222
21460
|
});
|
|
21223
21461
|
}
|
|
21462
|
+
valueRef.current = newValue;
|
|
21224
21463
|
kmkfUtils.pushGyLog('afterChangeSystemOrder', newValue);
|
|
21225
21464
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
21226
21465
|
};
|
|
@@ -21282,7 +21521,7 @@ var GyReissue = function GyReissue(props) {
|
|
|
21282
21521
|
span: 12
|
|
21283
21522
|
},
|
|
21284
21523
|
sm: {
|
|
21285
|
-
span:
|
|
21524
|
+
span: 4
|
|
21286
21525
|
}
|
|
21287
21526
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
21288
21527
|
style: {
|
|
@@ -21577,7 +21816,7 @@ var GyReturnGoods = function GyReturnGoods(props) {
|
|
|
21577
21816
|
span: 12
|
|
21578
21817
|
},
|
|
21579
21818
|
sm: {
|
|
21580
|
-
span:
|
|
21819
|
+
span: 4
|
|
21581
21820
|
}
|
|
21582
21821
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
21583
21822
|
style: {
|
|
@@ -36,6 +36,8 @@ interface BsGoodsProps {
|
|
|
36
36
|
getDataSourceAsync?: () => Promise<any>;
|
|
37
37
|
selectedGoodsChange: (p: React.Key[]) => void;
|
|
38
38
|
};
|
|
39
|
+
systemOrders?: any[];
|
|
40
|
+
selectedSystemOrders?: any[];
|
|
39
41
|
}
|
|
40
42
|
declare const GoodItem: (props: Partial<BsGoodsProps>) => React.JSX.Element;
|
|
41
43
|
export default GoodItem;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.79-beta.10",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/kmkf-utils": "2.0.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "2.0.79-beta.10",
|
|
24
24
|
"ahooks": "^3.7.4",
|
|
25
25
|
"bignumber.js": "^9.1.2",
|
|
26
26
|
"kmkf-monitor": "^0.8.9",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "980a2ddae0f585d26e66c541a14b6b2bccd34e5e"
|
|
69
69
|
}
|