@kmkf-fe-packages/basic-components 0.23.1-beta.1 → 0.23.1-beta.3
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 +367 -19
- package/dist/index.js +365 -16
- package/dist/src/business/LogisticsMoreTrajectory/index.d.ts +3 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +6 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
|
|
2
2
|
import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Popover, Table } from 'antd';
|
|
3
|
-
import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
|
|
3
|
+
import { EyeOutlined, DeleteOutlined, CaretUpOutlined } from '@ant-design/icons';
|
|
4
4
|
import request, { extend as extend$1 } from 'umi-request';
|
|
5
5
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
6
|
-
import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, LogisticsAddressData, uuid, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
|
|
6
|
+
import { AddressData, BsAddressData, WdtAddressData, toTree, request as request$1, ExpressData, LogisticsAddressData, uuid, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
|
|
7
7
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
8
|
+
import { cloneDeep, difference, differenceWith } from 'lodash';
|
|
9
|
+
import { useDebounceEffect } from 'ahooks';
|
|
8
10
|
import pubsub from 'pubsub-js';
|
|
9
|
-
import { cloneDeep } from 'lodash';
|
|
10
11
|
|
|
11
12
|
function _iterableToArrayLimit(arr, i) {
|
|
12
13
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
@@ -7357,12 +7358,13 @@ function ApaasRate(props) {
|
|
|
7357
7358
|
}));
|
|
7358
7359
|
}
|
|
7359
7360
|
|
|
7360
|
-
AddressData.getInstance();
|
|
7361
|
-
BsAddressData.getInstance();
|
|
7362
|
-
WdtAddressData.getInstance();
|
|
7361
|
+
var addressData = AddressData.getInstance();
|
|
7362
|
+
var bsAddressData = BsAddressData.getInstance();
|
|
7363
|
+
var wdtAddressData = WdtAddressData.getInstance();
|
|
7363
7364
|
var Province = function Province(props) {
|
|
7364
7365
|
var _props$type = props.type,
|
|
7365
|
-
type = _props$type === void 0 ? 'workOrder' : _props$type
|
|
7366
|
+
type = _props$type === void 0 ? 'workOrder' : _props$type,
|
|
7367
|
+
value = props.value;
|
|
7366
7368
|
var _useState = useState([]),
|
|
7367
7369
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7368
7370
|
option = _useState2[0],
|
|
@@ -7378,10 +7380,10 @@ var Province = function Province(props) {
|
|
|
7378
7380
|
case 0:
|
|
7379
7381
|
num++;
|
|
7380
7382
|
options = ({
|
|
7381
|
-
bs:
|
|
7382
|
-
wdt:
|
|
7383
|
-
workOrder:
|
|
7384
|
-
}[type] ||
|
|
7383
|
+
bs: bsAddressData,
|
|
7384
|
+
wdt: wdtAddressData,
|
|
7385
|
+
workOrder: addressData
|
|
7386
|
+
}[type] || addressData).addressOptions || [];
|
|
7385
7387
|
if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
|
|
7386
7388
|
time.current = setTimeout(function () {
|
|
7387
7389
|
initPageSource();
|
|
@@ -7398,6 +7400,19 @@ var Province = function Province(props) {
|
|
|
7398
7400
|
return _ref.apply(this, arguments);
|
|
7399
7401
|
};
|
|
7400
7402
|
}();
|
|
7403
|
+
var getBsAddress = function getBsAddress() {
|
|
7404
|
+
var data = JSON.parse(localStorage.getItem('bsAddressData') || '[]');
|
|
7405
|
+
if (data.length) {
|
|
7406
|
+
var options = toTree(data, 1);
|
|
7407
|
+
setOptions(options);
|
|
7408
|
+
}
|
|
7409
|
+
};
|
|
7410
|
+
//如果值改变地址不存在则再获取一遍
|
|
7411
|
+
useEffect(function () {
|
|
7412
|
+
if (value && type == 'bs' && !option.length) {
|
|
7413
|
+
getBsAddress();
|
|
7414
|
+
}
|
|
7415
|
+
}, [value, type, option]);
|
|
7401
7416
|
useEffect(function () {
|
|
7402
7417
|
if (!isFirst.current) {
|
|
7403
7418
|
initPageSource();
|
|
@@ -9623,8 +9638,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9623
9638
|
};
|
|
9624
9639
|
|
|
9625
9640
|
var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
9626
|
-
var
|
|
9627
|
-
showField = props.showField,
|
|
9641
|
+
var showField = props.showField,
|
|
9628
9642
|
_props$value = props.value,
|
|
9629
9643
|
value = _props$value === void 0 ? {} : _props$value,
|
|
9630
9644
|
disabled = props.disabled,
|
|
@@ -9755,6 +9769,220 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9755
9769
|
return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
|
|
9756
9770
|
};
|
|
9757
9771
|
|
|
9772
|
+
var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
|
|
9773
|
+
var showField = props.showField,
|
|
9774
|
+
_props$value = props.value,
|
|
9775
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
9776
|
+
disabled = props.disabled,
|
|
9777
|
+
onChange = props.onChange;
|
|
9778
|
+
var _useState = useState([]),
|
|
9779
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9780
|
+
newValue = _useState2[0],
|
|
9781
|
+
setNewValue = _useState2[1];
|
|
9782
|
+
var _useState3 = useState(0),
|
|
9783
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9784
|
+
changeIndex = _useState4[0],
|
|
9785
|
+
setChangeIndex = _useState4[1];
|
|
9786
|
+
var _useState5 = useState([]),
|
|
9787
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9788
|
+
initValue = _useState6[0],
|
|
9789
|
+
setInitValue = _useState6[1];
|
|
9790
|
+
var _useState7 = useState([]),
|
|
9791
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
9792
|
+
changeValue = _useState8[0],
|
|
9793
|
+
setChangeValue = _useState8[1];
|
|
9794
|
+
var firstRef = useRef(true);
|
|
9795
|
+
var hasSave = useRef(false);
|
|
9796
|
+
useEffect(function () {
|
|
9797
|
+
if (value.length && firstRef.current) {
|
|
9798
|
+
setInitValue(value);
|
|
9799
|
+
firstRef.current = false;
|
|
9800
|
+
}
|
|
9801
|
+
}, [value]);
|
|
9802
|
+
useDebounceEffect(function () {
|
|
9803
|
+
initHandle({
|
|
9804
|
+
initValue: initValue,
|
|
9805
|
+
value: value
|
|
9806
|
+
});
|
|
9807
|
+
}, [initValue, value], {
|
|
9808
|
+
wait: 500
|
|
9809
|
+
});
|
|
9810
|
+
var initHandle = /*#__PURE__*/function () {
|
|
9811
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
9812
|
+
var initValue, value, hasSnapshot, initList, valueList, changeList, initSnapshotList, valueSnapshotList, hasValue, listValue, requestList, requestValues;
|
|
9813
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9814
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9815
|
+
case 0:
|
|
9816
|
+
initValue = _ref.initValue, value = _ref.value;
|
|
9817
|
+
hasSnapshot = showField && showField.includes('snapshot');
|
|
9818
|
+
initList = initValue.map(function (item) {
|
|
9819
|
+
if (item.trajectoryCompany === 'SF') {
|
|
9820
|
+
return {
|
|
9821
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9822
|
+
trajectoryCode: item.trajectoryCode,
|
|
9823
|
+
trajectoryPhone: item.trajectoryPhone
|
|
9824
|
+
};
|
|
9825
|
+
} else {
|
|
9826
|
+
return {
|
|
9827
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9828
|
+
trajectoryCode: item.trajectoryCode
|
|
9829
|
+
};
|
|
9830
|
+
}
|
|
9831
|
+
});
|
|
9832
|
+
valueList = value.map(function (item) {
|
|
9833
|
+
if (item.trajectoryCompany === 'SF') {
|
|
9834
|
+
return {
|
|
9835
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9836
|
+
trajectoryCode: item.trajectoryCode,
|
|
9837
|
+
trajectoryPhone: item.trajectoryPhone
|
|
9838
|
+
};
|
|
9839
|
+
} else {
|
|
9840
|
+
return {
|
|
9841
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9842
|
+
trajectoryCode: item.trajectoryCode
|
|
9843
|
+
};
|
|
9844
|
+
}
|
|
9845
|
+
});
|
|
9846
|
+
changeList = changeValue.map(function (item) {
|
|
9847
|
+
if (item.trajectoryCompany === 'SF') {
|
|
9848
|
+
return {
|
|
9849
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9850
|
+
trajectoryCode: item.trajectoryCode,
|
|
9851
|
+
trajectoryPhone: item.trajectoryPhone
|
|
9852
|
+
};
|
|
9853
|
+
} else {
|
|
9854
|
+
return {
|
|
9855
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9856
|
+
trajectoryCode: item.trajectoryCode
|
|
9857
|
+
};
|
|
9858
|
+
}
|
|
9859
|
+
}); // 1、初始值没有 传入值有请求快照
|
|
9860
|
+
// 2、初始值有 传入值有 其中有不一样的请求快照
|
|
9861
|
+
// 3、初始值有 传入值有 都一样的返回初始值
|
|
9862
|
+
console.log('list', initList, valueList, changeList);
|
|
9863
|
+
// console.log('old', initValue, value, changeValue);
|
|
9864
|
+
// console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
|
|
9865
|
+
// console.log(
|
|
9866
|
+
// '一样2',
|
|
9867
|
+
// JSON.stringify(changeList) !== JSON.stringify(valueList),
|
|
9868
|
+
// );
|
|
9869
|
+
if (!(!initList.length && !valueList.length)) {
|
|
9870
|
+
_context.next = 8;
|
|
9871
|
+
break;
|
|
9872
|
+
}
|
|
9873
|
+
return _context.abrupt("return");
|
|
9874
|
+
case 8:
|
|
9875
|
+
if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
|
|
9876
|
+
_context.next = 14;
|
|
9877
|
+
break;
|
|
9878
|
+
}
|
|
9879
|
+
initSnapshotList = initValue.reduce(function (prv, next) {
|
|
9880
|
+
prv += next.trajectorySnapshot;
|
|
9881
|
+
return prv;
|
|
9882
|
+
}, '');
|
|
9883
|
+
valueSnapshotList = value.reduce(function (prv, next) {
|
|
9884
|
+
prv += next.trajectorySnapshot;
|
|
9885
|
+
return prv;
|
|
9886
|
+
}, '');
|
|
9887
|
+
if (initSnapshotList === valueSnapshotList) {
|
|
9888
|
+
hasSave.current = false;
|
|
9889
|
+
setNewValue(value);
|
|
9890
|
+
} else if (!hasSave.current) {
|
|
9891
|
+
hasSave.current = true;
|
|
9892
|
+
setNewValue(initValue);
|
|
9893
|
+
onChange(initValue);
|
|
9894
|
+
}
|
|
9895
|
+
_context.next = 30;
|
|
9896
|
+
break;
|
|
9897
|
+
case 14:
|
|
9898
|
+
if (!(
|
|
9899
|
+
//开启了物流快照才会获取快照信息
|
|
9900
|
+
hasSnapshot && JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
|
|
9901
|
+
_context.next = 29;
|
|
9902
|
+
break;
|
|
9903
|
+
}
|
|
9904
|
+
hasSave.current = false;
|
|
9905
|
+
hasValue = valueList.some(function (item) {
|
|
9906
|
+
return item.trajectoryCompany && item.trajectoryCode;
|
|
9907
|
+
});
|
|
9908
|
+
listValue = cloneDeep(value);
|
|
9909
|
+
if (!hasValue) {
|
|
9910
|
+
_context.next = 24;
|
|
9911
|
+
break;
|
|
9912
|
+
}
|
|
9913
|
+
requestList = valueList.map(function (item) {
|
|
9914
|
+
if (item.trajectoryCode && item.trajectoryCompany) {
|
|
9915
|
+
return extendRequest('/qy/logistics/logisticsTraceSearch', {
|
|
9916
|
+
method: 'post',
|
|
9917
|
+
data: {
|
|
9918
|
+
mailNo: item.trajectoryCode,
|
|
9919
|
+
cpCode: item.trajectoryCompany,
|
|
9920
|
+
mobile: item.trajectoryPhone
|
|
9921
|
+
}
|
|
9922
|
+
});
|
|
9923
|
+
} else {
|
|
9924
|
+
return new Promise(function (resolve) {
|
|
9925
|
+
resolve({});
|
|
9926
|
+
});
|
|
9927
|
+
}
|
|
9928
|
+
});
|
|
9929
|
+
_context.next = 22;
|
|
9930
|
+
return Promise.allSettled(requestList);
|
|
9931
|
+
case 22:
|
|
9932
|
+
requestValues = _context.sent;
|
|
9933
|
+
listValue = cloneDeep(value).map(function (item, index) {
|
|
9934
|
+
var _requestValues$index, _requestValues$index$, _requestValues$index$2;
|
|
9935
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9936
|
+
trajectorySnapshot: (_requestValues$index = requestValues[index]) === null || _requestValues$index === void 0 ? void 0 : (_requestValues$index$ = _requestValues$index.value) === null || _requestValues$index$ === void 0 ? void 0 : (_requestValues$index$2 = _requestValues$index$.data) === null || _requestValues$index$2 === void 0 ? void 0 : _requestValues$index$2.logisticsStatusDesc
|
|
9937
|
+
});
|
|
9938
|
+
});
|
|
9939
|
+
case 24:
|
|
9940
|
+
setChangeValue(listValue);
|
|
9941
|
+
setNewValue(listValue);
|
|
9942
|
+
onChange(listValue);
|
|
9943
|
+
_context.next = 30;
|
|
9944
|
+
break;
|
|
9945
|
+
case 29:
|
|
9946
|
+
setNewValue(value);
|
|
9947
|
+
case 30:
|
|
9948
|
+
case "end":
|
|
9949
|
+
return _context.stop();
|
|
9950
|
+
}
|
|
9951
|
+
}, _callee);
|
|
9952
|
+
}));
|
|
9953
|
+
return function initHandle(_x) {
|
|
9954
|
+
return _ref2.apply(this, arguments);
|
|
9955
|
+
};
|
|
9956
|
+
}();
|
|
9957
|
+
var handleChange = function handleChange(val, index) {
|
|
9958
|
+
var newValue = cloneDeep(value);
|
|
9959
|
+
newValue.splice(index, 1, val);
|
|
9960
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
9961
|
+
setChangeValue(newValue);
|
|
9962
|
+
setNewValue(newValue);
|
|
9963
|
+
};
|
|
9964
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, {
|
|
9965
|
+
wrap: true
|
|
9966
|
+
}, (newValue || []).map(function (item, index) {
|
|
9967
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
9968
|
+
style: {
|
|
9969
|
+
color: changeIndex === index ? '#4569d4' : 'black',
|
|
9970
|
+
cursor: 'pointer'
|
|
9971
|
+
},
|
|
9972
|
+
onClick: function onClick() {
|
|
9973
|
+
return setChangeIndex(index);
|
|
9974
|
+
}
|
|
9975
|
+
}, "\u5305\u88F9".concat(index + 1));
|
|
9976
|
+
})), /*#__PURE__*/React.createElement(LogisticsTrajectory, {
|
|
9977
|
+
value: newValue[changeIndex],
|
|
9978
|
+
showField: showField,
|
|
9979
|
+
disabled: disabled,
|
|
9980
|
+
onChange: function onChange(val) {
|
|
9981
|
+
return handleChange(val, changeIndex);
|
|
9982
|
+
}
|
|
9983
|
+
}));
|
|
9984
|
+
};
|
|
9985
|
+
|
|
9758
9986
|
//组件类型的默认值
|
|
9759
9987
|
var typeInitValueMap = {
|
|
9760
9988
|
1: [{
|
|
@@ -10156,9 +10384,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
10156
10384
|
var rowSelection = {
|
|
10157
10385
|
selectedRowKeys: selectIds,
|
|
10158
10386
|
fixed: true,
|
|
10159
|
-
onChange:
|
|
10160
|
-
|
|
10161
|
-
|
|
10387
|
+
// onChange: (
|
|
10388
|
+
// selectedRowKeys: React.SetStateAction<string[]>,
|
|
10389
|
+
// selectedRows: any[],
|
|
10390
|
+
// info: any,
|
|
10391
|
+
// ) => {
|
|
10392
|
+
// setSelectIds(selectedRowKeys);
|
|
10393
|
+
// setSelect([...selectedRows]);
|
|
10394
|
+
// },
|
|
10395
|
+
onSelect: function onSelect(record, selected) {
|
|
10396
|
+
if (selected) {
|
|
10397
|
+
setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
|
|
10398
|
+
setSelect([].concat(_toConsumableArray(selectList), [record]));
|
|
10399
|
+
} else {
|
|
10400
|
+
setSelectIds(selectIds.filter(function (t) {
|
|
10401
|
+
return t !== record.skuCode;
|
|
10402
|
+
}));
|
|
10403
|
+
setSelect(selectList.filter(function (t) {
|
|
10404
|
+
return t.skuCode !== record.skuCode;
|
|
10405
|
+
}));
|
|
10406
|
+
}
|
|
10407
|
+
},
|
|
10408
|
+
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
|
|
10409
|
+
if (selected) {
|
|
10410
|
+
setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
|
|
10411
|
+
return t.skuCode;
|
|
10412
|
+
}))));
|
|
10413
|
+
setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
|
|
10414
|
+
} else {
|
|
10415
|
+
setSelectIds(difference(selectIds, changeRows.map(function (t) {
|
|
10416
|
+
return t.skuCode;
|
|
10417
|
+
})));
|
|
10418
|
+
var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
|
|
10419
|
+
return arrVal.skuCode !== othVal.skuCode;
|
|
10420
|
+
});
|
|
10421
|
+
setSelect(list);
|
|
10422
|
+
}
|
|
10162
10423
|
}
|
|
10163
10424
|
};
|
|
10164
10425
|
var initData = function initData(list) {
|
|
@@ -10246,6 +10507,86 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
10246
10507
|
});
|
|
10247
10508
|
}
|
|
10248
10509
|
};
|
|
10510
|
+
var showTable = function showTable() {
|
|
10511
|
+
var handleDelete = function handleDelete(record, index) {
|
|
10512
|
+
setSelectIds(selectIds.filter(function (t) {
|
|
10513
|
+
return t !== record.skuCode;
|
|
10514
|
+
}));
|
|
10515
|
+
setSelect(selectList.filter(function (t) {
|
|
10516
|
+
return t.skuCode !== record.skuCode;
|
|
10517
|
+
}));
|
|
10518
|
+
};
|
|
10519
|
+
var showColumns = [{
|
|
10520
|
+
dataIndex: '',
|
|
10521
|
+
title: "\u64CD\u4F5C",
|
|
10522
|
+
ellipsis: true,
|
|
10523
|
+
width: 100,
|
|
10524
|
+
render: function render(val, record, index) {
|
|
10525
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
10526
|
+
type: "link",
|
|
10527
|
+
onClick: function onClick() {
|
|
10528
|
+
return handleDelete(record);
|
|
10529
|
+
}
|
|
10530
|
+
}, "\u5220\u9664");
|
|
10531
|
+
}
|
|
10532
|
+
}, {
|
|
10533
|
+
dataIndex: 'skuName',
|
|
10534
|
+
title: '商品sku名称',
|
|
10535
|
+
with: 200,
|
|
10536
|
+
ellipsis: true
|
|
10537
|
+
}, {
|
|
10538
|
+
dataIndex: 'skuCode',
|
|
10539
|
+
title: '商品sku编码',
|
|
10540
|
+
with: 200,
|
|
10541
|
+
ellipsis: true
|
|
10542
|
+
}, {
|
|
10543
|
+
dataIndex: 'name',
|
|
10544
|
+
title: '商品名称',
|
|
10545
|
+
with: 200,
|
|
10546
|
+
ellipsis: true
|
|
10547
|
+
}, {
|
|
10548
|
+
dataIndex: 'goodsId',
|
|
10549
|
+
title: '商品id',
|
|
10550
|
+
with: 200,
|
|
10551
|
+
ellipsis: true
|
|
10552
|
+
}, {
|
|
10553
|
+
dataIndex: 'code',
|
|
10554
|
+
title: '商品编码',
|
|
10555
|
+
with: 200,
|
|
10556
|
+
render: function render(val) {
|
|
10557
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10558
|
+
style: {
|
|
10559
|
+
width: '100px'
|
|
10560
|
+
}
|
|
10561
|
+
}, val);
|
|
10562
|
+
}
|
|
10563
|
+
}, {
|
|
10564
|
+
dataIndex: 'marketPrice',
|
|
10565
|
+
title: '市场价',
|
|
10566
|
+
render: function render(val) {
|
|
10567
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
10568
|
+
style: {
|
|
10569
|
+
width: '70px'
|
|
10570
|
+
}
|
|
10571
|
+
}, val);
|
|
10572
|
+
}
|
|
10573
|
+
}];
|
|
10574
|
+
return selectList.length ? /*#__PURE__*/React.createElement(Table, {
|
|
10575
|
+
columns: showColumns,
|
|
10576
|
+
rowKey: 'skuCode',
|
|
10577
|
+
dataSource: selectList,
|
|
10578
|
+
scroll: {
|
|
10579
|
+
x: true,
|
|
10580
|
+
y: 250
|
|
10581
|
+
},
|
|
10582
|
+
pagination: {
|
|
10583
|
+
size: 'small',
|
|
10584
|
+
total: selectIds.length,
|
|
10585
|
+
pageSize: pageSize,
|
|
10586
|
+
showSizeChanger: false
|
|
10587
|
+
}
|
|
10588
|
+
}) : null;
|
|
10589
|
+
};
|
|
10249
10590
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
10250
10591
|
title: '选择商品',
|
|
10251
10592
|
okText: '确认',
|
|
@@ -10327,10 +10668,17 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
10327
10668
|
total: total,
|
|
10328
10669
|
current: pageNo,
|
|
10329
10670
|
pageSize: pageSize,
|
|
10330
|
-
|
|
10671
|
+
showSizeChanger: false,
|
|
10672
|
+
showQuickJumper: true,
|
|
10331
10673
|
onChange: pageChange
|
|
10332
10674
|
}
|
|
10333
|
-
})
|
|
10675
|
+
}), /*#__PURE__*/React.createElement(Popover, {
|
|
10676
|
+
content: showTable(),
|
|
10677
|
+
title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
|
|
10678
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
10679
|
+
danger: true,
|
|
10680
|
+
type: "text"
|
|
10681
|
+
}, "\u5DF2\u9009\u62E9\u5546\u54C1(".concat(selectIds.length > 99 ? '99+' : selectIds.length, ")"), /*#__PURE__*/React.createElement(CaretUpOutlined, null)))));
|
|
10334
10682
|
};
|
|
10335
10683
|
var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
|
|
10336
10684
|
|
|
@@ -12250,4 +12598,4 @@ var CalculationInput = function CalculationInput(props) {
|
|
|
12250
12598
|
}, config === null || config === void 0 ? void 0 : config.unit));
|
|
12251
12599
|
};
|
|
12252
12600
|
|
|
12253
|
-
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
|
|
12601
|
+
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
|
package/dist/index.js
CHANGED
|
@@ -9,8 +9,9 @@ var request = require('umi-request');
|
|
|
9
9
|
var reactCopyToClipboard = require('react-copy-to-clipboard');
|
|
10
10
|
var kmkfUtils = require('@kmkf-fe-packages/kmkf-utils');
|
|
11
11
|
var zhCN = require('antd/lib/locale/zh_CN');
|
|
12
|
-
var pubsub = require('pubsub-js');
|
|
13
12
|
var lodash = require('lodash');
|
|
13
|
+
var ahooks = require('ahooks');
|
|
14
|
+
var pubsub = require('pubsub-js');
|
|
14
15
|
|
|
15
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
17
|
|
|
@@ -7368,12 +7369,13 @@ function ApaasRate(props) {
|
|
|
7368
7369
|
}));
|
|
7369
7370
|
}
|
|
7370
7371
|
|
|
7371
|
-
kmkfUtils.AddressData.getInstance();
|
|
7372
|
-
kmkfUtils.BsAddressData.getInstance();
|
|
7373
|
-
kmkfUtils.WdtAddressData.getInstance();
|
|
7372
|
+
var addressData = kmkfUtils.AddressData.getInstance();
|
|
7373
|
+
var bsAddressData = kmkfUtils.BsAddressData.getInstance();
|
|
7374
|
+
var wdtAddressData = kmkfUtils.WdtAddressData.getInstance();
|
|
7374
7375
|
var Province = function Province(props) {
|
|
7375
7376
|
var _props$type = props.type,
|
|
7376
|
-
type = _props$type === void 0 ? 'workOrder' : _props$type
|
|
7377
|
+
type = _props$type === void 0 ? 'workOrder' : _props$type,
|
|
7378
|
+
value = props.value;
|
|
7377
7379
|
var _useState = React.useState([]),
|
|
7378
7380
|
_useState2 = _slicedToArray(_useState, 2),
|
|
7379
7381
|
option = _useState2[0],
|
|
@@ -7389,10 +7391,10 @@ var Province = function Province(props) {
|
|
|
7389
7391
|
case 0:
|
|
7390
7392
|
num++;
|
|
7391
7393
|
options = ({
|
|
7392
|
-
bs:
|
|
7393
|
-
wdt:
|
|
7394
|
-
workOrder:
|
|
7395
|
-
}[type] ||
|
|
7394
|
+
bs: bsAddressData,
|
|
7395
|
+
wdt: wdtAddressData,
|
|
7396
|
+
workOrder: addressData
|
|
7397
|
+
}[type] || addressData).addressOptions || [];
|
|
7396
7398
|
if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
|
|
7397
7399
|
time.current = setTimeout(function () {
|
|
7398
7400
|
initPageSource();
|
|
@@ -7409,6 +7411,19 @@ var Province = function Province(props) {
|
|
|
7409
7411
|
return _ref.apply(this, arguments);
|
|
7410
7412
|
};
|
|
7411
7413
|
}();
|
|
7414
|
+
var getBsAddress = function getBsAddress() {
|
|
7415
|
+
var data = JSON.parse(localStorage.getItem('bsAddressData') || '[]');
|
|
7416
|
+
if (data.length) {
|
|
7417
|
+
var options = kmkfUtils.toTree(data, 1);
|
|
7418
|
+
setOptions(options);
|
|
7419
|
+
}
|
|
7420
|
+
};
|
|
7421
|
+
//如果值改变地址不存在则再获取一遍
|
|
7422
|
+
React.useEffect(function () {
|
|
7423
|
+
if (value && type == 'bs' && !option.length) {
|
|
7424
|
+
getBsAddress();
|
|
7425
|
+
}
|
|
7426
|
+
}, [value, type, option]);
|
|
7412
7427
|
React.useEffect(function () {
|
|
7413
7428
|
if (!isFirst.current) {
|
|
7414
7429
|
initPageSource();
|
|
@@ -9634,8 +9649,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9634
9649
|
};
|
|
9635
9650
|
|
|
9636
9651
|
var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
9637
|
-
var
|
|
9638
|
-
showField = props.showField,
|
|
9652
|
+
var showField = props.showField,
|
|
9639
9653
|
_props$value = props.value,
|
|
9640
9654
|
value = _props$value === void 0 ? {} : _props$value,
|
|
9641
9655
|
disabled = props.disabled,
|
|
@@ -9766,6 +9780,220 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
|
|
|
9766
9780
|
return /*#__PURE__*/React__default['default'].createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React__default['default'].createElement(LogisticsSnapshot, null) : null);
|
|
9767
9781
|
};
|
|
9768
9782
|
|
|
9783
|
+
var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
|
|
9784
|
+
var showField = props.showField,
|
|
9785
|
+
_props$value = props.value,
|
|
9786
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
9787
|
+
disabled = props.disabled,
|
|
9788
|
+
onChange = props.onChange;
|
|
9789
|
+
var _useState = React.useState([]),
|
|
9790
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9791
|
+
newValue = _useState2[0],
|
|
9792
|
+
setNewValue = _useState2[1];
|
|
9793
|
+
var _useState3 = React.useState(0),
|
|
9794
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9795
|
+
changeIndex = _useState4[0],
|
|
9796
|
+
setChangeIndex = _useState4[1];
|
|
9797
|
+
var _useState5 = React.useState([]),
|
|
9798
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9799
|
+
initValue = _useState6[0],
|
|
9800
|
+
setInitValue = _useState6[1];
|
|
9801
|
+
var _useState7 = React.useState([]),
|
|
9802
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
9803
|
+
changeValue = _useState8[0],
|
|
9804
|
+
setChangeValue = _useState8[1];
|
|
9805
|
+
var firstRef = React.useRef(true);
|
|
9806
|
+
var hasSave = React.useRef(false);
|
|
9807
|
+
React.useEffect(function () {
|
|
9808
|
+
if (value.length && firstRef.current) {
|
|
9809
|
+
setInitValue(value);
|
|
9810
|
+
firstRef.current = false;
|
|
9811
|
+
}
|
|
9812
|
+
}, [value]);
|
|
9813
|
+
ahooks.useDebounceEffect(function () {
|
|
9814
|
+
initHandle({
|
|
9815
|
+
initValue: initValue,
|
|
9816
|
+
value: value
|
|
9817
|
+
});
|
|
9818
|
+
}, [initValue, value], {
|
|
9819
|
+
wait: 500
|
|
9820
|
+
});
|
|
9821
|
+
var initHandle = /*#__PURE__*/function () {
|
|
9822
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
9823
|
+
var initValue, value, hasSnapshot, initList, valueList, changeList, initSnapshotList, valueSnapshotList, hasValue, listValue, requestList, requestValues;
|
|
9824
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
9825
|
+
while (1) switch (_context.prev = _context.next) {
|
|
9826
|
+
case 0:
|
|
9827
|
+
initValue = _ref.initValue, value = _ref.value;
|
|
9828
|
+
hasSnapshot = showField && showField.includes('snapshot');
|
|
9829
|
+
initList = initValue.map(function (item) {
|
|
9830
|
+
if (item.trajectoryCompany === 'SF') {
|
|
9831
|
+
return {
|
|
9832
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9833
|
+
trajectoryCode: item.trajectoryCode,
|
|
9834
|
+
trajectoryPhone: item.trajectoryPhone
|
|
9835
|
+
};
|
|
9836
|
+
} else {
|
|
9837
|
+
return {
|
|
9838
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9839
|
+
trajectoryCode: item.trajectoryCode
|
|
9840
|
+
};
|
|
9841
|
+
}
|
|
9842
|
+
});
|
|
9843
|
+
valueList = value.map(function (item) {
|
|
9844
|
+
if (item.trajectoryCompany === 'SF') {
|
|
9845
|
+
return {
|
|
9846
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9847
|
+
trajectoryCode: item.trajectoryCode,
|
|
9848
|
+
trajectoryPhone: item.trajectoryPhone
|
|
9849
|
+
};
|
|
9850
|
+
} else {
|
|
9851
|
+
return {
|
|
9852
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9853
|
+
trajectoryCode: item.trajectoryCode
|
|
9854
|
+
};
|
|
9855
|
+
}
|
|
9856
|
+
});
|
|
9857
|
+
changeList = changeValue.map(function (item) {
|
|
9858
|
+
if (item.trajectoryCompany === 'SF') {
|
|
9859
|
+
return {
|
|
9860
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9861
|
+
trajectoryCode: item.trajectoryCode,
|
|
9862
|
+
trajectoryPhone: item.trajectoryPhone
|
|
9863
|
+
};
|
|
9864
|
+
} else {
|
|
9865
|
+
return {
|
|
9866
|
+
trajectoryCompany: item.trajectoryCompany,
|
|
9867
|
+
trajectoryCode: item.trajectoryCode
|
|
9868
|
+
};
|
|
9869
|
+
}
|
|
9870
|
+
}); // 1、初始值没有 传入值有请求快照
|
|
9871
|
+
// 2、初始值有 传入值有 其中有不一样的请求快照
|
|
9872
|
+
// 3、初始值有 传入值有 都一样的返回初始值
|
|
9873
|
+
console.log('list', initList, valueList, changeList);
|
|
9874
|
+
// console.log('old', initValue, value, changeValue);
|
|
9875
|
+
// console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
|
|
9876
|
+
// console.log(
|
|
9877
|
+
// '一样2',
|
|
9878
|
+
// JSON.stringify(changeList) !== JSON.stringify(valueList),
|
|
9879
|
+
// );
|
|
9880
|
+
if (!(!initList.length && !valueList.length)) {
|
|
9881
|
+
_context.next = 8;
|
|
9882
|
+
break;
|
|
9883
|
+
}
|
|
9884
|
+
return _context.abrupt("return");
|
|
9885
|
+
case 8:
|
|
9886
|
+
if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
|
|
9887
|
+
_context.next = 14;
|
|
9888
|
+
break;
|
|
9889
|
+
}
|
|
9890
|
+
initSnapshotList = initValue.reduce(function (prv, next) {
|
|
9891
|
+
prv += next.trajectorySnapshot;
|
|
9892
|
+
return prv;
|
|
9893
|
+
}, '');
|
|
9894
|
+
valueSnapshotList = value.reduce(function (prv, next) {
|
|
9895
|
+
prv += next.trajectorySnapshot;
|
|
9896
|
+
return prv;
|
|
9897
|
+
}, '');
|
|
9898
|
+
if (initSnapshotList === valueSnapshotList) {
|
|
9899
|
+
hasSave.current = false;
|
|
9900
|
+
setNewValue(value);
|
|
9901
|
+
} else if (!hasSave.current) {
|
|
9902
|
+
hasSave.current = true;
|
|
9903
|
+
setNewValue(initValue);
|
|
9904
|
+
onChange(initValue);
|
|
9905
|
+
}
|
|
9906
|
+
_context.next = 30;
|
|
9907
|
+
break;
|
|
9908
|
+
case 14:
|
|
9909
|
+
if (!(
|
|
9910
|
+
//开启了物流快照才会获取快照信息
|
|
9911
|
+
hasSnapshot && JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
|
|
9912
|
+
_context.next = 29;
|
|
9913
|
+
break;
|
|
9914
|
+
}
|
|
9915
|
+
hasSave.current = false;
|
|
9916
|
+
hasValue = valueList.some(function (item) {
|
|
9917
|
+
return item.trajectoryCompany && item.trajectoryCode;
|
|
9918
|
+
});
|
|
9919
|
+
listValue = lodash.cloneDeep(value);
|
|
9920
|
+
if (!hasValue) {
|
|
9921
|
+
_context.next = 24;
|
|
9922
|
+
break;
|
|
9923
|
+
}
|
|
9924
|
+
requestList = valueList.map(function (item) {
|
|
9925
|
+
if (item.trajectoryCode && item.trajectoryCompany) {
|
|
9926
|
+
return extendRequest('/qy/logistics/logisticsTraceSearch', {
|
|
9927
|
+
method: 'post',
|
|
9928
|
+
data: {
|
|
9929
|
+
mailNo: item.trajectoryCode,
|
|
9930
|
+
cpCode: item.trajectoryCompany,
|
|
9931
|
+
mobile: item.trajectoryPhone
|
|
9932
|
+
}
|
|
9933
|
+
});
|
|
9934
|
+
} else {
|
|
9935
|
+
return new Promise(function (resolve) {
|
|
9936
|
+
resolve({});
|
|
9937
|
+
});
|
|
9938
|
+
}
|
|
9939
|
+
});
|
|
9940
|
+
_context.next = 22;
|
|
9941
|
+
return Promise.allSettled(requestList);
|
|
9942
|
+
case 22:
|
|
9943
|
+
requestValues = _context.sent;
|
|
9944
|
+
listValue = lodash.cloneDeep(value).map(function (item, index) {
|
|
9945
|
+
var _requestValues$index, _requestValues$index$, _requestValues$index$2;
|
|
9946
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
9947
|
+
trajectorySnapshot: (_requestValues$index = requestValues[index]) === null || _requestValues$index === void 0 ? void 0 : (_requestValues$index$ = _requestValues$index.value) === null || _requestValues$index$ === void 0 ? void 0 : (_requestValues$index$2 = _requestValues$index$.data) === null || _requestValues$index$2 === void 0 ? void 0 : _requestValues$index$2.logisticsStatusDesc
|
|
9948
|
+
});
|
|
9949
|
+
});
|
|
9950
|
+
case 24:
|
|
9951
|
+
setChangeValue(listValue);
|
|
9952
|
+
setNewValue(listValue);
|
|
9953
|
+
onChange(listValue);
|
|
9954
|
+
_context.next = 30;
|
|
9955
|
+
break;
|
|
9956
|
+
case 29:
|
|
9957
|
+
setNewValue(value);
|
|
9958
|
+
case 30:
|
|
9959
|
+
case "end":
|
|
9960
|
+
return _context.stop();
|
|
9961
|
+
}
|
|
9962
|
+
}, _callee);
|
|
9963
|
+
}));
|
|
9964
|
+
return function initHandle(_x) {
|
|
9965
|
+
return _ref2.apply(this, arguments);
|
|
9966
|
+
};
|
|
9967
|
+
}();
|
|
9968
|
+
var handleChange = function handleChange(val, index) {
|
|
9969
|
+
var newValue = lodash.cloneDeep(value);
|
|
9970
|
+
newValue.splice(index, 1, val);
|
|
9971
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
9972
|
+
setChangeValue(newValue);
|
|
9973
|
+
setNewValue(newValue);
|
|
9974
|
+
};
|
|
9975
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, {
|
|
9976
|
+
wrap: true
|
|
9977
|
+
}, (newValue || []).map(function (item, index) {
|
|
9978
|
+
return /*#__PURE__*/React__default['default'].createElement("span", {
|
|
9979
|
+
style: {
|
|
9980
|
+
color: changeIndex === index ? '#4569d4' : 'black',
|
|
9981
|
+
cursor: 'pointer'
|
|
9982
|
+
},
|
|
9983
|
+
onClick: function onClick() {
|
|
9984
|
+
return setChangeIndex(index);
|
|
9985
|
+
}
|
|
9986
|
+
}, "\u5305\u88F9".concat(index + 1));
|
|
9987
|
+
})), /*#__PURE__*/React__default['default'].createElement(LogisticsTrajectory, {
|
|
9988
|
+
value: newValue[changeIndex],
|
|
9989
|
+
showField: showField,
|
|
9990
|
+
disabled: disabled,
|
|
9991
|
+
onChange: function onChange(val) {
|
|
9992
|
+
return handleChange(val, changeIndex);
|
|
9993
|
+
}
|
|
9994
|
+
}));
|
|
9995
|
+
};
|
|
9996
|
+
|
|
9769
9997
|
//组件类型的默认值
|
|
9770
9998
|
var typeInitValueMap = {
|
|
9771
9999
|
1: [{
|
|
@@ -10167,9 +10395,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
10167
10395
|
var rowSelection = {
|
|
10168
10396
|
selectedRowKeys: selectIds,
|
|
10169
10397
|
fixed: true,
|
|
10170
|
-
onChange:
|
|
10171
|
-
|
|
10172
|
-
|
|
10398
|
+
// onChange: (
|
|
10399
|
+
// selectedRowKeys: React.SetStateAction<string[]>,
|
|
10400
|
+
// selectedRows: any[],
|
|
10401
|
+
// info: any,
|
|
10402
|
+
// ) => {
|
|
10403
|
+
// setSelectIds(selectedRowKeys);
|
|
10404
|
+
// setSelect([...selectedRows]);
|
|
10405
|
+
// },
|
|
10406
|
+
onSelect: function onSelect(record, selected) {
|
|
10407
|
+
if (selected) {
|
|
10408
|
+
setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
|
|
10409
|
+
setSelect([].concat(_toConsumableArray(selectList), [record]));
|
|
10410
|
+
} else {
|
|
10411
|
+
setSelectIds(selectIds.filter(function (t) {
|
|
10412
|
+
return t !== record.skuCode;
|
|
10413
|
+
}));
|
|
10414
|
+
setSelect(selectList.filter(function (t) {
|
|
10415
|
+
return t.skuCode !== record.skuCode;
|
|
10416
|
+
}));
|
|
10417
|
+
}
|
|
10418
|
+
},
|
|
10419
|
+
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
|
|
10420
|
+
if (selected) {
|
|
10421
|
+
setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
|
|
10422
|
+
return t.skuCode;
|
|
10423
|
+
}))));
|
|
10424
|
+
setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
|
|
10425
|
+
} else {
|
|
10426
|
+
setSelectIds(lodash.difference(selectIds, changeRows.map(function (t) {
|
|
10427
|
+
return t.skuCode;
|
|
10428
|
+
})));
|
|
10429
|
+
var list = lodash.differenceWith(selectList, changeRows, function (arrVal, othVal) {
|
|
10430
|
+
return arrVal.skuCode !== othVal.skuCode;
|
|
10431
|
+
});
|
|
10432
|
+
setSelect(list);
|
|
10433
|
+
}
|
|
10173
10434
|
}
|
|
10174
10435
|
};
|
|
10175
10436
|
var initData = function initData(list) {
|
|
@@ -10257,6 +10518,86 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
10257
10518
|
});
|
|
10258
10519
|
}
|
|
10259
10520
|
};
|
|
10521
|
+
var showTable = function showTable() {
|
|
10522
|
+
var handleDelete = function handleDelete(record, index) {
|
|
10523
|
+
setSelectIds(selectIds.filter(function (t) {
|
|
10524
|
+
return t !== record.skuCode;
|
|
10525
|
+
}));
|
|
10526
|
+
setSelect(selectList.filter(function (t) {
|
|
10527
|
+
return t.skuCode !== record.skuCode;
|
|
10528
|
+
}));
|
|
10529
|
+
};
|
|
10530
|
+
var showColumns = [{
|
|
10531
|
+
dataIndex: '',
|
|
10532
|
+
title: "\u64CD\u4F5C",
|
|
10533
|
+
ellipsis: true,
|
|
10534
|
+
width: 100,
|
|
10535
|
+
render: function render(val, record, index) {
|
|
10536
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
10537
|
+
type: "link",
|
|
10538
|
+
onClick: function onClick() {
|
|
10539
|
+
return handleDelete(record);
|
|
10540
|
+
}
|
|
10541
|
+
}, "\u5220\u9664");
|
|
10542
|
+
}
|
|
10543
|
+
}, {
|
|
10544
|
+
dataIndex: 'skuName',
|
|
10545
|
+
title: '商品sku名称',
|
|
10546
|
+
with: 200,
|
|
10547
|
+
ellipsis: true
|
|
10548
|
+
}, {
|
|
10549
|
+
dataIndex: 'skuCode',
|
|
10550
|
+
title: '商品sku编码',
|
|
10551
|
+
with: 200,
|
|
10552
|
+
ellipsis: true
|
|
10553
|
+
}, {
|
|
10554
|
+
dataIndex: 'name',
|
|
10555
|
+
title: '商品名称',
|
|
10556
|
+
with: 200,
|
|
10557
|
+
ellipsis: true
|
|
10558
|
+
}, {
|
|
10559
|
+
dataIndex: 'goodsId',
|
|
10560
|
+
title: '商品id',
|
|
10561
|
+
with: 200,
|
|
10562
|
+
ellipsis: true
|
|
10563
|
+
}, {
|
|
10564
|
+
dataIndex: 'code',
|
|
10565
|
+
title: '商品编码',
|
|
10566
|
+
with: 200,
|
|
10567
|
+
render: function render(val) {
|
|
10568
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10569
|
+
style: {
|
|
10570
|
+
width: '100px'
|
|
10571
|
+
}
|
|
10572
|
+
}, val);
|
|
10573
|
+
}
|
|
10574
|
+
}, {
|
|
10575
|
+
dataIndex: 'marketPrice',
|
|
10576
|
+
title: '市场价',
|
|
10577
|
+
render: function render(val) {
|
|
10578
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
10579
|
+
style: {
|
|
10580
|
+
width: '70px'
|
|
10581
|
+
}
|
|
10582
|
+
}, val);
|
|
10583
|
+
}
|
|
10584
|
+
}];
|
|
10585
|
+
return selectList.length ? /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
10586
|
+
columns: showColumns,
|
|
10587
|
+
rowKey: 'skuCode',
|
|
10588
|
+
dataSource: selectList,
|
|
10589
|
+
scroll: {
|
|
10590
|
+
x: true,
|
|
10591
|
+
y: 250
|
|
10592
|
+
},
|
|
10593
|
+
pagination: {
|
|
10594
|
+
size: 'small',
|
|
10595
|
+
total: selectIds.length,
|
|
10596
|
+
pageSize: pageSize,
|
|
10597
|
+
showSizeChanger: false
|
|
10598
|
+
}
|
|
10599
|
+
}) : null;
|
|
10600
|
+
};
|
|
10260
10601
|
return /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
10261
10602
|
title: '选择商品',
|
|
10262
10603
|
okText: '确认',
|
|
@@ -10338,10 +10679,17 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
10338
10679
|
total: total,
|
|
10339
10680
|
current: pageNo,
|
|
10340
10681
|
pageSize: pageSize,
|
|
10341
|
-
|
|
10682
|
+
showSizeChanger: false,
|
|
10683
|
+
showQuickJumper: true,
|
|
10342
10684
|
onChange: pageChange
|
|
10343
10685
|
}
|
|
10344
|
-
})
|
|
10686
|
+
}), /*#__PURE__*/React__default['default'].createElement(antd.Popover, {
|
|
10687
|
+
content: showTable(),
|
|
10688
|
+
title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
|
|
10689
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
10690
|
+
danger: true,
|
|
10691
|
+
type: "text"
|
|
10692
|
+
}, "\u5DF2\u9009\u62E9\u5546\u54C1(".concat(selectIds.length > 99 ? '99+' : selectIds.length, ")"), /*#__PURE__*/React__default['default'].createElement(icons.CaretUpOutlined, null)))));
|
|
10345
10693
|
};
|
|
10346
10694
|
var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
|
|
10347
10695
|
|
|
@@ -12300,6 +12648,7 @@ exports.Invoice = Invoice;
|
|
|
12300
12648
|
exports.JstGoods = jstGoods;
|
|
12301
12649
|
exports.JstItemList = ItemList;
|
|
12302
12650
|
exports.LogisticsInterception = LogisticsInterception;
|
|
12651
|
+
exports.LogisticsMoreTrajectory = LogisticsMoreTrajectory;
|
|
12303
12652
|
exports.LogisticsTrajectory = LogisticsTrajectory;
|
|
12304
12653
|
exports.MsgStatus = MsgStatus;
|
|
12305
12654
|
exports.ParseLogistics = ParseLogistics;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export { default as Status } from './business/Status';
|
|
|
33
33
|
export { default as Payment } from './business/Payment';
|
|
34
34
|
export { default as LogisticsInterception } from './business/LogisticsInterception';
|
|
35
35
|
export { default as LogisticsTrajectory } from './business/LogisticsTrajectory';
|
|
36
|
+
export { default as LogisticsMoreTrajectory } from './business/LogisticsMoreTrajectory';
|
|
36
37
|
export { default as Goods } from './common/Goods';
|
|
37
38
|
export { default as JstGoods } from './jst/Goods';
|
|
38
39
|
export { default as JstItemList } from './jst/ItemList';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.23.1-beta.
|
|
3
|
+
"version": "0.23.1-beta.3",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,7 +20,9 @@
|
|
|
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": "^0.23.1-beta.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.23.1-beta.3",
|
|
24
|
+
"ahooks": "3.7.4",
|
|
25
|
+
"kmkf-monitor": "^0.8.8",
|
|
24
26
|
"lodash": "^4.17.21",
|
|
25
27
|
"pubsub-js": "^1.9.4",
|
|
26
28
|
"react-copy-to-clipboard": "^5.1.0",
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
"identity-obj-proxy": "^3.0.0",
|
|
46
48
|
"jest": "^29.5.0",
|
|
47
49
|
"jest-environment-jsdom": "^29.5.0",
|
|
50
|
+
"kmkf-monitor": "^0.8.8",
|
|
48
51
|
"lint-staged": "^10.0.7",
|
|
49
52
|
"lodash": "^4.17.21",
|
|
50
53
|
"prettier": "^2.2.1",
|
|
@@ -61,5 +64,5 @@
|
|
|
61
64
|
"publishConfig": {
|
|
62
65
|
"access": "public"
|
|
63
66
|
},
|
|
64
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "0402084934b9b8e089b5d0f6b0679059653bf189"
|
|
65
68
|
}
|