@kmkf-fe-packages/basic-components 2.0.79-beta.2 → 2.0.79-beta.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js
CHANGED
|
@@ -3,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';
|
|
@@ -14781,6 +14781,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14781
14781
|
val: text
|
|
14782
14782
|
});
|
|
14783
14783
|
}
|
|
14784
|
+
}, {
|
|
14785
|
+
dataIndex: 'apiGoodsName',
|
|
14786
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
14787
|
+
width: 200,
|
|
14788
|
+
align: 'center'
|
|
14789
|
+
}, {
|
|
14790
|
+
dataIndex: 'platformGoodsId',
|
|
14791
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
14792
|
+
width: 180,
|
|
14793
|
+
align: 'center'
|
|
14784
14794
|
}, {
|
|
14785
14795
|
dataIndex: 'specId',
|
|
14786
14796
|
title: "SKUID",
|
|
@@ -14803,6 +14813,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14803
14813
|
val: text
|
|
14804
14814
|
});
|
|
14805
14815
|
}
|
|
14816
|
+
}, {
|
|
14817
|
+
dataIndex: 'apiSpecName',
|
|
14818
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
14819
|
+
width: 200,
|
|
14820
|
+
align: 'center'
|
|
14821
|
+
}, {
|
|
14822
|
+
dataIndex: 'platformSpecId',
|
|
14823
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
14824
|
+
width: 180,
|
|
14825
|
+
align: 'center'
|
|
14806
14826
|
}, {
|
|
14807
14827
|
dataIndex: 'orderPrice',
|
|
14808
14828
|
title: "\u6210\u4EA4\u603B\u91D1\u989D",
|
|
@@ -14847,6 +14867,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14847
14867
|
val: text
|
|
14848
14868
|
});
|
|
14849
14869
|
}
|
|
14870
|
+
}, {
|
|
14871
|
+
dataIndex: 'apiGoodsName',
|
|
14872
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
14873
|
+
width: 200,
|
|
14874
|
+
align: 'center'
|
|
14875
|
+
}, {
|
|
14876
|
+
dataIndex: 'platformGoodsId',
|
|
14877
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
14878
|
+
width: 180,
|
|
14879
|
+
align: 'center'
|
|
14850
14880
|
}, {
|
|
14851
14881
|
dataIndex: 'specId',
|
|
14852
14882
|
title: "".concat(text, "SKUID"),
|
|
@@ -14869,6 +14899,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14869
14899
|
val: text
|
|
14870
14900
|
});
|
|
14871
14901
|
}
|
|
14902
|
+
}, {
|
|
14903
|
+
dataIndex: 'apiSpecName',
|
|
14904
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
14905
|
+
width: 200,
|
|
14906
|
+
align: 'center'
|
|
14907
|
+
}, {
|
|
14908
|
+
dataIndex: 'platformSpecId',
|
|
14909
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
14910
|
+
width: 180,
|
|
14911
|
+
align: 'center'
|
|
14872
14912
|
}, {
|
|
14873
14913
|
dataIndex: 'orderPrice',
|
|
14874
14914
|
title: "\u6210\u4EA4\u603B\u91D1\u989D",
|
|
@@ -14934,6 +14974,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14934
14974
|
val: text
|
|
14935
14975
|
});
|
|
14936
14976
|
}
|
|
14977
|
+
}, {
|
|
14978
|
+
dataIndex: 'apiGoodsName',
|
|
14979
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
14980
|
+
width: 200,
|
|
14981
|
+
align: 'center'
|
|
14982
|
+
}, {
|
|
14983
|
+
dataIndex: 'platformGoodsId',
|
|
14984
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
14985
|
+
width: 180,
|
|
14986
|
+
align: 'center'
|
|
14937
14987
|
}, {
|
|
14938
14988
|
dataIndex: 'specId',
|
|
14939
14989
|
title: "".concat(text, "SKUID"),
|
|
@@ -14956,6 +15006,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14956
15006
|
val: text
|
|
14957
15007
|
});
|
|
14958
15008
|
}
|
|
15009
|
+
}, {
|
|
15010
|
+
dataIndex: 'apiSpecName',
|
|
15011
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
15012
|
+
width: 200,
|
|
15013
|
+
align: 'center'
|
|
15014
|
+
}, {
|
|
15015
|
+
dataIndex: 'platformSpecId',
|
|
15016
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
15017
|
+
width: 180,
|
|
15018
|
+
align: 'center'
|
|
14959
15019
|
}, {
|
|
14960
15020
|
dataIndex: 'num',
|
|
14961
15021
|
title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
|
|
@@ -15059,6 +15119,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
15059
15119
|
val: text
|
|
15060
15120
|
});
|
|
15061
15121
|
}
|
|
15122
|
+
}, {
|
|
15123
|
+
dataIndex: 'apiGoodsName',
|
|
15124
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
15125
|
+
width: 200,
|
|
15126
|
+
align: 'center'
|
|
15127
|
+
}, {
|
|
15128
|
+
dataIndex: 'platformGoodsId',
|
|
15129
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
15130
|
+
width: 180,
|
|
15131
|
+
align: 'center'
|
|
15062
15132
|
}, {
|
|
15063
15133
|
dataIndex: 'specId',
|
|
15064
15134
|
title: "".concat(text, "SKUID"),
|
|
@@ -15081,6 +15151,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
15081
15151
|
val: text
|
|
15082
15152
|
});
|
|
15083
15153
|
}
|
|
15154
|
+
}, {
|
|
15155
|
+
dataIndex: 'apiSpecName',
|
|
15156
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
15157
|
+
width: 200,
|
|
15158
|
+
align: 'center'
|
|
15159
|
+
}, {
|
|
15160
|
+
dataIndex: 'platformSpecId',
|
|
15161
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
15162
|
+
width: 180,
|
|
15163
|
+
align: 'center'
|
|
15084
15164
|
}, {
|
|
15085
15165
|
dataIndex: 'num',
|
|
15086
15166
|
title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
|
|
@@ -17004,6 +17084,14 @@ var GoodsModalMap = {
|
|
|
17004
17084
|
KM_REISSUE_GOODS: KmGoodsModal,
|
|
17005
17085
|
OTHER_GOODS: GoodsModal$2
|
|
17006
17086
|
};
|
|
17087
|
+
var systemOrderNoMap = {
|
|
17088
|
+
GY_GOODS: 'code',
|
|
17089
|
+
KM_GOODS: 'sid',
|
|
17090
|
+
WDT_GOODS: 'tradeNo',
|
|
17091
|
+
BS_E3_GOODS: 'orderSn',
|
|
17092
|
+
JST_GOODS: 'oId',
|
|
17093
|
+
WLN_GOODS: 'tradeNo'
|
|
17094
|
+
};
|
|
17007
17095
|
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
17008
17096
|
var columns = _ref.columns,
|
|
17009
17097
|
dataSource = _ref.dataSource,
|
|
@@ -17011,35 +17099,60 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17011
17099
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
17012
17100
|
onChangeSelectedKeys = _ref.onChangeSelectedKeys,
|
|
17013
17101
|
_ref$uniqueKey = _ref.uniqueKey,
|
|
17014
|
-
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey
|
|
17015
|
-
|
|
17102
|
+
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey,
|
|
17103
|
+
_ref$isGoods = _ref.isGoods,
|
|
17104
|
+
isGoods = _ref$isGoods === void 0 ? false : _ref$isGoods,
|
|
17105
|
+
_ref$systemOrders = _ref.systemOrders,
|
|
17106
|
+
systemOrders = _ref$systemOrders === void 0 ? [] : _ref$systemOrders,
|
|
17107
|
+
_ref$selectedSystemOr = _ref.selectedSystemOrders,
|
|
17108
|
+
_ref$type = _ref.type,
|
|
17109
|
+
type = _ref$type === void 0 ? '' : _ref$type,
|
|
17110
|
+
width = _ref.width;
|
|
17111
|
+
var _useState = useState(),
|
|
17016
17112
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17017
|
-
|
|
17018
|
-
|
|
17113
|
+
selectSystemNo = _useState2[0],
|
|
17114
|
+
setSelectSystemNo = _useState2[1];
|
|
17115
|
+
var _useState3 = useState(false),
|
|
17116
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17117
|
+
tradeGoodsVisible = _useState4[0],
|
|
17118
|
+
setTradeGoodsVisible = _useState4[1];
|
|
17019
17119
|
var openModal = function openModal() {
|
|
17020
|
-
if (getDataSourceAsync) {
|
|
17120
|
+
if (getDataSourceAsync && !(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length)) {
|
|
17021
17121
|
getDataSourceAsync().then(function () {
|
|
17022
17122
|
setTradeGoodsVisible(true);
|
|
17023
17123
|
});
|
|
17024
17124
|
} else {
|
|
17025
17125
|
setTradeGoodsVisible(true);
|
|
17026
17126
|
}
|
|
17127
|
+
// 暂时先去掉带入系统自订单组件所选值作为默认筛选项
|
|
17128
|
+
// if (isGoods) {
|
|
17129
|
+
// const codeList: string[] = selectedSystemOrders?.map(
|
|
17130
|
+
// (item) => item?.[systemOrderNoMap?.[type]],
|
|
17131
|
+
// );
|
|
17132
|
+
// setSelectSystemNo(codeList || []);
|
|
17133
|
+
// }
|
|
17027
17134
|
};
|
|
17135
|
+
|
|
17028
17136
|
var closeModal = function closeModal() {
|
|
17029
17137
|
return setTradeGoodsVisible(false);
|
|
17030
17138
|
};
|
|
17031
|
-
var
|
|
17139
|
+
var filterDataSource = useMemo(function () {
|
|
17140
|
+
return (selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.length) ? dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (item) {
|
|
17141
|
+
return selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.includes(item.systemOrderNo);
|
|
17142
|
+
}) : dataSource;
|
|
17143
|
+
}, [dataSource, selectSystemNo]);
|
|
17144
|
+
var currentTradeOriginGoods = intersection(filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17032
17145
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17033
17146
|
}), selectedRowKeys);
|
|
17034
|
-
var unCurrentTradeOriginGoods = difference(selectedRowKeys,
|
|
17147
|
+
var unCurrentTradeOriginGoods = difference(selectedRowKeys, filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17035
17148
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17036
17149
|
}));
|
|
17037
17150
|
var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
|
|
17038
|
-
// console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
|
|
17039
17151
|
onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
|
|
17040
17152
|
};
|
|
17041
17153
|
var rowSelection = {
|
|
17042
17154
|
selectedRowKeys: selectedRowKeys,
|
|
17155
|
+
fixed: true,
|
|
17043
17156
|
onChange: handleChangeSelectedKeys
|
|
17044
17157
|
};
|
|
17045
17158
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
@@ -17049,18 +17162,44 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17049
17162
|
title: "\u8BA2\u5355\u5546\u54C1",
|
|
17050
17163
|
visible: tradeGoodsVisible,
|
|
17051
17164
|
footer: null,
|
|
17052
|
-
onCancel: closeModal
|
|
17053
|
-
|
|
17165
|
+
onCancel: closeModal,
|
|
17166
|
+
width: width || 850,
|
|
17167
|
+
style: {
|
|
17168
|
+
maxWidth: '1000px'
|
|
17169
|
+
}
|
|
17170
|
+
}, isGoods && /*#__PURE__*/React.createElement(Row, {
|
|
17171
|
+
style: {
|
|
17172
|
+
marginBottom: '20px'
|
|
17173
|
+
}
|
|
17174
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
17175
|
+
span: 12
|
|
17176
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
17177
|
+
placeholder: "\u7B5B\u9009\u7CFB\u7EDF\u8BA2\u5355\u5546\u54C1",
|
|
17178
|
+
style: {
|
|
17179
|
+
width: '100%'
|
|
17180
|
+
},
|
|
17181
|
+
mode: "multiple",
|
|
17182
|
+
value: selectSystemNo,
|
|
17183
|
+
onChange: function onChange(val) {
|
|
17184
|
+
return setSelectSystemNo(val);
|
|
17185
|
+
},
|
|
17186
|
+
options: systemOrders === null || systemOrders === void 0 ? void 0 : systemOrders.map(function (item) {
|
|
17187
|
+
return {
|
|
17188
|
+
label: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]],
|
|
17189
|
+
value: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]]
|
|
17190
|
+
};
|
|
17191
|
+
})
|
|
17192
|
+
}))), /*#__PURE__*/React.createElement(Table, {
|
|
17054
17193
|
rowKey: uniqueKey,
|
|
17055
17194
|
rowSelection: rowSelection,
|
|
17056
17195
|
columns: columns,
|
|
17057
|
-
dataSource:
|
|
17196
|
+
dataSource: filterDataSource,
|
|
17058
17197
|
pagination: false,
|
|
17059
17198
|
scroll: {
|
|
17060
17199
|
x: 500,
|
|
17061
17200
|
y: 500
|
|
17062
17201
|
}
|
|
17063
|
-
}), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/",
|
|
17202
|
+
}), /*#__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, ")")));
|
|
17064
17203
|
};
|
|
17065
17204
|
var getButtonText = function getButtonText() {
|
|
17066
17205
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -17070,7 +17209,7 @@ var getButtonText = function getButtonText() {
|
|
|
17070
17209
|
if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
17071
17210
|
return '选择百胜ERP商品';
|
|
17072
17211
|
}
|
|
17073
|
-
if (['WDT_REISSUE_GOODS'].includes(type)) {
|
|
17212
|
+
if (['WDT_GOODS', 'WDT_REISSUE_GOODS'].includes(type)) {
|
|
17074
17213
|
return '选择旺店通商品';
|
|
17075
17214
|
}
|
|
17076
17215
|
if (['GY_GOODS', 'GY_REISSUE_GOODS', 'GY_RETURN_GOODS'].includes(type)) {
|
|
@@ -17121,11 +17260,15 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17121
17260
|
onDelete = props.onDelete,
|
|
17122
17261
|
onModeChange = props.onModeChange,
|
|
17123
17262
|
tradeGoods = props.tradeGoods,
|
|
17124
|
-
form = props.form
|
|
17263
|
+
form = props.form,
|
|
17264
|
+
systemOrders = props.systemOrders,
|
|
17265
|
+
selectedSystemOrders = props.selectedSystemOrders;
|
|
17125
17266
|
var uniqueKey = (tradeGoods === null || tradeGoods === void 0 ? void 0 : tradeGoods.uniqueKey) || 'uuid';
|
|
17126
17267
|
// 监听聚水潭退货商品
|
|
17127
17268
|
var jstReturnGoods = Form === null || Form === void 0 ? void 0 : Form.useWatch('3979edfd6d', form);
|
|
17128
17269
|
var isShowSelectTradeGoods = type !== 'JST_EXCHANGE_GOODS' || (jstReturnGoods === null || jstReturnGoods === void 0 ? void 0 : jstReturnGoods.jstSystemOrderNo);
|
|
17270
|
+
// 判断是否为商品信息组件
|
|
17271
|
+
var isGoods = type && ['WDT_GOODS', 'BS_E3_GOODS', 'GY_GOODS', 'JST_GOODS', 'WLN_GOODS', 'KM_GOODS'].includes(type) || false;
|
|
17129
17272
|
var refModal = useRef();
|
|
17130
17273
|
console.debug('表格数据', value);
|
|
17131
17274
|
var handleDelete = function handleDelete(record, index) {
|
|
@@ -17135,14 +17278,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17135
17278
|
});
|
|
17136
17279
|
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
|
|
17137
17280
|
};
|
|
17138
|
-
var
|
|
17139
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
17140
|
-
selectedRowKeys = _useState4[0],
|
|
17141
|
-
setSelectedRowKeys = _useState4[1];
|
|
17142
|
-
var _useState5 = useState(null),
|
|
17281
|
+
var _useState5 = useState([]),
|
|
17143
17282
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
17144
|
-
|
|
17145
|
-
|
|
17283
|
+
selectedRowKeys = _useState6[0],
|
|
17284
|
+
setSelectedRowKeys = _useState6[1];
|
|
17285
|
+
var _useState7 = useState(null),
|
|
17286
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
17287
|
+
hoveredRowIndex = _useState8[0],
|
|
17288
|
+
setHoveredRowIndex = _useState8[1];
|
|
17146
17289
|
useEffect(function () {
|
|
17147
17290
|
setSelectedRowKeys([]);
|
|
17148
17291
|
}, [tableSelect, selectType]);
|
|
@@ -17312,6 +17455,21 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17312
17455
|
}
|
|
17313
17456
|
return columnList;
|
|
17314
17457
|
}, [showHeader, value, disabled, hoveredRowIndex]);
|
|
17458
|
+
var orderModalColumns = useMemo(function () {
|
|
17459
|
+
var list = newColumns.filter(function (col) {
|
|
17460
|
+
return !['操作', '序号'].includes(col.title);
|
|
17461
|
+
});
|
|
17462
|
+
return [{
|
|
17463
|
+
dataIndex: '',
|
|
17464
|
+
title: '序号',
|
|
17465
|
+
align: 'center',
|
|
17466
|
+
ellipsis: true,
|
|
17467
|
+
width: 80,
|
|
17468
|
+
render: function render(val, record, index) {
|
|
17469
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
17470
|
+
}
|
|
17471
|
+
}].concat(_toConsumableArray(list));
|
|
17472
|
+
}, [newColumns]);
|
|
17315
17473
|
var orderColumns = useMemo(function () {
|
|
17316
17474
|
var columns = COLUMNS_MAP('', {
|
|
17317
17475
|
operate: false,
|
|
@@ -17371,12 +17529,17 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17371
17529
|
checked: isStrict,
|
|
17372
17530
|
onChange: handleCheckboxChange
|
|
17373
17531
|
}, "\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, {
|
|
17532
|
+
isGoods: isGoods,
|
|
17374
17533
|
uniqueKey: uniqueKey,
|
|
17375
|
-
|
|
17534
|
+
type: type,
|
|
17535
|
+
columns: orderModalColumns,
|
|
17376
17536
|
dataSource: tradeGoods.originDataSource,
|
|
17377
17537
|
getDataSourceAsync: tradeGoods.getDataSourceAsync,
|
|
17378
17538
|
selectedRowKeys: selectedGoods,
|
|
17379
|
-
onChangeSelectedKeys: tradeGoods.selectedGoodsChange
|
|
17539
|
+
onChangeSelectedKeys: tradeGoods.selectedGoodsChange,
|
|
17540
|
+
systemOrders: systemOrders,
|
|
17541
|
+
selectedSystemOrders: selectedSystemOrders,
|
|
17542
|
+
width: width || 850
|
|
17380
17543
|
}), showErpGoodsBtn && /*#__PURE__*/React.createElement(Button, {
|
|
17381
17544
|
type: "link",
|
|
17382
17545
|
onClick: handleChangeGoods
|
|
@@ -18227,7 +18390,7 @@ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
|
|
|
18227
18390
|
extendRequest('/qy/gdfw/order/wlnOrderList', {
|
|
18228
18391
|
method: 'post',
|
|
18229
18392
|
data: {
|
|
18230
|
-
|
|
18393
|
+
billCode: orderNo
|
|
18231
18394
|
}
|
|
18232
18395
|
}).then(function (data) {
|
|
18233
18396
|
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
@@ -18659,6 +18822,85 @@ var index$3 = (function (props) {
|
|
|
18659
18822
|
}));
|
|
18660
18823
|
});
|
|
18661
18824
|
|
|
18825
|
+
var isErpType$1 = {
|
|
18826
|
+
isWdt: function isWdt(type) {
|
|
18827
|
+
return ['WDT_GOODS'].includes(type);
|
|
18828
|
+
},
|
|
18829
|
+
isBsE3: function isBsE3(type) {
|
|
18830
|
+
return ['BS_E3_GOODS'].includes(type);
|
|
18831
|
+
},
|
|
18832
|
+
isGy: function isGy(type) {
|
|
18833
|
+
return ['GY_GOODS'].includes(type);
|
|
18834
|
+
},
|
|
18835
|
+
isWln: function isWln(type) {
|
|
18836
|
+
return ['WLN_GOODS'].includes(type);
|
|
18837
|
+
}
|
|
18838
|
+
};
|
|
18839
|
+
var processAllOrders = function processAllOrders(_ref) {
|
|
18840
|
+
var data = _ref.data,
|
|
18841
|
+
orderNo = _ref.orderNo,
|
|
18842
|
+
type = _ref.type;
|
|
18843
|
+
var newList = [];
|
|
18844
|
+
// 根据商品类型处理数据
|
|
18845
|
+
if (isErpType$1.isWdt(type)) {
|
|
18846
|
+
newList = processWdtOrders({
|
|
18847
|
+
data: data,
|
|
18848
|
+
orderNo: orderNo
|
|
18849
|
+
});
|
|
18850
|
+
} else if (isErpType$1.isBsE3(type)) {
|
|
18851
|
+
newList = processBsE3Orders({
|
|
18852
|
+
data: data,
|
|
18853
|
+
orderNo: orderNo
|
|
18854
|
+
});
|
|
18855
|
+
} else if (isErpType$1.isGy(type)) {
|
|
18856
|
+
newList = processGyOrders({
|
|
18857
|
+
data: data,
|
|
18858
|
+
orderNo: orderNo
|
|
18859
|
+
});
|
|
18860
|
+
} else if (isErpType$1.isWln(type)) {
|
|
18861
|
+
newList = processWlnOrders({
|
|
18862
|
+
data: data
|
|
18863
|
+
});
|
|
18864
|
+
} else {
|
|
18865
|
+
newList = processDefaultOrders({
|
|
18866
|
+
data: data
|
|
18867
|
+
});
|
|
18868
|
+
}
|
|
18869
|
+
return newList;
|
|
18870
|
+
};
|
|
18871
|
+
var processWdtOrders = function processWdtOrders(_ref2) {
|
|
18872
|
+
var data = _ref2.data,
|
|
18873
|
+
orderNo = _ref2.orderNo;
|
|
18874
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18875
|
+
return (item.srcTid || '').split(',').includes(orderNo);
|
|
18876
|
+
});
|
|
18877
|
+
return trades;
|
|
18878
|
+
};
|
|
18879
|
+
var processBsE3Orders = function processBsE3Orders(_ref3) {
|
|
18880
|
+
var data = _ref3.data,
|
|
18881
|
+
orderNo = _ref3.orderNo;
|
|
18882
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
|
|
18883
|
+
return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
|
|
18884
|
+
});
|
|
18885
|
+
return trades;
|
|
18886
|
+
};
|
|
18887
|
+
var processGyOrders = function processGyOrders(_ref4) {
|
|
18888
|
+
var data = _ref4.data,
|
|
18889
|
+
orderNo = _ref4.orderNo;
|
|
18890
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18891
|
+
return getIsPlatformCodesIncludeOrderNos(item.platformCode, orderNo);
|
|
18892
|
+
});
|
|
18893
|
+
return trades;
|
|
18894
|
+
};
|
|
18895
|
+
var processWlnOrders = function processWlnOrders(_ref5) {
|
|
18896
|
+
var data = _ref5.data;
|
|
18897
|
+
return (data === null || data === void 0 ? void 0 : data.orders) || [];
|
|
18898
|
+
};
|
|
18899
|
+
var processDefaultOrders = function processDefaultOrders(_ref6) {
|
|
18900
|
+
var data = _ref6.data;
|
|
18901
|
+
return data || [];
|
|
18902
|
+
};
|
|
18903
|
+
|
|
18662
18904
|
var WlnGoods = function WlnGoods(props) {
|
|
18663
18905
|
var value = props.value,
|
|
18664
18906
|
disabled = props.disabled,
|
|
@@ -18668,15 +18910,53 @@ var WlnGoods = function WlnGoods(props) {
|
|
|
18668
18910
|
wlnGoods: list
|
|
18669
18911
|
}));
|
|
18670
18912
|
};
|
|
18913
|
+
// 找到该订单号下所有商品
|
|
18914
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails() {
|
|
18915
|
+
var goodDetails = updateWlnGoodsHandle((value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
18916
|
+
return goodDetails;
|
|
18917
|
+
};
|
|
18918
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
18919
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
18920
|
+
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) {
|
|
18921
|
+
var list = processAllOrders({
|
|
18922
|
+
data: data,
|
|
18923
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
18924
|
+
type: 'WLN_GOODS'
|
|
18925
|
+
});
|
|
18926
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
18927
|
+
allOrders: list || []
|
|
18928
|
+
}));
|
|
18929
|
+
}) : Promise.resolve();
|
|
18930
|
+
};
|
|
18931
|
+
var selectedGoodsChange = useCallback(function (skuList) {
|
|
18932
|
+
var _uniqBy;
|
|
18933
|
+
var newValue = _objectSpread2({}, value);
|
|
18934
|
+
// 原订单商品
|
|
18935
|
+
var originTradeGoodList = getAllTradeGoodsDetails() || [];
|
|
18936
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
18937
|
+
var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value.wlnGoods) || [];
|
|
18938
|
+
newValue['wlnGoods'] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
18939
|
+
return skuList.includes(item.uuid);
|
|
18940
|
+
});
|
|
18941
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
18942
|
+
}, [value === null || value === void 0 ? void 0 : value.wlnGoods]);
|
|
18671
18943
|
return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18672
18944
|
key: 'wlnGoods'
|
|
18673
18945
|
}, props), {}, {
|
|
18674
18946
|
disabled: disabled,
|
|
18675
18947
|
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
18676
18948
|
value: value === null || value === void 0 ? void 0 : value.wlnGoods,
|
|
18677
|
-
showChangeBtn:
|
|
18949
|
+
showChangeBtn: true,
|
|
18950
|
+
showErpGoodsBtn: false,
|
|
18678
18951
|
onChange: function onChange(val) {
|
|
18679
18952
|
return changeHandle(val);
|
|
18953
|
+
},
|
|
18954
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
18955
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
18956
|
+
tradeGoods: {
|
|
18957
|
+
originDataSource: getAllTradeGoodsDetails(),
|
|
18958
|
+
selectedGoodsChange: selectedGoodsChange,
|
|
18959
|
+
getDataSourceAsync: getDataSourceAsync
|
|
18680
18960
|
}
|
|
18681
18961
|
}));
|
|
18682
18962
|
};
|
|
@@ -18705,7 +18985,8 @@ var componentMap$1 = {
|
|
|
18705
18985
|
deleteGood: 'wdtDeleteGood',
|
|
18706
18986
|
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
18707
18987
|
exchangeDeleteGood: 'wdtExchangeDeleteGood'
|
|
18708
|
-
}
|
|
18988
|
+
},
|
|
18989
|
+
getOrderList: wdtUtils.getWdtOrderListSingleton
|
|
18709
18990
|
},
|
|
18710
18991
|
BS_E3_GOODS: {
|
|
18711
18992
|
type: 'e3',
|
|
@@ -18730,7 +19011,8 @@ var componentMap$1 = {
|
|
|
18730
19011
|
deleteGood: 'bsE3DeleteGood',
|
|
18731
19012
|
returnDeleteGood: 'bsE3ReturnDeleteGood',
|
|
18732
19013
|
exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
|
|
18733
|
-
}
|
|
19014
|
+
},
|
|
19015
|
+
getOrderList: bsE3Utils.getBsE3OrderListSingleton
|
|
18734
19016
|
},
|
|
18735
19017
|
GY_GOODS: {
|
|
18736
19018
|
type: 'gy',
|
|
@@ -18755,7 +19037,8 @@ var componentMap$1 = {
|
|
|
18755
19037
|
deleteGood: 'gyDeleteGood',
|
|
18756
19038
|
returnDeleteGood: 'gyReturnDeleteGood',
|
|
18757
19039
|
exchangeDeleteGood: 'gyExchangeDeleteGood'
|
|
18758
|
-
}
|
|
19040
|
+
},
|
|
19041
|
+
getOrderList: gyUtils.getGyOrderListSingleton
|
|
18759
19042
|
},
|
|
18760
19043
|
JST_GOODS: {
|
|
18761
19044
|
type: 'jst',
|
|
@@ -18780,7 +19063,8 @@ var componentMap$1 = {
|
|
|
18780
19063
|
deleteGood: 'jstDeleteGood',
|
|
18781
19064
|
returnDeleteGood: 'jstReturnDeleteGood',
|
|
18782
19065
|
exchangeDeleteGood: 'jstExchangeDeleteGood'
|
|
18783
|
-
}
|
|
19066
|
+
},
|
|
19067
|
+
getOrderList: jstUtils.getJstOrderListSingleton
|
|
18784
19068
|
},
|
|
18785
19069
|
KM_GOODS: {
|
|
18786
19070
|
type: 'km',
|
|
@@ -18805,11 +19089,12 @@ var componentMap$1 = {
|
|
|
18805
19089
|
deleteGood: 'kmDeleteGood',
|
|
18806
19090
|
returnDeleteGood: 'kmReturnDeleteGood',
|
|
18807
19091
|
exchangeDeleteGood: 'kmExchangeDeleteGood'
|
|
18808
|
-
}
|
|
19092
|
+
},
|
|
19093
|
+
getOrderList: kmUtils.getOrderListSingleton
|
|
18809
19094
|
}
|
|
18810
19095
|
};
|
|
18811
19096
|
var CommonGoods = function CommonGoods(props) {
|
|
18812
|
-
var _withInfo$current3, _withInfo$current4;
|
|
19097
|
+
var _componentMap$compTyp5, _withInfo$current3, _withInfo$current4;
|
|
18813
19098
|
var value = props.value,
|
|
18814
19099
|
disabled = props.disabled,
|
|
18815
19100
|
onChange = props.onChange,
|
|
@@ -18911,7 +19196,6 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18911
19196
|
});
|
|
18912
19197
|
}
|
|
18913
19198
|
}), pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
18914
|
-
// console.log(data);
|
|
18915
19199
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
18916
19200
|
shopCode: data.shopCode
|
|
18917
19201
|
}));
|
|
@@ -18967,15 +19251,58 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18967
19251
|
var getGoodDetails = function getGoodDetails(_ref2) {
|
|
18968
19252
|
var mode = _ref2.mode;
|
|
18969
19253
|
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
18970
|
-
var goodDetails = updateHandle(value.orders || [], {
|
|
19254
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.orders) || [], {
|
|
18971
19255
|
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
18972
19256
|
});
|
|
18973
|
-
var orderNo = value.orderNo;
|
|
19257
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
18974
19258
|
return mode ? goodDetails.filter(function (goodItem) {
|
|
18975
19259
|
var _componentMap$compTyp;
|
|
18976
19260
|
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;
|
|
18977
19261
|
}) : goodDetails;
|
|
18978
19262
|
};
|
|
19263
|
+
// 找到该订单号下所有商品
|
|
19264
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails(_ref3) {
|
|
19265
|
+
var mode = _ref3.mode;
|
|
19266
|
+
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
19267
|
+
console.log('value?.allOrders', value, (value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
19268
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
|
|
19269
|
+
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
19270
|
+
});
|
|
19271
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
19272
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
19273
|
+
var _componentMap$compTyp2;
|
|
19274
|
+
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;
|
|
19275
|
+
}) : goodDetails;
|
|
19276
|
+
};
|
|
19277
|
+
var selectedGoodsChange = useCallback(function (skuList) {
|
|
19278
|
+
var _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
|
|
19279
|
+
var newValue = _objectSpread2({}, value);
|
|
19280
|
+
var isStrict = value.isStrict;
|
|
19281
|
+
// 原订单商品
|
|
19282
|
+
var originTradeGoodList = getAllTradeGoodsDetails({
|
|
19283
|
+
mode: isStrict
|
|
19284
|
+
}) || [];
|
|
19285
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
19286
|
+
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)]) || [];
|
|
19287
|
+
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) {
|
|
19288
|
+
return skuList.includes(item.uuid);
|
|
19289
|
+
});
|
|
19290
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
19291
|
+
}, [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]);
|
|
19292
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
19293
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
19294
|
+
var _componentMap$compTyp6;
|
|
19295
|
+
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) {
|
|
19296
|
+
var list = processAllOrders({
|
|
19297
|
+
data: data,
|
|
19298
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
19299
|
+
type: compType
|
|
19300
|
+
});
|
|
19301
|
+
onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
19302
|
+
allOrders: list || []
|
|
19303
|
+
}));
|
|
19304
|
+
}) : Promise.resolve();
|
|
19305
|
+
};
|
|
18979
19306
|
return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18980
19307
|
key: componentMap$1[compType].key
|
|
18981
19308
|
}, props), {}, {
|
|
@@ -18995,7 +19322,16 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18995
19322
|
},
|
|
18996
19323
|
onModeChange: handleModeChange,
|
|
18997
19324
|
showModeBtn: showModeBtn,
|
|
18998
|
-
isStrict: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19325
|
+
isStrict: value === null || value === void 0 ? void 0 : value.isStrict,
|
|
19326
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
19327
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
19328
|
+
tradeGoods: {
|
|
19329
|
+
originDataSource: getAllTradeGoodsDetails({
|
|
19330
|
+
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19331
|
+
}),
|
|
19332
|
+
getDataSourceAsync: getDataSourceAsync,
|
|
19333
|
+
selectedGoodsChange: selectedGoodsChange
|
|
19334
|
+
}
|
|
18999
19335
|
}));
|
|
19000
19336
|
};
|
|
19001
19337
|
|
|
@@ -21210,6 +21546,7 @@ var GyReissue = function GyReissue(props) {
|
|
|
21210
21546
|
sysOrderNo: val
|
|
21211
21547
|
});
|
|
21212
21548
|
}
|
|
21549
|
+
valueRef.current = newValue;
|
|
21213
21550
|
pushGyLog('afterChangeSystemOrder', newValue);
|
|
21214
21551
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
21215
21552
|
};
|
package/dist/index.js
CHANGED
|
@@ -14793,6 +14793,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14793
14793
|
val: text
|
|
14794
14794
|
});
|
|
14795
14795
|
}
|
|
14796
|
+
}, {
|
|
14797
|
+
dataIndex: 'apiGoodsName',
|
|
14798
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
14799
|
+
width: 200,
|
|
14800
|
+
align: 'center'
|
|
14801
|
+
}, {
|
|
14802
|
+
dataIndex: 'platformGoodsId',
|
|
14803
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
14804
|
+
width: 180,
|
|
14805
|
+
align: 'center'
|
|
14796
14806
|
}, {
|
|
14797
14807
|
dataIndex: 'specId',
|
|
14798
14808
|
title: "SKUID",
|
|
@@ -14815,6 +14825,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14815
14825
|
val: text
|
|
14816
14826
|
});
|
|
14817
14827
|
}
|
|
14828
|
+
}, {
|
|
14829
|
+
dataIndex: 'apiSpecName',
|
|
14830
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
14831
|
+
width: 200,
|
|
14832
|
+
align: 'center'
|
|
14833
|
+
}, {
|
|
14834
|
+
dataIndex: 'platformSpecId',
|
|
14835
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
14836
|
+
width: 180,
|
|
14837
|
+
align: 'center'
|
|
14818
14838
|
}, {
|
|
14819
14839
|
dataIndex: 'orderPrice',
|
|
14820
14840
|
title: "\u6210\u4EA4\u603B\u91D1\u989D",
|
|
@@ -14859,6 +14879,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14859
14879
|
val: text
|
|
14860
14880
|
});
|
|
14861
14881
|
}
|
|
14882
|
+
}, {
|
|
14883
|
+
dataIndex: 'apiGoodsName',
|
|
14884
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
14885
|
+
width: 200,
|
|
14886
|
+
align: 'center'
|
|
14887
|
+
}, {
|
|
14888
|
+
dataIndex: 'platformGoodsId',
|
|
14889
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
14890
|
+
width: 180,
|
|
14891
|
+
align: 'center'
|
|
14862
14892
|
}, {
|
|
14863
14893
|
dataIndex: 'specId',
|
|
14864
14894
|
title: "".concat(text, "SKUID"),
|
|
@@ -14881,6 +14911,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14881
14911
|
val: text
|
|
14882
14912
|
});
|
|
14883
14913
|
}
|
|
14914
|
+
}, {
|
|
14915
|
+
dataIndex: 'apiSpecName',
|
|
14916
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
14917
|
+
width: 200,
|
|
14918
|
+
align: 'center'
|
|
14919
|
+
}, {
|
|
14920
|
+
dataIndex: 'platformSpecId',
|
|
14921
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
14922
|
+
width: 180,
|
|
14923
|
+
align: 'center'
|
|
14884
14924
|
}, {
|
|
14885
14925
|
dataIndex: 'orderPrice',
|
|
14886
14926
|
title: "\u6210\u4EA4\u603B\u91D1\u989D",
|
|
@@ -14946,6 +14986,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14946
14986
|
val: text
|
|
14947
14987
|
});
|
|
14948
14988
|
}
|
|
14989
|
+
}, {
|
|
14990
|
+
dataIndex: 'apiGoodsName',
|
|
14991
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
14992
|
+
width: 200,
|
|
14993
|
+
align: 'center'
|
|
14994
|
+
}, {
|
|
14995
|
+
dataIndex: 'platformGoodsId',
|
|
14996
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
14997
|
+
width: 180,
|
|
14998
|
+
align: 'center'
|
|
14949
14999
|
}, {
|
|
14950
15000
|
dataIndex: 'specId',
|
|
14951
15001
|
title: "".concat(text, "SKUID"),
|
|
@@ -14968,6 +15018,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
14968
15018
|
val: text
|
|
14969
15019
|
});
|
|
14970
15020
|
}
|
|
15021
|
+
}, {
|
|
15022
|
+
dataIndex: 'apiSpecName',
|
|
15023
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
15024
|
+
width: 200,
|
|
15025
|
+
align: 'center'
|
|
15026
|
+
}, {
|
|
15027
|
+
dataIndex: 'platformSpecId',
|
|
15028
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
15029
|
+
width: 180,
|
|
15030
|
+
align: 'center'
|
|
14971
15031
|
}, {
|
|
14972
15032
|
dataIndex: 'num',
|
|
14973
15033
|
title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
|
|
@@ -15071,6 +15131,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
15071
15131
|
val: text
|
|
15072
15132
|
});
|
|
15073
15133
|
}
|
|
15134
|
+
}, {
|
|
15135
|
+
dataIndex: 'apiGoodsName',
|
|
15136
|
+
title: "\u5E73\u53F0\u5546\u54C1\u540D\u79F0",
|
|
15137
|
+
width: 200,
|
|
15138
|
+
align: 'center'
|
|
15139
|
+
}, {
|
|
15140
|
+
dataIndex: 'platformGoodsId',
|
|
15141
|
+
title: "\u5E73\u53F0\u5546\u54C1ID",
|
|
15142
|
+
width: 180,
|
|
15143
|
+
align: 'center'
|
|
15074
15144
|
}, {
|
|
15075
15145
|
dataIndex: 'specId',
|
|
15076
15146
|
title: "".concat(text, "SKUID"),
|
|
@@ -15093,6 +15163,16 @@ var getColumns$2 = function getColumns(_ref) {
|
|
|
15093
15163
|
val: text
|
|
15094
15164
|
});
|
|
15095
15165
|
}
|
|
15166
|
+
}, {
|
|
15167
|
+
dataIndex: 'apiSpecName',
|
|
15168
|
+
title: "\u5E73\u53F0\u89C4\u683C\u540D\u79F0",
|
|
15169
|
+
width: 200,
|
|
15170
|
+
align: 'center'
|
|
15171
|
+
}, {
|
|
15172
|
+
dataIndex: 'platformSpecId',
|
|
15173
|
+
title: "\u5E73\u53F0\u89C4\u683CID",
|
|
15174
|
+
width: 180,
|
|
15175
|
+
align: 'center'
|
|
15096
15176
|
}, {
|
|
15097
15177
|
dataIndex: 'num',
|
|
15098
15178
|
title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
|
|
@@ -17016,6 +17096,14 @@ var GoodsModalMap = {
|
|
|
17016
17096
|
KM_REISSUE_GOODS: KmGoodsModal,
|
|
17017
17097
|
OTHER_GOODS: GoodsModal$2
|
|
17018
17098
|
};
|
|
17099
|
+
var systemOrderNoMap = {
|
|
17100
|
+
GY_GOODS: 'code',
|
|
17101
|
+
KM_GOODS: 'sid',
|
|
17102
|
+
WDT_GOODS: 'tradeNo',
|
|
17103
|
+
BS_E3_GOODS: 'orderSn',
|
|
17104
|
+
JST_GOODS: 'oId',
|
|
17105
|
+
WLN_GOODS: 'tradeNo'
|
|
17106
|
+
};
|
|
17019
17107
|
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
17020
17108
|
var columns = _ref.columns,
|
|
17021
17109
|
dataSource = _ref.dataSource,
|
|
@@ -17023,35 +17111,60 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17023
17111
|
selectedRowKeys = _ref.selectedRowKeys,
|
|
17024
17112
|
onChangeSelectedKeys = _ref.onChangeSelectedKeys,
|
|
17025
17113
|
_ref$uniqueKey = _ref.uniqueKey,
|
|
17026
|
-
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey
|
|
17027
|
-
|
|
17114
|
+
uniqueKey = _ref$uniqueKey === void 0 ? 'uuid' : _ref$uniqueKey,
|
|
17115
|
+
_ref$isGoods = _ref.isGoods,
|
|
17116
|
+
isGoods = _ref$isGoods === void 0 ? false : _ref$isGoods,
|
|
17117
|
+
_ref$systemOrders = _ref.systemOrders,
|
|
17118
|
+
systemOrders = _ref$systemOrders === void 0 ? [] : _ref$systemOrders,
|
|
17119
|
+
_ref$selectedSystemOr = _ref.selectedSystemOrders,
|
|
17120
|
+
_ref$type = _ref.type,
|
|
17121
|
+
type = _ref$type === void 0 ? '' : _ref$type,
|
|
17122
|
+
width = _ref.width;
|
|
17123
|
+
var _useState = React.useState(),
|
|
17028
17124
|
_useState2 = _slicedToArray(_useState, 2),
|
|
17029
|
-
|
|
17030
|
-
|
|
17125
|
+
selectSystemNo = _useState2[0],
|
|
17126
|
+
setSelectSystemNo = _useState2[1];
|
|
17127
|
+
var _useState3 = React.useState(false),
|
|
17128
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
17129
|
+
tradeGoodsVisible = _useState4[0],
|
|
17130
|
+
setTradeGoodsVisible = _useState4[1];
|
|
17031
17131
|
var openModal = function openModal() {
|
|
17032
|
-
if (getDataSourceAsync) {
|
|
17132
|
+
if (getDataSourceAsync && !(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length)) {
|
|
17033
17133
|
getDataSourceAsync().then(function () {
|
|
17034
17134
|
setTradeGoodsVisible(true);
|
|
17035
17135
|
});
|
|
17036
17136
|
} else {
|
|
17037
17137
|
setTradeGoodsVisible(true);
|
|
17038
17138
|
}
|
|
17139
|
+
// 暂时先去掉带入系统自订单组件所选值作为默认筛选项
|
|
17140
|
+
// if (isGoods) {
|
|
17141
|
+
// const codeList: string[] = selectedSystemOrders?.map(
|
|
17142
|
+
// (item) => item?.[systemOrderNoMap?.[type]],
|
|
17143
|
+
// );
|
|
17144
|
+
// setSelectSystemNo(codeList || []);
|
|
17145
|
+
// }
|
|
17039
17146
|
};
|
|
17147
|
+
|
|
17040
17148
|
var closeModal = function closeModal() {
|
|
17041
17149
|
return setTradeGoodsVisible(false);
|
|
17042
17150
|
};
|
|
17043
|
-
var
|
|
17151
|
+
var filterDataSource = React.useMemo(function () {
|
|
17152
|
+
return (selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.length) ? dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (item) {
|
|
17153
|
+
return selectSystemNo === null || selectSystemNo === void 0 ? void 0 : selectSystemNo.includes(item.systemOrderNo);
|
|
17154
|
+
}) : dataSource;
|
|
17155
|
+
}, [dataSource, selectSystemNo]);
|
|
17156
|
+
var currentTradeOriginGoods = lodash.intersection(filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17044
17157
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17045
17158
|
}), selectedRowKeys);
|
|
17046
|
-
var unCurrentTradeOriginGoods = lodash.difference(selectedRowKeys,
|
|
17159
|
+
var unCurrentTradeOriginGoods = lodash.difference(selectedRowKeys, filterDataSource === null || filterDataSource === void 0 ? void 0 : filterDataSource.map(function (item) {
|
|
17047
17160
|
return item === null || item === void 0 ? void 0 : item[uniqueKey];
|
|
17048
17161
|
}));
|
|
17049
17162
|
var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
|
|
17050
|
-
// console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
|
|
17051
17163
|
onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
|
|
17052
17164
|
};
|
|
17053
17165
|
var rowSelection = {
|
|
17054
17166
|
selectedRowKeys: selectedRowKeys,
|
|
17167
|
+
fixed: true,
|
|
17055
17168
|
onChange: handleChangeSelectedKeys
|
|
17056
17169
|
};
|
|
17057
17170
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
@@ -17061,18 +17174,44 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
17061
17174
|
title: "\u8BA2\u5355\u5546\u54C1",
|
|
17062
17175
|
visible: tradeGoodsVisible,
|
|
17063
17176
|
footer: null,
|
|
17064
|
-
onCancel: closeModal
|
|
17065
|
-
|
|
17177
|
+
onCancel: closeModal,
|
|
17178
|
+
width: width || 850,
|
|
17179
|
+
style: {
|
|
17180
|
+
maxWidth: '1000px'
|
|
17181
|
+
}
|
|
17182
|
+
}, isGoods && /*#__PURE__*/React__default['default'].createElement(antd.Row, {
|
|
17183
|
+
style: {
|
|
17184
|
+
marginBottom: '20px'
|
|
17185
|
+
}
|
|
17186
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
|
|
17187
|
+
span: 12
|
|
17188
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
17189
|
+
placeholder: "\u7B5B\u9009\u7CFB\u7EDF\u8BA2\u5355\u5546\u54C1",
|
|
17190
|
+
style: {
|
|
17191
|
+
width: '100%'
|
|
17192
|
+
},
|
|
17193
|
+
mode: "multiple",
|
|
17194
|
+
value: selectSystemNo,
|
|
17195
|
+
onChange: function onChange(val) {
|
|
17196
|
+
return setSelectSystemNo(val);
|
|
17197
|
+
},
|
|
17198
|
+
options: systemOrders === null || systemOrders === void 0 ? void 0 : systemOrders.map(function (item) {
|
|
17199
|
+
return {
|
|
17200
|
+
label: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]],
|
|
17201
|
+
value: item === null || item === void 0 ? void 0 : item[systemOrderNoMap === null || systemOrderNoMap === void 0 ? void 0 : systemOrderNoMap[type]]
|
|
17202
|
+
};
|
|
17203
|
+
})
|
|
17204
|
+
}))), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
17066
17205
|
rowKey: uniqueKey,
|
|
17067
17206
|
rowSelection: rowSelection,
|
|
17068
17207
|
columns: columns,
|
|
17069
|
-
dataSource:
|
|
17208
|
+
dataSource: filterDataSource,
|
|
17070
17209
|
pagination: false,
|
|
17071
17210
|
scroll: {
|
|
17072
17211
|
x: 500,
|
|
17073
17212
|
y: 500
|
|
17074
17213
|
}
|
|
17075
|
-
}), /*#__PURE__*/React__default['default'].createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/",
|
|
17214
|
+
}), /*#__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, ")")));
|
|
17076
17215
|
};
|
|
17077
17216
|
var getButtonText = function getButtonText() {
|
|
17078
17217
|
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
@@ -17082,7 +17221,7 @@ var getButtonText = function getButtonText() {
|
|
|
17082
17221
|
if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
17083
17222
|
return '选择百胜ERP商品';
|
|
17084
17223
|
}
|
|
17085
|
-
if (['WDT_REISSUE_GOODS'].includes(type)) {
|
|
17224
|
+
if (['WDT_GOODS', 'WDT_REISSUE_GOODS'].includes(type)) {
|
|
17086
17225
|
return '选择旺店通商品';
|
|
17087
17226
|
}
|
|
17088
17227
|
if (['GY_GOODS', 'GY_REISSUE_GOODS', 'GY_RETURN_GOODS'].includes(type)) {
|
|
@@ -17133,11 +17272,15 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17133
17272
|
onDelete = props.onDelete,
|
|
17134
17273
|
onModeChange = props.onModeChange,
|
|
17135
17274
|
tradeGoods = props.tradeGoods,
|
|
17136
|
-
form = props.form
|
|
17275
|
+
form = props.form,
|
|
17276
|
+
systemOrders = props.systemOrders,
|
|
17277
|
+
selectedSystemOrders = props.selectedSystemOrders;
|
|
17137
17278
|
var uniqueKey = (tradeGoods === null || tradeGoods === void 0 ? void 0 : tradeGoods.uniqueKey) || 'uuid';
|
|
17138
17279
|
// 监听聚水潭退货商品
|
|
17139
17280
|
var jstReturnGoods = antd.Form === null || antd.Form === void 0 ? void 0 : antd.Form.useWatch('3979edfd6d', form);
|
|
17140
17281
|
var isShowSelectTradeGoods = type !== 'JST_EXCHANGE_GOODS' || (jstReturnGoods === null || jstReturnGoods === void 0 ? void 0 : jstReturnGoods.jstSystemOrderNo);
|
|
17282
|
+
// 判断是否为商品信息组件
|
|
17283
|
+
var isGoods = type && ['WDT_GOODS', 'BS_E3_GOODS', 'GY_GOODS', 'JST_GOODS', 'WLN_GOODS', 'KM_GOODS'].includes(type) || false;
|
|
17141
17284
|
var refModal = React.useRef();
|
|
17142
17285
|
console.debug('表格数据', value);
|
|
17143
17286
|
var handleDelete = function handleDelete(record, index) {
|
|
@@ -17147,14 +17290,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17147
17290
|
});
|
|
17148
17291
|
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
|
|
17149
17292
|
};
|
|
17150
|
-
var
|
|
17151
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
17152
|
-
selectedRowKeys = _useState4[0],
|
|
17153
|
-
setSelectedRowKeys = _useState4[1];
|
|
17154
|
-
var _useState5 = React.useState(null),
|
|
17293
|
+
var _useState5 = React.useState([]),
|
|
17155
17294
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
17156
|
-
|
|
17157
|
-
|
|
17295
|
+
selectedRowKeys = _useState6[0],
|
|
17296
|
+
setSelectedRowKeys = _useState6[1];
|
|
17297
|
+
var _useState7 = React.useState(null),
|
|
17298
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
17299
|
+
hoveredRowIndex = _useState8[0],
|
|
17300
|
+
setHoveredRowIndex = _useState8[1];
|
|
17158
17301
|
React.useEffect(function () {
|
|
17159
17302
|
setSelectedRowKeys([]);
|
|
17160
17303
|
}, [tableSelect, selectType]);
|
|
@@ -17324,6 +17467,21 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17324
17467
|
}
|
|
17325
17468
|
return columnList;
|
|
17326
17469
|
}, [showHeader, value, disabled, hoveredRowIndex]);
|
|
17470
|
+
var orderModalColumns = React.useMemo(function () {
|
|
17471
|
+
var list = newColumns.filter(function (col) {
|
|
17472
|
+
return !['操作', '序号'].includes(col.title);
|
|
17473
|
+
});
|
|
17474
|
+
return [{
|
|
17475
|
+
dataIndex: '',
|
|
17476
|
+
title: '序号',
|
|
17477
|
+
align: 'center',
|
|
17478
|
+
ellipsis: true,
|
|
17479
|
+
width: 80,
|
|
17480
|
+
render: function render(val, record, index) {
|
|
17481
|
+
return /*#__PURE__*/React__default['default'].createElement("span", null, index + 1);
|
|
17482
|
+
}
|
|
17483
|
+
}].concat(_toConsumableArray(list));
|
|
17484
|
+
}, [newColumns]);
|
|
17327
17485
|
var orderColumns = React.useMemo(function () {
|
|
17328
17486
|
var columns = COLUMNS_MAP('', {
|
|
17329
17487
|
operate: false,
|
|
@@ -17383,12 +17541,17 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
17383
17541
|
checked: isStrict,
|
|
17384
17542
|
onChange: handleCheckboxChange
|
|
17385
17543
|
}, "\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, {
|
|
17544
|
+
isGoods: isGoods,
|
|
17386
17545
|
uniqueKey: uniqueKey,
|
|
17387
|
-
|
|
17546
|
+
type: type,
|
|
17547
|
+
columns: orderModalColumns,
|
|
17388
17548
|
dataSource: tradeGoods.originDataSource,
|
|
17389
17549
|
getDataSourceAsync: tradeGoods.getDataSourceAsync,
|
|
17390
17550
|
selectedRowKeys: selectedGoods,
|
|
17391
|
-
onChangeSelectedKeys: tradeGoods.selectedGoodsChange
|
|
17551
|
+
onChangeSelectedKeys: tradeGoods.selectedGoodsChange,
|
|
17552
|
+
systemOrders: systemOrders,
|
|
17553
|
+
selectedSystemOrders: selectedSystemOrders,
|
|
17554
|
+
width: width || 850
|
|
17392
17555
|
}), showErpGoodsBtn && /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
17393
17556
|
type: "link",
|
|
17394
17557
|
onClick: handleChangeGoods
|
|
@@ -18239,7 +18402,7 @@ var getOrderListSingleton = function getOrderListSingleton(orderNo) {
|
|
|
18239
18402
|
extendRequest('/qy/gdfw/order/wlnOrderList', {
|
|
18240
18403
|
method: 'post',
|
|
18241
18404
|
data: {
|
|
18242
|
-
|
|
18405
|
+
billCode: orderNo
|
|
18243
18406
|
}
|
|
18244
18407
|
}).then(function (data) {
|
|
18245
18408
|
if (data === null || data === void 0 ? void 0 : data.success) {
|
|
@@ -18671,6 +18834,85 @@ var index$3 = (function (props) {
|
|
|
18671
18834
|
}));
|
|
18672
18835
|
});
|
|
18673
18836
|
|
|
18837
|
+
var isErpType$1 = {
|
|
18838
|
+
isWdt: function isWdt(type) {
|
|
18839
|
+
return ['WDT_GOODS'].includes(type);
|
|
18840
|
+
},
|
|
18841
|
+
isBsE3: function isBsE3(type) {
|
|
18842
|
+
return ['BS_E3_GOODS'].includes(type);
|
|
18843
|
+
},
|
|
18844
|
+
isGy: function isGy(type) {
|
|
18845
|
+
return ['GY_GOODS'].includes(type);
|
|
18846
|
+
},
|
|
18847
|
+
isWln: function isWln(type) {
|
|
18848
|
+
return ['WLN_GOODS'].includes(type);
|
|
18849
|
+
}
|
|
18850
|
+
};
|
|
18851
|
+
var processAllOrders = function processAllOrders(_ref) {
|
|
18852
|
+
var data = _ref.data,
|
|
18853
|
+
orderNo = _ref.orderNo,
|
|
18854
|
+
type = _ref.type;
|
|
18855
|
+
var newList = [];
|
|
18856
|
+
// 根据商品类型处理数据
|
|
18857
|
+
if (isErpType$1.isWdt(type)) {
|
|
18858
|
+
newList = processWdtOrders({
|
|
18859
|
+
data: data,
|
|
18860
|
+
orderNo: orderNo
|
|
18861
|
+
});
|
|
18862
|
+
} else if (isErpType$1.isBsE3(type)) {
|
|
18863
|
+
newList = processBsE3Orders({
|
|
18864
|
+
data: data,
|
|
18865
|
+
orderNo: orderNo
|
|
18866
|
+
});
|
|
18867
|
+
} else if (isErpType$1.isGy(type)) {
|
|
18868
|
+
newList = processGyOrders({
|
|
18869
|
+
data: data,
|
|
18870
|
+
orderNo: orderNo
|
|
18871
|
+
});
|
|
18872
|
+
} else if (isErpType$1.isWln(type)) {
|
|
18873
|
+
newList = processWlnOrders({
|
|
18874
|
+
data: data
|
|
18875
|
+
});
|
|
18876
|
+
} else {
|
|
18877
|
+
newList = processDefaultOrders({
|
|
18878
|
+
data: data
|
|
18879
|
+
});
|
|
18880
|
+
}
|
|
18881
|
+
return newList;
|
|
18882
|
+
};
|
|
18883
|
+
var processWdtOrders = function processWdtOrders(_ref2) {
|
|
18884
|
+
var data = _ref2.data,
|
|
18885
|
+
orderNo = _ref2.orderNo;
|
|
18886
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18887
|
+
return (item.srcTid || '').split(',').includes(orderNo);
|
|
18888
|
+
});
|
|
18889
|
+
return trades;
|
|
18890
|
+
};
|
|
18891
|
+
var processBsE3Orders = function processBsE3Orders(_ref3) {
|
|
18892
|
+
var data = _ref3.data,
|
|
18893
|
+
orderNo = _ref3.orderNo;
|
|
18894
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.orderList) || []).filter(function (item) {
|
|
18895
|
+
return (item === null || item === void 0 ? void 0 : item.dealCode) === orderNo;
|
|
18896
|
+
});
|
|
18897
|
+
return trades;
|
|
18898
|
+
};
|
|
18899
|
+
var processGyOrders = function processGyOrders(_ref4) {
|
|
18900
|
+
var data = _ref4.data,
|
|
18901
|
+
orderNo = _ref4.orderNo;
|
|
18902
|
+
var trades = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (item) {
|
|
18903
|
+
return kmkfUtils.getIsPlatformCodesIncludeOrderNos(item.platformCode, orderNo);
|
|
18904
|
+
});
|
|
18905
|
+
return trades;
|
|
18906
|
+
};
|
|
18907
|
+
var processWlnOrders = function processWlnOrders(_ref5) {
|
|
18908
|
+
var data = _ref5.data;
|
|
18909
|
+
return (data === null || data === void 0 ? void 0 : data.orders) || [];
|
|
18910
|
+
};
|
|
18911
|
+
var processDefaultOrders = function processDefaultOrders(_ref6) {
|
|
18912
|
+
var data = _ref6.data;
|
|
18913
|
+
return data || [];
|
|
18914
|
+
};
|
|
18915
|
+
|
|
18674
18916
|
var WlnGoods = function WlnGoods(props) {
|
|
18675
18917
|
var value = props.value,
|
|
18676
18918
|
disabled = props.disabled,
|
|
@@ -18680,15 +18922,53 @@ var WlnGoods = function WlnGoods(props) {
|
|
|
18680
18922
|
wlnGoods: list
|
|
18681
18923
|
}));
|
|
18682
18924
|
};
|
|
18925
|
+
// 找到该订单号下所有商品
|
|
18926
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails() {
|
|
18927
|
+
var goodDetails = kmkfUtils.updateWlnGoodsHandle((value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
18928
|
+
return goodDetails;
|
|
18929
|
+
};
|
|
18930
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
18931
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
18932
|
+
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) {
|
|
18933
|
+
var list = processAllOrders({
|
|
18934
|
+
data: data,
|
|
18935
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
18936
|
+
type: 'WLN_GOODS'
|
|
18937
|
+
});
|
|
18938
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
18939
|
+
allOrders: list || []
|
|
18940
|
+
}));
|
|
18941
|
+
}) : Promise.resolve();
|
|
18942
|
+
};
|
|
18943
|
+
var selectedGoodsChange = React.useCallback(function (skuList) {
|
|
18944
|
+
var _uniqBy;
|
|
18945
|
+
var newValue = _objectSpread2({}, value);
|
|
18946
|
+
// 原订单商品
|
|
18947
|
+
var originTradeGoodList = getAllTradeGoodsDetails() || [];
|
|
18948
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
18949
|
+
var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value.wlnGoods) || [];
|
|
18950
|
+
newValue['wlnGoods'] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
18951
|
+
return skuList.includes(item.uuid);
|
|
18952
|
+
});
|
|
18953
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
18954
|
+
}, [value === null || value === void 0 ? void 0 : value.wlnGoods]);
|
|
18683
18955
|
return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18684
18956
|
key: 'wlnGoods'
|
|
18685
18957
|
}, props), {}, {
|
|
18686
18958
|
disabled: disabled,
|
|
18687
18959
|
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
18688
18960
|
value: value === null || value === void 0 ? void 0 : value.wlnGoods,
|
|
18689
|
-
showChangeBtn:
|
|
18961
|
+
showChangeBtn: true,
|
|
18962
|
+
showErpGoodsBtn: false,
|
|
18690
18963
|
onChange: function onChange(val) {
|
|
18691
18964
|
return changeHandle(val);
|
|
18965
|
+
},
|
|
18966
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
18967
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
18968
|
+
tradeGoods: {
|
|
18969
|
+
originDataSource: getAllTradeGoodsDetails(),
|
|
18970
|
+
selectedGoodsChange: selectedGoodsChange,
|
|
18971
|
+
getDataSourceAsync: getDataSourceAsync
|
|
18692
18972
|
}
|
|
18693
18973
|
}));
|
|
18694
18974
|
};
|
|
@@ -18717,7 +18997,8 @@ var componentMap$1 = {
|
|
|
18717
18997
|
deleteGood: 'wdtDeleteGood',
|
|
18718
18998
|
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
18719
18999
|
exchangeDeleteGood: 'wdtExchangeDeleteGood'
|
|
18720
|
-
}
|
|
19000
|
+
},
|
|
19001
|
+
getOrderList: wdtUtils.getWdtOrderListSingleton
|
|
18721
19002
|
},
|
|
18722
19003
|
BS_E3_GOODS: {
|
|
18723
19004
|
type: 'e3',
|
|
@@ -18742,7 +19023,8 @@ var componentMap$1 = {
|
|
|
18742
19023
|
deleteGood: 'bsE3DeleteGood',
|
|
18743
19024
|
returnDeleteGood: 'bsE3ReturnDeleteGood',
|
|
18744
19025
|
exchangeDeleteGood: 'bsE3ExchangeDeleteGood'
|
|
18745
|
-
}
|
|
19026
|
+
},
|
|
19027
|
+
getOrderList: bsE3Utils.getBsE3OrderListSingleton
|
|
18746
19028
|
},
|
|
18747
19029
|
GY_GOODS: {
|
|
18748
19030
|
type: 'gy',
|
|
@@ -18767,7 +19049,8 @@ var componentMap$1 = {
|
|
|
18767
19049
|
deleteGood: 'gyDeleteGood',
|
|
18768
19050
|
returnDeleteGood: 'gyReturnDeleteGood',
|
|
18769
19051
|
exchangeDeleteGood: 'gyExchangeDeleteGood'
|
|
18770
|
-
}
|
|
19052
|
+
},
|
|
19053
|
+
getOrderList: gyUtils.getGyOrderListSingleton
|
|
18771
19054
|
},
|
|
18772
19055
|
JST_GOODS: {
|
|
18773
19056
|
type: 'jst',
|
|
@@ -18792,7 +19075,8 @@ var componentMap$1 = {
|
|
|
18792
19075
|
deleteGood: 'jstDeleteGood',
|
|
18793
19076
|
returnDeleteGood: 'jstReturnDeleteGood',
|
|
18794
19077
|
exchangeDeleteGood: 'jstExchangeDeleteGood'
|
|
18795
|
-
}
|
|
19078
|
+
},
|
|
19079
|
+
getOrderList: jstUtils.getJstOrderListSingleton
|
|
18796
19080
|
},
|
|
18797
19081
|
KM_GOODS: {
|
|
18798
19082
|
type: 'km',
|
|
@@ -18817,11 +19101,12 @@ var componentMap$1 = {
|
|
|
18817
19101
|
deleteGood: 'kmDeleteGood',
|
|
18818
19102
|
returnDeleteGood: 'kmReturnDeleteGood',
|
|
18819
19103
|
exchangeDeleteGood: 'kmExchangeDeleteGood'
|
|
18820
|
-
}
|
|
19104
|
+
},
|
|
19105
|
+
getOrderList: kmUtils.getOrderListSingleton
|
|
18821
19106
|
}
|
|
18822
19107
|
};
|
|
18823
19108
|
var CommonGoods = function CommonGoods(props) {
|
|
18824
|
-
var _withInfo$current3, _withInfo$current4;
|
|
19109
|
+
var _componentMap$compTyp5, _withInfo$current3, _withInfo$current4;
|
|
18825
19110
|
var value = props.value,
|
|
18826
19111
|
disabled = props.disabled,
|
|
18827
19112
|
onChange = props.onChange,
|
|
@@ -18923,7 +19208,6 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18923
19208
|
});
|
|
18924
19209
|
}
|
|
18925
19210
|
}), pubsub__default['default'].subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
18926
|
-
// console.log(data);
|
|
18927
19211
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
|
|
18928
19212
|
shopCode: data.shopCode
|
|
18929
19213
|
}));
|
|
@@ -18979,15 +19263,58 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
18979
19263
|
var getGoodDetails = function getGoodDetails(_ref2) {
|
|
18980
19264
|
var mode = _ref2.mode;
|
|
18981
19265
|
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
18982
|
-
var goodDetails = updateHandle(value.orders || [], {
|
|
19266
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.orders) || [], {
|
|
18983
19267
|
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
18984
19268
|
});
|
|
18985
|
-
var orderNo = value.orderNo;
|
|
19269
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
18986
19270
|
return mode ? goodDetails.filter(function (goodItem) {
|
|
18987
19271
|
var _componentMap$compTyp;
|
|
18988
19272
|
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;
|
|
18989
19273
|
}) : goodDetails;
|
|
18990
19274
|
};
|
|
19275
|
+
// 找到该订单号下所有商品
|
|
19276
|
+
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails(_ref3) {
|
|
19277
|
+
var mode = _ref3.mode;
|
|
19278
|
+
var updateHandle = componentMap$1[compType].eventNameMap['updateGoodsHandle'];
|
|
19279
|
+
console.log('value?.allOrders', value, (value === null || value === void 0 ? void 0 : value.allOrders) || []);
|
|
19280
|
+
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
|
|
19281
|
+
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
19282
|
+
});
|
|
19283
|
+
var orderNo = value === null || value === void 0 ? void 0 : value.orderNo;
|
|
19284
|
+
return mode ? goodDetails.filter(function (goodItem) {
|
|
19285
|
+
var _componentMap$compTyp2;
|
|
19286
|
+
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;
|
|
19287
|
+
}) : goodDetails;
|
|
19288
|
+
};
|
|
19289
|
+
var selectedGoodsChange = React.useCallback(function (skuList) {
|
|
19290
|
+
var _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
|
|
19291
|
+
var newValue = _objectSpread2({}, value);
|
|
19292
|
+
var isStrict = value.isStrict;
|
|
19293
|
+
// 原订单商品
|
|
19294
|
+
var originTradeGoodList = getAllTradeGoodsDetails({
|
|
19295
|
+
mode: isStrict
|
|
19296
|
+
}) || [];
|
|
19297
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
19298
|
+
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)]) || [];
|
|
19299
|
+
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) {
|
|
19300
|
+
return skuList.includes(item.uuid);
|
|
19301
|
+
});
|
|
19302
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
19303
|
+
}, [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]);
|
|
19304
|
+
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
19305
|
+
var getDataSourceAsync = function getDataSourceAsync() {
|
|
19306
|
+
var _componentMap$compTyp6;
|
|
19307
|
+
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) {
|
|
19308
|
+
var list = processAllOrders({
|
|
19309
|
+
data: data,
|
|
19310
|
+
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
19311
|
+
type: compType
|
|
19312
|
+
});
|
|
19313
|
+
onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
19314
|
+
allOrders: list || []
|
|
19315
|
+
}));
|
|
19316
|
+
}) : Promise.resolve();
|
|
19317
|
+
};
|
|
18991
19318
|
return /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
18992
19319
|
key: componentMap$1[compType].key
|
|
18993
19320
|
}, props), {}, {
|
|
@@ -19007,7 +19334,16 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
19007
19334
|
},
|
|
19008
19335
|
onModeChange: handleModeChange,
|
|
19009
19336
|
showModeBtn: showModeBtn,
|
|
19010
|
-
isStrict: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19337
|
+
isStrict: value === null || value === void 0 ? void 0 : value.isStrict,
|
|
19338
|
+
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
19339
|
+
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
19340
|
+
tradeGoods: {
|
|
19341
|
+
originDataSource: getAllTradeGoodsDetails({
|
|
19342
|
+
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
19343
|
+
}),
|
|
19344
|
+
getDataSourceAsync: getDataSourceAsync,
|
|
19345
|
+
selectedGoodsChange: selectedGoodsChange
|
|
19346
|
+
}
|
|
19011
19347
|
}));
|
|
19012
19348
|
};
|
|
19013
19349
|
|
|
@@ -21222,6 +21558,7 @@ var GyReissue = function GyReissue(props) {
|
|
|
21222
21558
|
sysOrderNo: val
|
|
21223
21559
|
});
|
|
21224
21560
|
}
|
|
21561
|
+
valueRef.current = newValue;
|
|
21225
21562
|
kmkfUtils.pushGyLog('afterChangeSystemOrder', newValue);
|
|
21226
21563
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
21227
21564
|
};
|
|
@@ -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.79-beta.
|
|
3
|
+
"version": "2.0.79-beta.26",
|
|
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.79-beta.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "2.0.79-beta.22",
|
|
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": "455d944467df490ccc3fb5d25ffc09ade0233b9e"
|
|
69
69
|
}
|