@kmkf-fe-packages/basic-components 2.2.39-beta.21 → 2.2.39-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 +300 -64
- package/dist/index.js +300 -64
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -21726,6 +21726,16 @@ var getColumns$6 = function getColumns(_ref) {
|
|
|
21726
21726
|
title: "\u5546\u54C1\u7C7B\u578B",
|
|
21727
21727
|
width: 150,
|
|
21728
21728
|
render: renderTextEllipsis
|
|
21729
|
+
}, {
|
|
21730
|
+
dataIndex: 'supplierName',
|
|
21731
|
+
title: "\u4F9B\u5E94\u5546\u540D\u79F0",
|
|
21732
|
+
width: 150,
|
|
21733
|
+
render: renderTextEllipsis
|
|
21734
|
+
}, {
|
|
21735
|
+
dataIndex: 'supplierCode',
|
|
21736
|
+
title: "\u4F9B\u5E94\u5546\u7F16\u7801",
|
|
21737
|
+
width: 150,
|
|
21738
|
+
render: renderTextEllipsis
|
|
21729
21739
|
}].map(function (item) {
|
|
21730
21740
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
21731
21741
|
align: 'center',
|
|
@@ -21853,6 +21863,16 @@ var getColumns$6 = function getColumns(_ref) {
|
|
|
21853
21863
|
title: "\u5546\u54C1\u7C7B\u578B",
|
|
21854
21864
|
width: 150,
|
|
21855
21865
|
render: renderTextEllipsis
|
|
21866
|
+
}, {
|
|
21867
|
+
dataIndex: 'supplierName',
|
|
21868
|
+
title: "\u4F9B\u5E94\u5546\u540D\u79F0",
|
|
21869
|
+
width: 150,
|
|
21870
|
+
render: renderTextEllipsis
|
|
21871
|
+
}, {
|
|
21872
|
+
dataIndex: 'supplierCode',
|
|
21873
|
+
title: "\u4F9B\u5E94\u5546\u7F16\u7801",
|
|
21874
|
+
width: 150,
|
|
21875
|
+
render: renderTextEllipsis
|
|
21856
21876
|
}, {
|
|
21857
21877
|
dataIndex: 'sysPicPath',
|
|
21858
21878
|
title: "\u5546\u54C1\u56FE\u7247",
|
|
@@ -23525,23 +23545,75 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
23525
23545
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
23526
23546
|
tradeGoodsVisible = _useState4[0],
|
|
23527
23547
|
setTradeGoodsVisible = _useState4[1];
|
|
23528
|
-
var
|
|
23529
|
-
|
|
23530
|
-
|
|
23531
|
-
return
|
|
23532
|
-
|
|
23533
|
-
|
|
23534
|
-
|
|
23535
|
-
|
|
23536
|
-
|
|
23537
|
-
|
|
23538
|
-
|
|
23539
|
-
|
|
23540
|
-
|
|
23541
|
-
|
|
23542
|
-
|
|
23543
|
-
|
|
23544
|
-
|
|
23548
|
+
var getKmSupplier = /*#__PURE__*/function () {
|
|
23549
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dataSource) {
|
|
23550
|
+
var systemItemIds, supplierMap;
|
|
23551
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
23552
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23553
|
+
case 0:
|
|
23554
|
+
systemItemIds = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
23555
|
+
return item.sysItemId;
|
|
23556
|
+
});
|
|
23557
|
+
_context.next = 3;
|
|
23558
|
+
return servers.KM.getSupplierSingleton(systemItemIds);
|
|
23559
|
+
case 3:
|
|
23560
|
+
supplierMap = _context.sent;
|
|
23561
|
+
dataSource === null || dataSource === void 0 ? void 0 : dataSource.forEach(function (item) {
|
|
23562
|
+
var supplierInfo = supplierMap.get(item.sysItemId);
|
|
23563
|
+
item.supplierCode = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierCode;
|
|
23564
|
+
item.supplierName = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierName;
|
|
23565
|
+
});
|
|
23566
|
+
case 5:
|
|
23567
|
+
case "end":
|
|
23568
|
+
return _context.stop();
|
|
23569
|
+
}
|
|
23570
|
+
}, _callee);
|
|
23571
|
+
}));
|
|
23572
|
+
return function getKmSupplier(_x) {
|
|
23573
|
+
return _ref2.apply(this, arguments);
|
|
23574
|
+
};
|
|
23575
|
+
}();
|
|
23576
|
+
var openModal = /*#__PURE__*/function () {
|
|
23577
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
23578
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
23579
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
23580
|
+
case 0:
|
|
23581
|
+
if (!validSystemOrder) {
|
|
23582
|
+
_context2.next = 3;
|
|
23583
|
+
break;
|
|
23584
|
+
}
|
|
23585
|
+
message.warning('请选择补发系统单');
|
|
23586
|
+
return _context2.abrupt("return");
|
|
23587
|
+
case 3:
|
|
23588
|
+
if (!(getDataSourceAsync && !(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length))) {
|
|
23589
|
+
_context2.next = 6;
|
|
23590
|
+
break;
|
|
23591
|
+
}
|
|
23592
|
+
_context2.next = 6;
|
|
23593
|
+
return getDataSourceAsync();
|
|
23594
|
+
case 6:
|
|
23595
|
+
if (!['KM_GOODS', 'KM_REISSUE_GOODS'].includes(type)) {
|
|
23596
|
+
_context2.next = 9;
|
|
23597
|
+
break;
|
|
23598
|
+
}
|
|
23599
|
+
_context2.next = 9;
|
|
23600
|
+
return getKmSupplier(dataSource);
|
|
23601
|
+
case 9:
|
|
23602
|
+
setTradeGoodsVisible(true);
|
|
23603
|
+
// 补发直接传入的是systemNo
|
|
23604
|
+
if (isShowSelect && isReissueType) {
|
|
23605
|
+
setSelectSystemNo(selectedSystemOrders || []);
|
|
23606
|
+
}
|
|
23607
|
+
case 11:
|
|
23608
|
+
case "end":
|
|
23609
|
+
return _context2.stop();
|
|
23610
|
+
}
|
|
23611
|
+
}, _callee2);
|
|
23612
|
+
}));
|
|
23613
|
+
return function openModal() {
|
|
23614
|
+
return _ref3.apply(this, arguments);
|
|
23615
|
+
};
|
|
23616
|
+
}();
|
|
23545
23617
|
var closeModal = function closeModal() {
|
|
23546
23618
|
return setTradeGoodsVisible(false);
|
|
23547
23619
|
};
|
|
@@ -23865,9 +23937,9 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
23865
23937
|
var COLUMNS_INFO = COLUMNS_MAP(text);
|
|
23866
23938
|
return COLUMNS_INFO(type);
|
|
23867
23939
|
};
|
|
23868
|
-
var getShowFilterColumns = useCallback(function (
|
|
23869
|
-
var showHeader =
|
|
23870
|
-
initBaseInfoColumns =
|
|
23940
|
+
var getShowFilterColumns = useCallback(function (_ref4) {
|
|
23941
|
+
var showHeader = _ref4.showHeader,
|
|
23942
|
+
initBaseInfoColumns = _ref4.initBaseInfoColumns;
|
|
23871
23943
|
var baseInfoColumns = [];
|
|
23872
23944
|
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
|
|
23873
23945
|
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
|
|
@@ -26710,7 +26782,7 @@ var componentMap$2 = {
|
|
|
26710
26782
|
}
|
|
26711
26783
|
};
|
|
26712
26784
|
var CommonGoods = function CommonGoods(props) {
|
|
26713
|
-
var
|
|
26785
|
+
var _withInfo$current3, _withInfo$current4, _componentMap$compTyp6;
|
|
26714
26786
|
var value = props.value,
|
|
26715
26787
|
disabled = props.disabled,
|
|
26716
26788
|
onChange = props.onChange,
|
|
@@ -26726,6 +26798,10 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26726
26798
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26727
26799
|
tableSelect = _useState2[0],
|
|
26728
26800
|
setTableSelect = _useState2[1];
|
|
26801
|
+
var _useState3 = useState([]),
|
|
26802
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26803
|
+
originDataSource = _useState4[0],
|
|
26804
|
+
setOriginDataSource = _useState4[1];
|
|
26729
26805
|
var withInfo = useRef(null);
|
|
26730
26806
|
var valueRef = useRef(null);
|
|
26731
26807
|
var tokens = useRef([]);
|
|
@@ -26737,10 +26813,90 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26737
26813
|
compType.indexOf('WDT') > -1 && getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
|
|
26738
26814
|
}
|
|
26739
26815
|
}, [value]);
|
|
26816
|
+
var sysItemIdMap = useMemo(function () {
|
|
26817
|
+
var map = {};
|
|
26818
|
+
if (compType.indexOf('KM') > -1) {
|
|
26819
|
+
var _value$kmGoods;
|
|
26820
|
+
value === null || value === void 0 ? void 0 : (_value$kmGoods = value.kmGoods) === null || _value$kmGoods === void 0 ? void 0 : _value$kmGoods.forEach(function (item) {
|
|
26821
|
+
map[item.sysItemId] = item;
|
|
26822
|
+
});
|
|
26823
|
+
}
|
|
26824
|
+
return map;
|
|
26825
|
+
}, [value === null || value === void 0 ? void 0 : value.kmGoods]);
|
|
26826
|
+
// 用于跟踪已经处理过的 sysItemId,避免重复处理
|
|
26827
|
+
var processedSysItemIdsRef = useRef(new Set());
|
|
26828
|
+
useEffect(function () {
|
|
26829
|
+
var fetchSupplier = /*#__PURE__*/function () {
|
|
26830
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sysItemIds) {
|
|
26831
|
+
var _currentValue$kmGoods;
|
|
26832
|
+
var needFetchIds, supplierMap, hasChange, currentValue, kmGoods;
|
|
26833
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26834
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26835
|
+
case 0:
|
|
26836
|
+
if (sysItemIds.length) {
|
|
26837
|
+
_context.next = 2;
|
|
26838
|
+
break;
|
|
26839
|
+
}
|
|
26840
|
+
return _context.abrupt("return");
|
|
26841
|
+
case 2:
|
|
26842
|
+
// 过滤出还没有供应商信息的 sysItemId
|
|
26843
|
+
needFetchIds = sysItemIds.filter(function (id) {
|
|
26844
|
+
var item = sysItemIdMap[id];
|
|
26845
|
+
return item && (!item.supplierCode || !item.supplierName);
|
|
26846
|
+
});
|
|
26847
|
+
if (needFetchIds.length) {
|
|
26848
|
+
_context.next = 5;
|
|
26849
|
+
break;
|
|
26850
|
+
}
|
|
26851
|
+
return _context.abrupt("return");
|
|
26852
|
+
case 5:
|
|
26853
|
+
_context.next = 7;
|
|
26854
|
+
return servers.KM.getSupplierSingleton(needFetchIds);
|
|
26855
|
+
case 7:
|
|
26856
|
+
supplierMap = _context.sent;
|
|
26857
|
+
// 检查是否有实际变化,避免不必要的更新
|
|
26858
|
+
hasChange = false;
|
|
26859
|
+
currentValue = valueRef.current;
|
|
26860
|
+
kmGoods = currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$kmGoods = currentValue.kmGoods) === null || _currentValue$kmGoods === void 0 ? void 0 : _currentValue$kmGoods.map(function (item) {
|
|
26861
|
+
var supplierInfo = supplierMap.get(item.sysItemId);
|
|
26862
|
+
var newSupplierCode = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierCode;
|
|
26863
|
+
var newSupplierName = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierName;
|
|
26864
|
+
// 如果供应商信息有变化,标记需要更新
|
|
26865
|
+
if (newSupplierCode && item.supplierCode !== newSupplierCode || newSupplierName && item.supplierName !== newSupplierName) {
|
|
26866
|
+
hasChange = true;
|
|
26867
|
+
// 标记已处理
|
|
26868
|
+
processedSysItemIdsRef.current.add(item.sysItemId);
|
|
26869
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
26870
|
+
supplierCode: newSupplierCode || item.supplierCode,
|
|
26871
|
+
supplierName: newSupplierName || item.supplierName
|
|
26872
|
+
});
|
|
26873
|
+
}
|
|
26874
|
+
return item;
|
|
26875
|
+
}); // 只在有实际变化时才更新
|
|
26876
|
+
if (hasChange && kmGoods) {
|
|
26877
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, currentValue), {}, {
|
|
26878
|
+
kmGoods: kmGoods
|
|
26879
|
+
}));
|
|
26880
|
+
}
|
|
26881
|
+
case 12:
|
|
26882
|
+
case "end":
|
|
26883
|
+
return _context.stop();
|
|
26884
|
+
}
|
|
26885
|
+
}, _callee);
|
|
26886
|
+
}));
|
|
26887
|
+
return function fetchSupplier(_x) {
|
|
26888
|
+
return _ref.apply(this, arguments);
|
|
26889
|
+
};
|
|
26890
|
+
}();
|
|
26891
|
+
var sysItemIds = Object.keys(sysItemIdMap);
|
|
26892
|
+
if (sysItemIds === null || sysItemIds === void 0 ? void 0 : sysItemIds.length) {
|
|
26893
|
+
fetchSupplier(sysItemIds);
|
|
26894
|
+
}
|
|
26895
|
+
}, [sysItemIdMap]);
|
|
26740
26896
|
var getWdtOrderList = /*#__PURE__*/function () {
|
|
26741
|
-
var
|
|
26742
|
-
return _regeneratorRuntime().wrap(function
|
|
26743
|
-
while (1) switch (
|
|
26897
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderNo) {
|
|
26898
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
26899
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
26744
26900
|
case 0:
|
|
26745
26901
|
wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
|
|
26746
26902
|
var orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (trade) {
|
|
@@ -26753,12 +26909,12 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26753
26909
|
});
|
|
26754
26910
|
case 1:
|
|
26755
26911
|
case "end":
|
|
26756
|
-
return
|
|
26912
|
+
return _context2.stop();
|
|
26757
26913
|
}
|
|
26758
|
-
},
|
|
26914
|
+
}, _callee2);
|
|
26759
26915
|
}));
|
|
26760
|
-
return function getWdtOrderList(
|
|
26761
|
-
return
|
|
26916
|
+
return function getWdtOrderList(_x2) {
|
|
26917
|
+
return _ref2.apply(this, arguments);
|
|
26762
26918
|
};
|
|
26763
26919
|
}();
|
|
26764
26920
|
useEffect(function () {
|
|
@@ -26864,8 +27020,8 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26864
27020
|
mode: isStrict
|
|
26865
27021
|
}))));
|
|
26866
27022
|
};
|
|
26867
|
-
var getGoodDetails = function getGoodDetails(
|
|
26868
|
-
var mode =
|
|
27023
|
+
var getGoodDetails = function getGoodDetails(_ref3) {
|
|
27024
|
+
var mode = _ref3.mode;
|
|
26869
27025
|
var updateHandle = componentMap$2[compType].eventNameMap['updateGoodsHandle'];
|
|
26870
27026
|
if (!updateHandle) return [];
|
|
26871
27027
|
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.orders) || [], {
|
|
@@ -26877,44 +27033,126 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26877
27033
|
return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp = componentMap$2[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.goodDetailOrderNo]) === orderNo;
|
|
26878
27034
|
}) : goodDetails;
|
|
26879
27035
|
};
|
|
27036
|
+
// const getKmSupplier = async (list: any[]) => {
|
|
27037
|
+
// const systemItemIds = list?.map((item) => item.sysItemId);
|
|
27038
|
+
// const supplierMap = await servers.KM.getSupplierSingleton(systemItemIds);
|
|
27039
|
+
// list?.forEach((item) => {
|
|
27040
|
+
// const supplierInfo = supplierMap.get(item.sysItemId);
|
|
27041
|
+
// item.supplierCode = supplierInfo?.supplierCode;
|
|
27042
|
+
// item.supplierName = supplierInfo?.supplierName;
|
|
27043
|
+
// });
|
|
27044
|
+
// };
|
|
26880
27045
|
// 找到该订单号下所有商品
|
|
26881
|
-
var getAllTradeGoodsDetails = function
|
|
26882
|
-
var
|
|
26883
|
-
|
|
26884
|
-
|
|
26885
|
-
|
|
26886
|
-
|
|
26887
|
-
|
|
26888
|
-
|
|
26889
|
-
|
|
26890
|
-
|
|
26891
|
-
|
|
26892
|
-
|
|
26893
|
-
|
|
26894
|
-
|
|
26895
|
-
|
|
26896
|
-
|
|
26897
|
-
|
|
26898
|
-
|
|
26899
|
-
|
|
26900
|
-
|
|
26901
|
-
|
|
26902
|
-
|
|
26903
|
-
|
|
26904
|
-
|
|
26905
|
-
|
|
26906
|
-
|
|
26907
|
-
|
|
26908
|
-
|
|
27046
|
+
var getAllTradeGoodsDetails = /*#__PURE__*/function () {
|
|
27047
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
|
|
27048
|
+
var mode, updateHandle, goodDetails, orderNo;
|
|
27049
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
27050
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
27051
|
+
case 0:
|
|
27052
|
+
mode = _ref4.mode;
|
|
27053
|
+
updateHandle = componentMap$2[compType].eventNameMap['updateGoodsHandle'];
|
|
27054
|
+
if (updateHandle) {
|
|
27055
|
+
_context3.next = 4;
|
|
27056
|
+
break;
|
|
27057
|
+
}
|
|
27058
|
+
return _context3.abrupt("return", []);
|
|
27059
|
+
case 4:
|
|
27060
|
+
goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
|
|
27061
|
+
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
27062
|
+
});
|
|
27063
|
+
orderNo = value === null || value === void 0 ? void 0 : value.orderNo; // if (['KM_GOODS', 'KM_REISSUE_GOODS'].includes(compType)) {
|
|
27064
|
+
// await getKmSupplier(goodDetails);
|
|
27065
|
+
// }
|
|
27066
|
+
return _context3.abrupt("return", mode ? goodDetails.filter(function (goodItem) {
|
|
27067
|
+
var _componentMap$compTyp2;
|
|
27068
|
+
return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp2 = componentMap$2[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.goodDetailOrderNo]) === orderNo;
|
|
27069
|
+
}) : goodDetails);
|
|
27070
|
+
case 7:
|
|
27071
|
+
case "end":
|
|
27072
|
+
return _context3.stop();
|
|
27073
|
+
}
|
|
27074
|
+
}, _callee3);
|
|
27075
|
+
}));
|
|
27076
|
+
return function getAllTradeGoodsDetails(_x3) {
|
|
27077
|
+
return _ref5.apply(this, arguments);
|
|
27078
|
+
};
|
|
27079
|
+
}();
|
|
27080
|
+
// 异步获取 originDataSource
|
|
27081
|
+
useEffect(function () {
|
|
27082
|
+
var fetchOriginDataSource = /*#__PURE__*/function () {
|
|
27083
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
27084
|
+
var data;
|
|
27085
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
27086
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
27087
|
+
case 0:
|
|
27088
|
+
_context4.next = 2;
|
|
27089
|
+
return getAllTradeGoodsDetails({
|
|
27090
|
+
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
27091
|
+
});
|
|
27092
|
+
case 2:
|
|
27093
|
+
data = _context4.sent;
|
|
27094
|
+
console.log('fetchOriginDataSource', data);
|
|
27095
|
+
setOriginDataSource(Array.isArray(data) ? data : []);
|
|
27096
|
+
case 5:
|
|
27097
|
+
case "end":
|
|
27098
|
+
return _context4.stop();
|
|
27099
|
+
}
|
|
27100
|
+
}, _callee4);
|
|
27101
|
+
}));
|
|
27102
|
+
return function fetchOriginDataSource() {
|
|
27103
|
+
return _ref6.apply(this, arguments);
|
|
27104
|
+
};
|
|
27105
|
+
}();
|
|
27106
|
+
fetchOriginDataSource();
|
|
27107
|
+
}, [value === null || value === void 0 ? void 0 : value.allOrders, value === null || value === void 0 ? void 0 : value.isStrict, value === null || value === void 0 ? void 0 : value.orderNo, compType]);
|
|
27108
|
+
var selectedGoodsChange = /*#__PURE__*/function () {
|
|
27109
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(skuList) {
|
|
27110
|
+
var _valueRef$current9, _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
|
|
27111
|
+
var newValue, isStrict, originTradeGoodList, currentSelectGoodList;
|
|
27112
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
27113
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
27114
|
+
case 0:
|
|
27115
|
+
newValue = _objectSpread2({}, valueRef.current);
|
|
27116
|
+
isStrict = valueRef.current.isStrict; // 原订单商品
|
|
27117
|
+
_context5.next = 4;
|
|
27118
|
+
return getAllTradeGoodsDetails({
|
|
27119
|
+
mode: isStrict
|
|
27120
|
+
});
|
|
27121
|
+
case 4:
|
|
27122
|
+
_context5.t0 = _context5.sent;
|
|
27123
|
+
if (_context5.t0) {
|
|
27124
|
+
_context5.next = 7;
|
|
27125
|
+
break;
|
|
27126
|
+
}
|
|
27127
|
+
_context5.t0 = [];
|
|
27128
|
+
case 7:
|
|
27129
|
+
originTradeGoodList = _context5.t0;
|
|
27130
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
27131
|
+
currentSelectGoodList = ((_valueRef$current9 = valueRef.current) === null || _valueRef$current9 === void 0 ? void 0 : _valueRef$current9["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$2[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.key)]) || [];
|
|
27132
|
+
newValue["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$2[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) {
|
|
27133
|
+
return skuList.includes(item.uuid);
|
|
27134
|
+
});
|
|
27135
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
27136
|
+
case 11:
|
|
27137
|
+
case "end":
|
|
27138
|
+
return _context5.stop();
|
|
27139
|
+
}
|
|
27140
|
+
}, _callee5);
|
|
27141
|
+
}));
|
|
27142
|
+
return function selectedGoodsChange(_x4) {
|
|
27143
|
+
return _ref7.apply(this, arguments);
|
|
27144
|
+
};
|
|
27145
|
+
}();
|
|
26909
27146
|
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
26910
27147
|
var getDataSourceAsync = function getDataSourceAsync() {
|
|
26911
|
-
var _componentMap$
|
|
26912
|
-
return (value === null || value === void 0 ? void 0 : value.orderNo) ? (_componentMap$
|
|
27148
|
+
var _componentMap$compTyp5;
|
|
27149
|
+
return (value === null || value === void 0 ? void 0 : value.orderNo) ? (_componentMap$compTyp5 = componentMap$2[compType]) === null || _componentMap$compTyp5 === void 0 ? void 0 : _componentMap$compTyp5.getOrderList(value === null || value === void 0 ? void 0 : value.orderNo).then(function (data) {
|
|
26913
27150
|
var list = processAllOrders({
|
|
26914
27151
|
data: data,
|
|
26915
27152
|
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
26916
27153
|
type: compType
|
|
26917
27154
|
});
|
|
27155
|
+
console.log('getDataSourceAsync', list);
|
|
26918
27156
|
onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
26919
27157
|
allOrders: list || []
|
|
26920
27158
|
}));
|
|
@@ -26942,11 +27180,9 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26942
27180
|
isStrict: value === null || value === void 0 ? void 0 : value.isStrict,
|
|
26943
27181
|
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
26944
27182
|
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
26945
|
-
showChangeBtn: (_componentMap$
|
|
27183
|
+
showChangeBtn: (_componentMap$compTyp6 = componentMap$2[compType]) === null || _componentMap$compTyp6 === void 0 ? void 0 : _componentMap$compTyp6.showChangeBtn,
|
|
26946
27184
|
tradeGoods: {
|
|
26947
|
-
originDataSource:
|
|
26948
|
-
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
26949
|
-
}),
|
|
27185
|
+
originDataSource: originDataSource,
|
|
26950
27186
|
getDataSourceAsync: getDataSourceAsync,
|
|
26951
27187
|
selectedGoodsChange: selectedGoodsChange
|
|
26952
27188
|
}
|
package/dist/index.js
CHANGED
|
@@ -21741,6 +21741,16 @@ var getColumns$6 = function getColumns(_ref) {
|
|
|
21741
21741
|
title: "\u5546\u54C1\u7C7B\u578B",
|
|
21742
21742
|
width: 150,
|
|
21743
21743
|
render: renderTextEllipsis
|
|
21744
|
+
}, {
|
|
21745
|
+
dataIndex: 'supplierName',
|
|
21746
|
+
title: "\u4F9B\u5E94\u5546\u540D\u79F0",
|
|
21747
|
+
width: 150,
|
|
21748
|
+
render: renderTextEllipsis
|
|
21749
|
+
}, {
|
|
21750
|
+
dataIndex: 'supplierCode',
|
|
21751
|
+
title: "\u4F9B\u5E94\u5546\u7F16\u7801",
|
|
21752
|
+
width: 150,
|
|
21753
|
+
render: renderTextEllipsis
|
|
21744
21754
|
}].map(function (item) {
|
|
21745
21755
|
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
21746
21756
|
align: 'center',
|
|
@@ -21868,6 +21878,16 @@ var getColumns$6 = function getColumns(_ref) {
|
|
|
21868
21878
|
title: "\u5546\u54C1\u7C7B\u578B",
|
|
21869
21879
|
width: 150,
|
|
21870
21880
|
render: renderTextEllipsis
|
|
21881
|
+
}, {
|
|
21882
|
+
dataIndex: 'supplierName',
|
|
21883
|
+
title: "\u4F9B\u5E94\u5546\u540D\u79F0",
|
|
21884
|
+
width: 150,
|
|
21885
|
+
render: renderTextEllipsis
|
|
21886
|
+
}, {
|
|
21887
|
+
dataIndex: 'supplierCode',
|
|
21888
|
+
title: "\u4F9B\u5E94\u5546\u7F16\u7801",
|
|
21889
|
+
width: 150,
|
|
21890
|
+
render: renderTextEllipsis
|
|
21871
21891
|
}, {
|
|
21872
21892
|
dataIndex: 'sysPicPath',
|
|
21873
21893
|
title: "\u5546\u54C1\u56FE\u7247",
|
|
@@ -23540,23 +23560,75 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
23540
23560
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
23541
23561
|
tradeGoodsVisible = _useState4[0],
|
|
23542
23562
|
setTradeGoodsVisible = _useState4[1];
|
|
23543
|
-
var
|
|
23544
|
-
|
|
23545
|
-
|
|
23546
|
-
return
|
|
23547
|
-
|
|
23548
|
-
|
|
23549
|
-
|
|
23550
|
-
|
|
23551
|
-
|
|
23552
|
-
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
|
|
23556
|
-
|
|
23557
|
-
|
|
23558
|
-
|
|
23559
|
-
|
|
23563
|
+
var getKmSupplier = /*#__PURE__*/function () {
|
|
23564
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(dataSource) {
|
|
23565
|
+
var systemItemIds, supplierMap;
|
|
23566
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
23567
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23568
|
+
case 0:
|
|
23569
|
+
systemItemIds = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
23570
|
+
return item.sysItemId;
|
|
23571
|
+
});
|
|
23572
|
+
_context.next = 3;
|
|
23573
|
+
return kmkfUtils.servers.KM.getSupplierSingleton(systemItemIds);
|
|
23574
|
+
case 3:
|
|
23575
|
+
supplierMap = _context.sent;
|
|
23576
|
+
dataSource === null || dataSource === void 0 ? void 0 : dataSource.forEach(function (item) {
|
|
23577
|
+
var supplierInfo = supplierMap.get(item.sysItemId);
|
|
23578
|
+
item.supplierCode = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierCode;
|
|
23579
|
+
item.supplierName = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierName;
|
|
23580
|
+
});
|
|
23581
|
+
case 5:
|
|
23582
|
+
case "end":
|
|
23583
|
+
return _context.stop();
|
|
23584
|
+
}
|
|
23585
|
+
}, _callee);
|
|
23586
|
+
}));
|
|
23587
|
+
return function getKmSupplier(_x) {
|
|
23588
|
+
return _ref2.apply(this, arguments);
|
|
23589
|
+
};
|
|
23590
|
+
}();
|
|
23591
|
+
var openModal = /*#__PURE__*/function () {
|
|
23592
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
23593
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
23594
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
23595
|
+
case 0:
|
|
23596
|
+
if (!validSystemOrder) {
|
|
23597
|
+
_context2.next = 3;
|
|
23598
|
+
break;
|
|
23599
|
+
}
|
|
23600
|
+
antd.message.warning('请选择补发系统单');
|
|
23601
|
+
return _context2.abrupt("return");
|
|
23602
|
+
case 3:
|
|
23603
|
+
if (!(getDataSourceAsync && !(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length))) {
|
|
23604
|
+
_context2.next = 6;
|
|
23605
|
+
break;
|
|
23606
|
+
}
|
|
23607
|
+
_context2.next = 6;
|
|
23608
|
+
return getDataSourceAsync();
|
|
23609
|
+
case 6:
|
|
23610
|
+
if (!['KM_GOODS', 'KM_REISSUE_GOODS'].includes(type)) {
|
|
23611
|
+
_context2.next = 9;
|
|
23612
|
+
break;
|
|
23613
|
+
}
|
|
23614
|
+
_context2.next = 9;
|
|
23615
|
+
return getKmSupplier(dataSource);
|
|
23616
|
+
case 9:
|
|
23617
|
+
setTradeGoodsVisible(true);
|
|
23618
|
+
// 补发直接传入的是systemNo
|
|
23619
|
+
if (isShowSelect && isReissueType) {
|
|
23620
|
+
setSelectSystemNo(selectedSystemOrders || []);
|
|
23621
|
+
}
|
|
23622
|
+
case 11:
|
|
23623
|
+
case "end":
|
|
23624
|
+
return _context2.stop();
|
|
23625
|
+
}
|
|
23626
|
+
}, _callee2);
|
|
23627
|
+
}));
|
|
23628
|
+
return function openModal() {
|
|
23629
|
+
return _ref3.apply(this, arguments);
|
|
23630
|
+
};
|
|
23631
|
+
}();
|
|
23560
23632
|
var closeModal = function closeModal() {
|
|
23561
23633
|
return setTradeGoodsVisible(false);
|
|
23562
23634
|
};
|
|
@@ -23880,9 +23952,9 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
23880
23952
|
var COLUMNS_INFO = COLUMNS_MAP(text);
|
|
23881
23953
|
return COLUMNS_INFO(type);
|
|
23882
23954
|
};
|
|
23883
|
-
var getShowFilterColumns = React.useCallback(function (
|
|
23884
|
-
var showHeader =
|
|
23885
|
-
initBaseInfoColumns =
|
|
23955
|
+
var getShowFilterColumns = React.useCallback(function (_ref4) {
|
|
23956
|
+
var showHeader = _ref4.showHeader,
|
|
23957
|
+
initBaseInfoColumns = _ref4.initBaseInfoColumns;
|
|
23886
23958
|
var baseInfoColumns = [];
|
|
23887
23959
|
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === 'string';
|
|
23888
23960
|
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === '[object Object]';
|
|
@@ -26725,7 +26797,7 @@ var componentMap$2 = {
|
|
|
26725
26797
|
}
|
|
26726
26798
|
};
|
|
26727
26799
|
var CommonGoods = function CommonGoods(props) {
|
|
26728
|
-
var
|
|
26800
|
+
var _withInfo$current3, _withInfo$current4, _componentMap$compTyp6;
|
|
26729
26801
|
var value = props.value,
|
|
26730
26802
|
disabled = props.disabled,
|
|
26731
26803
|
onChange = props.onChange,
|
|
@@ -26741,6 +26813,10 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26741
26813
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26742
26814
|
tableSelect = _useState2[0],
|
|
26743
26815
|
setTableSelect = _useState2[1];
|
|
26816
|
+
var _useState3 = React.useState([]),
|
|
26817
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
26818
|
+
originDataSource = _useState4[0],
|
|
26819
|
+
setOriginDataSource = _useState4[1];
|
|
26744
26820
|
var withInfo = React.useRef(null);
|
|
26745
26821
|
var valueRef = React.useRef(null);
|
|
26746
26822
|
var tokens = React.useRef([]);
|
|
@@ -26752,10 +26828,90 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26752
26828
|
compType.indexOf('WDT') > -1 && getWdtOrderList(value === null || value === void 0 ? void 0 : value.orderNo);
|
|
26753
26829
|
}
|
|
26754
26830
|
}, [value]);
|
|
26831
|
+
var sysItemIdMap = React.useMemo(function () {
|
|
26832
|
+
var map = {};
|
|
26833
|
+
if (compType.indexOf('KM') > -1) {
|
|
26834
|
+
var _value$kmGoods;
|
|
26835
|
+
value === null || value === void 0 ? void 0 : (_value$kmGoods = value.kmGoods) === null || _value$kmGoods === void 0 ? void 0 : _value$kmGoods.forEach(function (item) {
|
|
26836
|
+
map[item.sysItemId] = item;
|
|
26837
|
+
});
|
|
26838
|
+
}
|
|
26839
|
+
return map;
|
|
26840
|
+
}, [value === null || value === void 0 ? void 0 : value.kmGoods]);
|
|
26841
|
+
// 用于跟踪已经处理过的 sysItemId,避免重复处理
|
|
26842
|
+
var processedSysItemIdsRef = React.useRef(new Set());
|
|
26843
|
+
React.useEffect(function () {
|
|
26844
|
+
var fetchSupplier = /*#__PURE__*/function () {
|
|
26845
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(sysItemIds) {
|
|
26846
|
+
var _currentValue$kmGoods;
|
|
26847
|
+
var needFetchIds, supplierMap, hasChange, currentValue, kmGoods;
|
|
26848
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26849
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26850
|
+
case 0:
|
|
26851
|
+
if (sysItemIds.length) {
|
|
26852
|
+
_context.next = 2;
|
|
26853
|
+
break;
|
|
26854
|
+
}
|
|
26855
|
+
return _context.abrupt("return");
|
|
26856
|
+
case 2:
|
|
26857
|
+
// 过滤出还没有供应商信息的 sysItemId
|
|
26858
|
+
needFetchIds = sysItemIds.filter(function (id) {
|
|
26859
|
+
var item = sysItemIdMap[id];
|
|
26860
|
+
return item && (!item.supplierCode || !item.supplierName);
|
|
26861
|
+
});
|
|
26862
|
+
if (needFetchIds.length) {
|
|
26863
|
+
_context.next = 5;
|
|
26864
|
+
break;
|
|
26865
|
+
}
|
|
26866
|
+
return _context.abrupt("return");
|
|
26867
|
+
case 5:
|
|
26868
|
+
_context.next = 7;
|
|
26869
|
+
return kmkfUtils.servers.KM.getSupplierSingleton(needFetchIds);
|
|
26870
|
+
case 7:
|
|
26871
|
+
supplierMap = _context.sent;
|
|
26872
|
+
// 检查是否有实际变化,避免不必要的更新
|
|
26873
|
+
hasChange = false;
|
|
26874
|
+
currentValue = valueRef.current;
|
|
26875
|
+
kmGoods = currentValue === null || currentValue === void 0 ? void 0 : (_currentValue$kmGoods = currentValue.kmGoods) === null || _currentValue$kmGoods === void 0 ? void 0 : _currentValue$kmGoods.map(function (item) {
|
|
26876
|
+
var supplierInfo = supplierMap.get(item.sysItemId);
|
|
26877
|
+
var newSupplierCode = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierCode;
|
|
26878
|
+
var newSupplierName = supplierInfo === null || supplierInfo === void 0 ? void 0 : supplierInfo.supplierName;
|
|
26879
|
+
// 如果供应商信息有变化,标记需要更新
|
|
26880
|
+
if (newSupplierCode && item.supplierCode !== newSupplierCode || newSupplierName && item.supplierName !== newSupplierName) {
|
|
26881
|
+
hasChange = true;
|
|
26882
|
+
// 标记已处理
|
|
26883
|
+
processedSysItemIdsRef.current.add(item.sysItemId);
|
|
26884
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
26885
|
+
supplierCode: newSupplierCode || item.supplierCode,
|
|
26886
|
+
supplierName: newSupplierName || item.supplierName
|
|
26887
|
+
});
|
|
26888
|
+
}
|
|
26889
|
+
return item;
|
|
26890
|
+
}); // 只在有实际变化时才更新
|
|
26891
|
+
if (hasChange && kmGoods) {
|
|
26892
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, currentValue), {}, {
|
|
26893
|
+
kmGoods: kmGoods
|
|
26894
|
+
}));
|
|
26895
|
+
}
|
|
26896
|
+
case 12:
|
|
26897
|
+
case "end":
|
|
26898
|
+
return _context.stop();
|
|
26899
|
+
}
|
|
26900
|
+
}, _callee);
|
|
26901
|
+
}));
|
|
26902
|
+
return function fetchSupplier(_x) {
|
|
26903
|
+
return _ref.apply(this, arguments);
|
|
26904
|
+
};
|
|
26905
|
+
}();
|
|
26906
|
+
var sysItemIds = Object.keys(sysItemIdMap);
|
|
26907
|
+
if (sysItemIds === null || sysItemIds === void 0 ? void 0 : sysItemIds.length) {
|
|
26908
|
+
fetchSupplier(sysItemIds);
|
|
26909
|
+
}
|
|
26910
|
+
}, [sysItemIdMap]);
|
|
26755
26911
|
var getWdtOrderList = /*#__PURE__*/function () {
|
|
26756
|
-
var
|
|
26757
|
-
return _regeneratorRuntime().wrap(function
|
|
26758
|
-
while (1) switch (
|
|
26912
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderNo) {
|
|
26913
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
26914
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
26759
26915
|
case 0:
|
|
26760
26916
|
wdtUtils.getWdtOrderListSingleton(orderNo).then(function (data) {
|
|
26761
26917
|
var orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).filter(function (trade) {
|
|
@@ -26768,12 +26924,12 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26768
26924
|
});
|
|
26769
26925
|
case 1:
|
|
26770
26926
|
case "end":
|
|
26771
|
-
return
|
|
26927
|
+
return _context2.stop();
|
|
26772
26928
|
}
|
|
26773
|
-
},
|
|
26929
|
+
}, _callee2);
|
|
26774
26930
|
}));
|
|
26775
|
-
return function getWdtOrderList(
|
|
26776
|
-
return
|
|
26931
|
+
return function getWdtOrderList(_x2) {
|
|
26932
|
+
return _ref2.apply(this, arguments);
|
|
26777
26933
|
};
|
|
26778
26934
|
}();
|
|
26779
26935
|
React.useEffect(function () {
|
|
@@ -26879,8 +27035,8 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26879
27035
|
mode: isStrict
|
|
26880
27036
|
}))));
|
|
26881
27037
|
};
|
|
26882
|
-
var getGoodDetails = function getGoodDetails(
|
|
26883
|
-
var mode =
|
|
27038
|
+
var getGoodDetails = function getGoodDetails(_ref3) {
|
|
27039
|
+
var mode = _ref3.mode;
|
|
26884
27040
|
var updateHandle = componentMap$2[compType].eventNameMap['updateGoodsHandle'];
|
|
26885
27041
|
if (!updateHandle) return [];
|
|
26886
27042
|
var goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.orders) || [], {
|
|
@@ -26892,44 +27048,126 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26892
27048
|
return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp = componentMap$2[compType]) === null || _componentMap$compTyp === void 0 ? void 0 : _componentMap$compTyp.goodDetailOrderNo]) === orderNo;
|
|
26893
27049
|
}) : goodDetails;
|
|
26894
27050
|
};
|
|
27051
|
+
// const getKmSupplier = async (list: any[]) => {
|
|
27052
|
+
// const systemItemIds = list?.map((item) => item.sysItemId);
|
|
27053
|
+
// const supplierMap = await servers.KM.getSupplierSingleton(systemItemIds);
|
|
27054
|
+
// list?.forEach((item) => {
|
|
27055
|
+
// const supplierInfo = supplierMap.get(item.sysItemId);
|
|
27056
|
+
// item.supplierCode = supplierInfo?.supplierCode;
|
|
27057
|
+
// item.supplierName = supplierInfo?.supplierName;
|
|
27058
|
+
// });
|
|
27059
|
+
// };
|
|
26895
27060
|
// 找到该订单号下所有商品
|
|
26896
|
-
var getAllTradeGoodsDetails = function
|
|
26897
|
-
var
|
|
26898
|
-
|
|
26899
|
-
|
|
26900
|
-
|
|
26901
|
-
|
|
26902
|
-
|
|
26903
|
-
|
|
26904
|
-
|
|
26905
|
-
|
|
26906
|
-
|
|
26907
|
-
|
|
26908
|
-
|
|
26909
|
-
|
|
26910
|
-
|
|
26911
|
-
|
|
26912
|
-
|
|
26913
|
-
|
|
26914
|
-
|
|
26915
|
-
|
|
26916
|
-
|
|
26917
|
-
|
|
26918
|
-
|
|
26919
|
-
|
|
26920
|
-
|
|
26921
|
-
|
|
26922
|
-
|
|
26923
|
-
|
|
27061
|
+
var getAllTradeGoodsDetails = /*#__PURE__*/function () {
|
|
27062
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref4) {
|
|
27063
|
+
var mode, updateHandle, goodDetails, orderNo;
|
|
27064
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
27065
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
27066
|
+
case 0:
|
|
27067
|
+
mode = _ref4.mode;
|
|
27068
|
+
updateHandle = componentMap$2[compType].eventNameMap['updateGoodsHandle'];
|
|
27069
|
+
if (updateHandle) {
|
|
27070
|
+
_context3.next = 4;
|
|
27071
|
+
break;
|
|
27072
|
+
}
|
|
27073
|
+
return _context3.abrupt("return", []);
|
|
27074
|
+
case 4:
|
|
27075
|
+
goodDetails = updateHandle((value === null || value === void 0 ? void 0 : value.allOrders) || [], {
|
|
27076
|
+
orderBackGoodsLevel: props.orderBackGoodsLevel
|
|
27077
|
+
});
|
|
27078
|
+
orderNo = value === null || value === void 0 ? void 0 : value.orderNo; // if (['KM_GOODS', 'KM_REISSUE_GOODS'].includes(compType)) {
|
|
27079
|
+
// await getKmSupplier(goodDetails);
|
|
27080
|
+
// }
|
|
27081
|
+
return _context3.abrupt("return", mode ? goodDetails.filter(function (goodItem) {
|
|
27082
|
+
var _componentMap$compTyp2;
|
|
27083
|
+
return !orderNo || (goodItem === null || goodItem === void 0 ? void 0 : goodItem[(_componentMap$compTyp2 = componentMap$2[compType]) === null || _componentMap$compTyp2 === void 0 ? void 0 : _componentMap$compTyp2.goodDetailOrderNo]) === orderNo;
|
|
27084
|
+
}) : goodDetails);
|
|
27085
|
+
case 7:
|
|
27086
|
+
case "end":
|
|
27087
|
+
return _context3.stop();
|
|
27088
|
+
}
|
|
27089
|
+
}, _callee3);
|
|
27090
|
+
}));
|
|
27091
|
+
return function getAllTradeGoodsDetails(_x3) {
|
|
27092
|
+
return _ref5.apply(this, arguments);
|
|
27093
|
+
};
|
|
27094
|
+
}();
|
|
27095
|
+
// 异步获取 originDataSource
|
|
27096
|
+
React.useEffect(function () {
|
|
27097
|
+
var fetchOriginDataSource = /*#__PURE__*/function () {
|
|
27098
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
27099
|
+
var data;
|
|
27100
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
27101
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
27102
|
+
case 0:
|
|
27103
|
+
_context4.next = 2;
|
|
27104
|
+
return getAllTradeGoodsDetails({
|
|
27105
|
+
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
27106
|
+
});
|
|
27107
|
+
case 2:
|
|
27108
|
+
data = _context4.sent;
|
|
27109
|
+
console.log('fetchOriginDataSource', data);
|
|
27110
|
+
setOriginDataSource(Array.isArray(data) ? data : []);
|
|
27111
|
+
case 5:
|
|
27112
|
+
case "end":
|
|
27113
|
+
return _context4.stop();
|
|
27114
|
+
}
|
|
27115
|
+
}, _callee4);
|
|
27116
|
+
}));
|
|
27117
|
+
return function fetchOriginDataSource() {
|
|
27118
|
+
return _ref6.apply(this, arguments);
|
|
27119
|
+
};
|
|
27120
|
+
}();
|
|
27121
|
+
fetchOriginDataSource();
|
|
27122
|
+
}, [value === null || value === void 0 ? void 0 : value.allOrders, value === null || value === void 0 ? void 0 : value.isStrict, value === null || value === void 0 ? void 0 : value.orderNo, compType]);
|
|
27123
|
+
var selectedGoodsChange = /*#__PURE__*/function () {
|
|
27124
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(skuList) {
|
|
27125
|
+
var _valueRef$current9, _componentMap$compTyp3, _componentMap$compTyp4, _uniqBy;
|
|
27126
|
+
var newValue, isStrict, originTradeGoodList, currentSelectGoodList;
|
|
27127
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
27128
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
27129
|
+
case 0:
|
|
27130
|
+
newValue = _objectSpread2({}, valueRef.current);
|
|
27131
|
+
isStrict = valueRef.current.isStrict; // 原订单商品
|
|
27132
|
+
_context5.next = 4;
|
|
27133
|
+
return getAllTradeGoodsDetails({
|
|
27134
|
+
mode: isStrict
|
|
27135
|
+
});
|
|
27136
|
+
case 4:
|
|
27137
|
+
_context5.t0 = _context5.sent;
|
|
27138
|
+
if (_context5.t0) {
|
|
27139
|
+
_context5.next = 7;
|
|
27140
|
+
break;
|
|
27141
|
+
}
|
|
27142
|
+
_context5.t0 = [];
|
|
27143
|
+
case 7:
|
|
27144
|
+
originTradeGoodList = _context5.t0;
|
|
27145
|
+
// 当前选中的所有商品【包含了原订单+商品库】
|
|
27146
|
+
currentSelectGoodList = ((_valueRef$current9 = valueRef.current) === null || _valueRef$current9 === void 0 ? void 0 : _valueRef$current9["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp3 = componentMap$2[compType]) === null || _componentMap$compTyp3 === void 0 ? void 0 : _componentMap$compTyp3.key)]) || [];
|
|
27147
|
+
newValue["".concat(componentMap$2 === null || componentMap$2 === void 0 ? void 0 : (_componentMap$compTyp4 = componentMap$2[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) {
|
|
27148
|
+
return skuList.includes(item.uuid);
|
|
27149
|
+
});
|
|
27150
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
27151
|
+
case 11:
|
|
27152
|
+
case "end":
|
|
27153
|
+
return _context5.stop();
|
|
27154
|
+
}
|
|
27155
|
+
}, _callee5);
|
|
27156
|
+
}));
|
|
27157
|
+
return function selectedGoodsChange(_x4) {
|
|
27158
|
+
return _ref7.apply(this, arguments);
|
|
27159
|
+
};
|
|
27160
|
+
}();
|
|
26924
27161
|
// 商品信息组件暂存后 重新编辑,此时需要重新获取订单下所有系统自订单的商品信息
|
|
26925
27162
|
var getDataSourceAsync = function getDataSourceAsync() {
|
|
26926
|
-
var _componentMap$
|
|
26927
|
-
return (value === null || value === void 0 ? void 0 : value.orderNo) ? (_componentMap$
|
|
27163
|
+
var _componentMap$compTyp5;
|
|
27164
|
+
return (value === null || value === void 0 ? void 0 : value.orderNo) ? (_componentMap$compTyp5 = componentMap$2[compType]) === null || _componentMap$compTyp5 === void 0 ? void 0 : _componentMap$compTyp5.getOrderList(value === null || value === void 0 ? void 0 : value.orderNo).then(function (data) {
|
|
26928
27165
|
var list = processAllOrders({
|
|
26929
27166
|
data: data,
|
|
26930
27167
|
orderNo: value === null || value === void 0 ? void 0 : value.orderNo,
|
|
26931
27168
|
type: compType
|
|
26932
27169
|
});
|
|
27170
|
+
console.log('getDataSourceAsync', list);
|
|
26933
27171
|
onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
26934
27172
|
allOrders: list || []
|
|
26935
27173
|
}));
|
|
@@ -26957,11 +27195,9 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
26957
27195
|
isStrict: value === null || value === void 0 ? void 0 : value.isStrict,
|
|
26958
27196
|
systemOrders: value === null || value === void 0 ? void 0 : value.allOrders,
|
|
26959
27197
|
selectedSystemOrders: value === null || value === void 0 ? void 0 : value.orders,
|
|
26960
|
-
showChangeBtn: (_componentMap$
|
|
27198
|
+
showChangeBtn: (_componentMap$compTyp6 = componentMap$2[compType]) === null || _componentMap$compTyp6 === void 0 ? void 0 : _componentMap$compTyp6.showChangeBtn,
|
|
26961
27199
|
tradeGoods: {
|
|
26962
|
-
originDataSource:
|
|
26963
|
-
mode: value === null || value === void 0 ? void 0 : value.isStrict
|
|
26964
|
-
}),
|
|
27200
|
+
originDataSource: originDataSource,
|
|
26965
27201
|
getDataSourceAsync: getDataSourceAsync,
|
|
26966
27202
|
selectedGoodsChange: selectedGoodsChange
|
|
26967
27203
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "2.2.39-beta.
|
|
3
|
+
"version": "2.2.39-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.2.39-beta.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "2.2.39-beta.25",
|
|
24
24
|
"ahooks": "^3.7.4",
|
|
25
25
|
"ali-react-table": "2.6.1",
|
|
26
26
|
"bignumber.js": "^9.1.2",
|
|
@@ -66,5 +66,5 @@
|
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "00f8091914491ce979d84162aed8002be14f3cc8"
|
|
70
70
|
}
|