@kmkf-fe-packages/basic-components 0.6.3-alpha.3 → 0.6.3-alpha.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/apaas/ApaasAddress/index.d.ts +2 -1
- package/dist/apaas/ApaasCascader/index.d.ts +2 -1
- package/dist/apaas/ApaasCheckbox/index.d.ts +2 -1
- package/dist/apaas/ApaasDate/index.d.ts +2 -1
- package/dist/apaas/ApaasInput/index.d.ts +2 -1
- package/dist/apaas/ApaasInputNumber/index.d.ts +2 -1
- package/dist/apaas/ApaasMultipleSelect/index.d.ts +2 -1
- package/dist/apaas/ApaasSelect/index.d.ts +2 -1
- package/dist/apaas/ApaasTextArea/index.d.ts +2 -1
- package/dist/apaas/ApaasUpload/index.d.ts +2 -1
- package/dist/apaas/ApaasUploadAsync/index.d.ts +2 -1
- package/dist/apaas/hoc/withFormItem.d.ts +1 -1
- package/dist/basics/FormItem/index.d.ts +2 -1
- package/dist/business/AliPay/index.d.ts +2 -1
- package/dist/business/BuyerNick/index.d.ts +2 -1
- package/dist/business/ChooseBaby/index.d.ts +2 -1
- package/dist/business/ExpressLogistics/index.d.ts +2 -1
- package/dist/business/Invoice/index.d.ts +2 -1
- package/dist/business/LogisticsInterception/index.d.ts +4 -2
- package/dist/business/Payment/index.d.ts +2 -1
- package/dist/business/Remark/index.d.ts +2 -1
- package/dist/business/ShopName/index.d.ts +2 -1
- package/dist/business/Status/index.d.ts +10 -1
- package/dist/business/Supplier/index.d.ts +2 -1
- package/dist/business/TBGoodId/index.d.ts +2 -1
- package/dist/business/TBGoodSerial/index.d.ts +2 -1
- package/dist/business/TradeId/index.d.ts +2 -1
- package/dist/common/ExpressCompany/index.d.ts +2 -1
- package/dist/common/Goods/goodModel.d.ts +2 -1
- package/dist/common/Goods/index.d.ts +2 -1
- package/dist/common/GoodsTable/goodModel.d.ts +2 -1
- package/dist/common/Logistics/index.d.ts +2 -1
- package/dist/index.esm.js +149 -117
- package/dist/index.js +149 -117
- package/dist/jst/Goods/index.d.ts +2 -1
- package/dist/jst/ItemList/index.d.ts +2 -1
- package/package.json +8 -4
package/dist/index.esm.js
CHANGED
|
@@ -498,6 +498,7 @@ var ApaasDate = function ApaasDate(props) {
|
|
|
498
498
|
|
|
499
499
|
var _excluded$1 = ["isNumber", "replaceWarn"];
|
|
500
500
|
function ApaasInput(props) {
|
|
501
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
501
502
|
var isNumber = props.isNumber,
|
|
502
503
|
replaceWarn = props.replaceWarn,
|
|
503
504
|
other = _objectWithoutProperties(props, _excluded$1);
|
|
@@ -510,6 +511,7 @@ function ApaasInputNumber(props) {
|
|
|
510
511
|
|
|
511
512
|
var _excluded$2 = ["options", "basicMultSelect"];
|
|
512
513
|
function ApaasSelect(props) {
|
|
514
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
513
515
|
var _props$options = props.options,
|
|
514
516
|
options = _props$options === void 0 ? [] : _props$options,
|
|
515
517
|
basicMultSelect = props.basicMultSelect,
|
|
@@ -579,8 +581,8 @@ var styles = {"imageBox":"index-module_imageBox__3tOEt","inputImage":"index-modu
|
|
|
579
581
|
styleInject(css_248z);
|
|
580
582
|
|
|
581
583
|
var _excluded$4 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled"];
|
|
582
|
-
var fn = function fn(
|
|
583
|
-
|
|
584
|
+
var fn = function fn() {
|
|
585
|
+
return void 0;
|
|
584
586
|
};
|
|
585
587
|
var getBase64 = function getBase64(file) {
|
|
586
588
|
return new Promise(function (resolve, reject) {
|
|
@@ -594,24 +596,24 @@ var getBase64 = function getBase64(file) {
|
|
|
594
596
|
};
|
|
595
597
|
});
|
|
596
598
|
};
|
|
597
|
-
var ApaasUpload = function ApaasUpload(
|
|
598
|
-
var
|
|
599
|
-
maxCount =
|
|
600
|
-
|
|
601
|
-
maxSize =
|
|
602
|
-
|
|
603
|
-
uploadText =
|
|
604
|
-
|
|
605
|
-
onChange =
|
|
606
|
-
|
|
607
|
-
value =
|
|
608
|
-
|
|
609
|
-
accept =
|
|
610
|
-
|
|
611
|
-
canPreview =
|
|
612
|
-
|
|
613
|
-
disabled =
|
|
614
|
-
resetProps = _objectWithoutProperties(
|
|
599
|
+
var ApaasUpload = function ApaasUpload(_ref) {
|
|
600
|
+
var _ref$maxCount = _ref.maxCount,
|
|
601
|
+
maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
|
|
602
|
+
_ref$maxSize = _ref.maxSize,
|
|
603
|
+
maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
|
|
604
|
+
_ref$uploadText = _ref.uploadText,
|
|
605
|
+
uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
|
|
606
|
+
_ref$onChange = _ref.onChange,
|
|
607
|
+
onChange = _ref$onChange === void 0 ? fn : _ref$onChange,
|
|
608
|
+
_ref$value = _ref.value,
|
|
609
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
|
610
|
+
_ref$accept = _ref.accept,
|
|
611
|
+
accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
|
|
612
|
+
_ref$canPreview = _ref.canPreview,
|
|
613
|
+
canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
|
|
614
|
+
_ref$disabled = _ref.disabled,
|
|
615
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
616
|
+
resetProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
615
617
|
var inputRef = useRef(null);
|
|
616
618
|
var valueRef = useRef(value);
|
|
617
619
|
var _useState = useState(false),
|
|
@@ -652,8 +654,8 @@ var ApaasUpload = function ApaasUpload(_ref3) {
|
|
|
652
654
|
onChange(list);
|
|
653
655
|
};
|
|
654
656
|
var clipboardDataChange = function clipboardDataChange(e) {
|
|
655
|
-
var clipboardData = e.clipboardData || window.clipboardData
|
|
656
|
-
|
|
657
|
+
var clipboardData = e.clipboardData || window.clipboardData;
|
|
658
|
+
var i = 0,
|
|
657
659
|
items,
|
|
658
660
|
item,
|
|
659
661
|
types;
|
|
@@ -911,32 +913,32 @@ var styles$1 = {"imageBox":"index-module_imageBox__8zj7A","inputImage":"index-mo
|
|
|
911
913
|
styleInject(css_248z$1);
|
|
912
914
|
|
|
913
915
|
var _excluded$6 = ["maxCount", "maxSize", "uploadText", "onChange", "value", "accept", "canPreview", "disabled", "uniqueKey", "hostUrl", "actionUrl"];
|
|
914
|
-
var fn$1 = function fn(
|
|
915
|
-
|
|
916
|
+
var fn$1 = function fn() {
|
|
917
|
+
return void 0;
|
|
916
918
|
};
|
|
917
|
-
var ApaasUploadAsync = function ApaasUploadAsync(
|
|
918
|
-
var
|
|
919
|
-
maxCount =
|
|
920
|
-
|
|
921
|
-
maxSize =
|
|
922
|
-
|
|
923
|
-
uploadText =
|
|
924
|
-
|
|
925
|
-
onChange =
|
|
926
|
-
|
|
927
|
-
value =
|
|
928
|
-
|
|
929
|
-
accept =
|
|
930
|
-
|
|
931
|
-
canPreview =
|
|
932
|
-
|
|
933
|
-
disabled =
|
|
934
|
-
uniqueKey =
|
|
935
|
-
|
|
936
|
-
hostUrl =
|
|
937
|
-
|
|
938
|
-
actionUrl =
|
|
939
|
-
resetProps = _objectWithoutProperties(
|
|
919
|
+
var ApaasUploadAsync = function ApaasUploadAsync(_ref) {
|
|
920
|
+
var _ref$maxCount = _ref.maxCount,
|
|
921
|
+
maxCount = _ref$maxCount === void 0 ? 10 : _ref$maxCount,
|
|
922
|
+
_ref$maxSize = _ref.maxSize,
|
|
923
|
+
maxSize = _ref$maxSize === void 0 ? 10 : _ref$maxSize,
|
|
924
|
+
_ref$uploadText = _ref.uploadText,
|
|
925
|
+
uploadText = _ref$uploadText === void 0 ? '上传' : _ref$uploadText,
|
|
926
|
+
_ref$onChange = _ref.onChange,
|
|
927
|
+
onChange = _ref$onChange === void 0 ? fn$1 : _ref$onChange,
|
|
928
|
+
_ref$value = _ref.value,
|
|
929
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
|
930
|
+
_ref$accept = _ref.accept,
|
|
931
|
+
accept = _ref$accept === void 0 ? 'image/gif,image/jpg,image/jpeg,image/png' : _ref$accept,
|
|
932
|
+
_ref$canPreview = _ref.canPreview,
|
|
933
|
+
canPreview = _ref$canPreview === void 0 ? false : _ref$canPreview,
|
|
934
|
+
_ref$disabled = _ref.disabled,
|
|
935
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
936
|
+
uniqueKey = _ref.uniqueKey,
|
|
937
|
+
_ref$hostUrl = _ref.hostUrl,
|
|
938
|
+
hostUrl = _ref$hostUrl === void 0 ? '' : _ref$hostUrl,
|
|
939
|
+
_ref$actionUrl = _ref.actionUrl,
|
|
940
|
+
actionUrl = _ref$actionUrl === void 0 ? '/qy/common/uploadWorkOrderImg' : _ref$actionUrl,
|
|
941
|
+
resetProps = _objectWithoutProperties(_ref, _excluded$6);
|
|
940
942
|
var inputRef = useRef(null);
|
|
941
943
|
var valueRef = useRef(value);
|
|
942
944
|
var _useState = useState(false),
|
|
@@ -959,7 +961,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
|
|
|
959
961
|
valueRef.current = value;
|
|
960
962
|
}, [value]);
|
|
961
963
|
var asyncUpload = /*#__PURE__*/function () {
|
|
962
|
-
var
|
|
964
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(file) {
|
|
963
965
|
var _valueRef$current;
|
|
964
966
|
var formData, fileName, _yield$request, success, data;
|
|
965
967
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
@@ -1000,7 +1002,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
|
|
|
1000
1002
|
}, _callee, null, [[5, 14, 17, 20]]);
|
|
1001
1003
|
}));
|
|
1002
1004
|
return function asyncUpload(_x) {
|
|
1003
|
-
return
|
|
1005
|
+
return _ref2.apply(this, arguments);
|
|
1004
1006
|
};
|
|
1005
1007
|
}();
|
|
1006
1008
|
var imgReader = function imgReader(item) {
|
|
@@ -1015,7 +1017,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
|
|
|
1015
1017
|
return;
|
|
1016
1018
|
}
|
|
1017
1019
|
reader.onload = /*#__PURE__*/function () {
|
|
1018
|
-
var
|
|
1020
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
1019
1021
|
var _e$target, _valueRef$current2;
|
|
1020
1022
|
var result, fileName, file;
|
|
1021
1023
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -1032,7 +1034,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
|
|
|
1032
1034
|
}, _callee2);
|
|
1033
1035
|
}));
|
|
1034
1036
|
return function (_x2) {
|
|
1035
|
-
return
|
|
1037
|
+
return _ref3.apply(this, arguments);
|
|
1036
1038
|
};
|
|
1037
1039
|
}();
|
|
1038
1040
|
reader.readAsDataURL(blob);
|
|
@@ -1042,8 +1044,8 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
|
|
|
1042
1044
|
onChange(list);
|
|
1043
1045
|
};
|
|
1044
1046
|
var clipboardDataChange = function clipboardDataChange(e) {
|
|
1045
|
-
var clipboardData = e.clipboardData || window.clipboardData
|
|
1046
|
-
|
|
1047
|
+
var clipboardData = e.clipboardData || window.clipboardData;
|
|
1048
|
+
var i = 0,
|
|
1047
1049
|
items,
|
|
1048
1050
|
item,
|
|
1049
1051
|
types;
|
|
@@ -1188,7 +1190,7 @@ var ApaasUploadAsync = function ApaasUploadAsync(_ref3) {
|
|
|
1188
1190
|
})));
|
|
1189
1191
|
};
|
|
1190
1192
|
|
|
1191
|
-
var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"
|
|
1193
|
+
var _excluded$7 = ["showOther", "horizontal", "options", "value", "onChange", "disabled"];
|
|
1192
1194
|
function ApaasCheckbox(props) {
|
|
1193
1195
|
var showOther = props.showOther,
|
|
1194
1196
|
_props$horizontal = props.horizontal,
|
|
@@ -1199,7 +1201,6 @@ function ApaasCheckbox(props) {
|
|
|
1199
1201
|
value = _props$value === void 0 ? {} : _props$value,
|
|
1200
1202
|
onChange = props.onChange,
|
|
1201
1203
|
disabled = props.disabled,
|
|
1202
|
-
checkboxOther = props.checkboxOther,
|
|
1203
1204
|
otherProps = _objectWithoutProperties(props, _excluded$7);
|
|
1204
1205
|
var checkboxValue = value.value,
|
|
1205
1206
|
other = value.other;
|
|
@@ -1507,15 +1508,11 @@ var ShopNameSelect = function ShopNameSelect(props) {
|
|
|
1507
1508
|
disabled = props.disabled,
|
|
1508
1509
|
style = props.style;
|
|
1509
1510
|
var _useState = useState([]),
|
|
1510
|
-
_useState2 = _slicedToArray(_useState,
|
|
1511
|
-
options = _useState2[0]
|
|
1512
|
-
setOptions = _useState2[1];
|
|
1511
|
+
_useState2 = _slicedToArray(_useState, 1),
|
|
1512
|
+
options = _useState2[0];
|
|
1513
1513
|
var handleChange = function handleChange(value) {
|
|
1514
1514
|
onChange === null || onChange === void 0 ? void 0 : onChange(value);
|
|
1515
1515
|
};
|
|
1516
|
-
useEffect(function () {
|
|
1517
|
-
// initDataSource();
|
|
1518
|
-
}, []);
|
|
1519
1516
|
return /*#__PURE__*/React.createElement(Select, {
|
|
1520
1517
|
defaultValue: value,
|
|
1521
1518
|
disabled: disabled,
|
|
@@ -1540,7 +1537,7 @@ function ApaasAddress(props) {
|
|
|
1540
1537
|
var value = props.value,
|
|
1541
1538
|
onChange = props.onChange,
|
|
1542
1539
|
disabled = props.disabled;
|
|
1543
|
-
var changeCity = function changeCity(city
|
|
1540
|
+
var changeCity = function changeCity(city) {
|
|
1544
1541
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
1545
1542
|
address: city
|
|
1546
1543
|
}));
|
|
@@ -1690,7 +1687,6 @@ var AliPay = function AliPay(props) {
|
|
|
1690
1687
|
var changeValue = function changeValue(e, type) {
|
|
1691
1688
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, e.target.value)));
|
|
1692
1689
|
};
|
|
1693
|
-
useEffect(function () {}, []);
|
|
1694
1690
|
return /*#__PURE__*/React.createElement("div", null, !isSingle ? /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Input, {
|
|
1695
1691
|
disabled: disabled,
|
|
1696
1692
|
placeholder: "\u8BF7\u8F93\u5165\u652F\u4ED8\u5B9D\u540D\u79F0",
|
|
@@ -2232,8 +2228,7 @@ var Sku = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
2232
2228
|
useImperativeHandle(ref, function () {
|
|
2233
2229
|
return {
|
|
2234
2230
|
open: function open(_ref) {
|
|
2235
|
-
var
|
|
2236
|
-
numIids = _ref.numIids,
|
|
2231
|
+
var numIids = _ref.numIids,
|
|
2237
2232
|
options = _ref.options;
|
|
2238
2233
|
setVisible(true);
|
|
2239
2234
|
setSku('');
|
|
@@ -2373,19 +2368,14 @@ var Goods = function Goods(props) {
|
|
|
2373
2368
|
_useState2 = _slicedToArray(_useState, 2),
|
|
2374
2369
|
visible = _useState2[0],
|
|
2375
2370
|
setVisible = _useState2[1];
|
|
2376
|
-
var _useState3 = useState(
|
|
2371
|
+
var _useState3 = useState(0),
|
|
2377
2372
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
var _useState5 = useState(0),
|
|
2381
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
2382
|
-
uploadImageCount = _useState6[0],
|
|
2383
|
-
setUploadImageCount = _useState6[1];
|
|
2373
|
+
uploadImageCount = _useState4[0],
|
|
2374
|
+
setUploadImageCount = _useState4[1];
|
|
2384
2375
|
var skuRef = useRef();
|
|
2385
|
-
var
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
setEditVisible = _useState8[1];
|
|
2376
|
+
var _useState5 = useState(false),
|
|
2377
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
2378
|
+
setEditVisible = _useState6[1];
|
|
2389
2379
|
// onChange事件会修改imgList里的字段,所以保存初始化的imglist值
|
|
2390
2380
|
if (!imgListConstant.length) {
|
|
2391
2381
|
imgListConstant = JSON.parse(JSON.stringify(imgList));
|
|
@@ -2791,7 +2781,7 @@ var Invoice = function Invoice(props) {
|
|
|
2791
2781
|
*/
|
|
2792
2782
|
var handleChange = /*#__PURE__*/function () {
|
|
2793
2783
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(ordinaryTaitou) {
|
|
2794
|
-
var data,
|
|
2784
|
+
var data, _list, newList, index, element, kpName, idx;
|
|
2795
2785
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
2796
2786
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2797
2787
|
case 0:
|
|
@@ -2812,16 +2802,16 @@ var Invoice = function Invoice(props) {
|
|
|
2812
2802
|
_context2.next = 16;
|
|
2813
2803
|
break;
|
|
2814
2804
|
}
|
|
2815
|
-
|
|
2816
|
-
if (
|
|
2805
|
+
_list = data.data ? data.data.info || [] : [];
|
|
2806
|
+
if (_list.length) {
|
|
2817
2807
|
_context2.next = 10;
|
|
2818
2808
|
break;
|
|
2819
2809
|
}
|
|
2820
2810
|
return _context2.abrupt("return");
|
|
2821
2811
|
case 10:
|
|
2822
2812
|
newList = [];
|
|
2823
|
-
for (index = 0; index <
|
|
2824
|
-
element =
|
|
2813
|
+
for (index = 0; index < _list.length; index++) {
|
|
2814
|
+
element = _list[index];
|
|
2825
2815
|
kpName = element.kpName;
|
|
2826
2816
|
idx = kpName.indexOf(ordinaryTaitou);
|
|
2827
2817
|
element.kpName1 = kpName.substring(0, idx);
|
|
@@ -3121,48 +3111,71 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3121
3111
|
value = _props$value === void 0 ? {} : _props$value,
|
|
3122
3112
|
_props$logisticsOptio = props.logisticsOptions,
|
|
3123
3113
|
logisticsOptions = _props$logisticsOptio === void 0 ? [] : _props$logisticsOptio,
|
|
3114
|
+
_props$expressInterce = props.expressInterceptData,
|
|
3115
|
+
expressInterceptData = _props$expressInterce === void 0 ? [] : _props$expressInterce,
|
|
3124
3116
|
_props$required = props.required,
|
|
3125
3117
|
required = _props$required === void 0 ? false : _props$required,
|
|
3126
3118
|
onChange = props.onChange,
|
|
3127
3119
|
_props$disabled = props.disabled,
|
|
3128
3120
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
3129
3121
|
_props$isEditing = props.isEditing,
|
|
3130
|
-
isEditing = _props$isEditing === void 0 ? false : _props$isEditing
|
|
3131
|
-
|
|
3122
|
+
isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
|
|
3123
|
+
logisticsInterceptHandleStatus = props.logisticsInterceptHandleStatus;
|
|
3124
|
+
var _useState = useState(''),
|
|
3132
3125
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3133
|
-
|
|
3134
|
-
|
|
3126
|
+
initCompany = _useState2[0],
|
|
3127
|
+
setInitCompany = _useState2[1];
|
|
3135
3128
|
var _useState3 = useState([]),
|
|
3136
3129
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
var _useState5 = useState(
|
|
3130
|
+
typeOptions = _useState4[0],
|
|
3131
|
+
setTypeOptions = _useState4[1];
|
|
3132
|
+
var _useState5 = useState([]),
|
|
3140
3133
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
var
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
return item.value === (value === null || value === void 0 ? void 0 : value.interceptStatus) && (item === null || item === void 0 ? void 0 : item.showInterceptionBtn);
|
|
3149
|
-
});
|
|
3150
|
-
return isEditing && (value === null || value === void 0 ? void 0 : value.interceptStatus) ? INTERCEPTING && isEditing : true;
|
|
3151
|
-
}, [value, statusOptions, isInterface, isEditing]);
|
|
3134
|
+
statusOptions = _useState6[0],
|
|
3135
|
+
setStatusOptions = _useState6[1];
|
|
3136
|
+
var _useState7 = useState(false),
|
|
3137
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
3138
|
+
isInterface = _useState8[0],
|
|
3139
|
+
setIsInterface = _useState8[1];
|
|
3140
|
+
var firstIn = useRef(true);
|
|
3152
3141
|
useEffect(function () {
|
|
3142
|
+
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3143
|
+
if (firstIn.current && (value === null || value === void 0 ? void 0 : value.interceptCompany)) {
|
|
3144
|
+
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3145
|
+
firstIn.current = false;
|
|
3146
|
+
}
|
|
3153
3147
|
if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) {
|
|
3154
3148
|
setTypeOptions([]);
|
|
3155
3149
|
setStatusOptions([]);
|
|
3156
3150
|
setIsInterface(false);
|
|
3157
3151
|
return;
|
|
3158
3152
|
}
|
|
3159
|
-
var interceptCompany =
|
|
3160
|
-
return item.
|
|
3153
|
+
var interceptCompany = expressInterceptData.find(function (item) {
|
|
3154
|
+
return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3161
3155
|
});
|
|
3162
3156
|
setTypeOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []);
|
|
3163
3157
|
setStatusOptions((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionStatusList) || []);
|
|
3164
3158
|
setIsInterface(interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.isInterface);
|
|
3165
3159
|
}, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3160
|
+
//拦截类型切换 需要清空新派送地
|
|
3161
|
+
useEffect(function () {
|
|
3162
|
+
if (!(value === null || value === void 0 ? void 0 : value.interceptCompany)) return;
|
|
3163
|
+
var interceptCompany = expressInterceptData.find(function (item) {
|
|
3164
|
+
return item.value === (value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3165
|
+
});
|
|
3166
|
+
var showAddress = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).some(function (item) {
|
|
3167
|
+
var _item$config;
|
|
3168
|
+
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType) && (item === null || item === void 0 ? void 0 : (_item$config = item.config) === null || _item$config === void 0 ? void 0 : _item$config.showAddress);
|
|
3169
|
+
});
|
|
3170
|
+
if (!showAddress) {
|
|
3171
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
3172
|
+
interceptAddress: [],
|
|
3173
|
+
interceptDetail: '',
|
|
3174
|
+
interceptReceiverName: '',
|
|
3175
|
+
interceptReceiverMobile: ''
|
|
3176
|
+
}));
|
|
3177
|
+
}
|
|
3178
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptType]);
|
|
3166
3179
|
//是否展示新地址
|
|
3167
3180
|
var showNewAddress = useMemo(function () {
|
|
3168
3181
|
var _find, _find$config;
|
|
@@ -3170,18 +3183,41 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3170
3183
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3171
3184
|
})) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
|
|
3172
3185
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3186
|
+
//判断是否能修改信息
|
|
3187
|
+
var canEdit = useMemo(function () {
|
|
3188
|
+
// 已对接公司如果拦截状态为【拦截中】,可以修改物流拦截组件信息,否则该组件不能修改;
|
|
3189
|
+
// 非对接公司可以修改组件
|
|
3190
|
+
// 修改后把工单信息重新提交给快递公司,清空拦截状态的值
|
|
3191
|
+
if (!isInterface) return true;
|
|
3192
|
+
//已对接公司在拦截中可以修改
|
|
3193
|
+
var INTERCEPTING = !logisticsInterceptHandleStatus || logisticsInterceptHandleStatus === 'INTERCEPTING';
|
|
3194
|
+
return isEditing ? INTERCEPTING : true;
|
|
3195
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, statusOptions, isInterface, isEditing]);
|
|
3196
|
+
//判断是否能修改物流信息
|
|
3197
|
+
var canEditCompany = useMemo(function () {
|
|
3198
|
+
var company = expressInterceptData.find(function (item) {
|
|
3199
|
+
return item.value === initCompany;
|
|
3200
|
+
});
|
|
3201
|
+
return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
|
|
3202
|
+
}, [isEditing, initCompany]);
|
|
3173
3203
|
var changeHandle = function changeHandle(val, type) {
|
|
3174
3204
|
var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
|
|
3175
3205
|
if (type === 'interceptCompany') {
|
|
3206
|
+
var interceptCompany = expressInterceptData.find(function (item) {
|
|
3207
|
+
return item.value === val;
|
|
3208
|
+
});
|
|
3209
|
+
var returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
|
|
3210
|
+
return item === null || item === void 0 ? void 0 : item.isDefault;
|
|
3211
|
+
});
|
|
3176
3212
|
newValue = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3177
3213
|
interceptCompany: val,
|
|
3178
|
-
interceptType:
|
|
3214
|
+
interceptType: returnValue === null || returnValue === void 0 ? void 0 : returnValue.value,
|
|
3179
3215
|
interceptAddress: [],
|
|
3180
|
-
interceptDetail:
|
|
3181
|
-
interceptReceiverName:
|
|
3182
|
-
interceptReceiverMobile:
|
|
3183
|
-
interceptStatus:
|
|
3184
|
-
interceptOther:
|
|
3216
|
+
interceptDetail: undefined,
|
|
3217
|
+
interceptReceiverName: undefined,
|
|
3218
|
+
interceptReceiverMobile: undefined,
|
|
3219
|
+
interceptStatus: undefined,
|
|
3220
|
+
interceptOther: undefined
|
|
3185
3221
|
});
|
|
3186
3222
|
}
|
|
3187
3223
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
@@ -3191,10 +3227,10 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3191
3227
|
required: required,
|
|
3192
3228
|
key: 'logistics'
|
|
3193
3229
|
}, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, {
|
|
3194
|
-
disabled: disabled ||
|
|
3230
|
+
disabled: disabled || canEditCompany,
|
|
3195
3231
|
placeholder: "\u7269\u6D41\u516C\u53F8",
|
|
3196
3232
|
style: {
|
|
3197
|
-
width: '
|
|
3233
|
+
width: '150px'
|
|
3198
3234
|
},
|
|
3199
3235
|
onChange: function onChange(val) {
|
|
3200
3236
|
return changeHandle(val, 'interceptCompany');
|
|
@@ -3206,7 +3242,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3206
3242
|
return option.label.includes(input);
|
|
3207
3243
|
}
|
|
3208
3244
|
}), /*#__PURE__*/React.createElement(Input, {
|
|
3209
|
-
disabled: disabled ||
|
|
3245
|
+
disabled: disabled || canEditCompany,
|
|
3210
3246
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
3211
3247
|
onChange: function onChange(e) {
|
|
3212
3248
|
return changeHandle(e.target.value, 'interceptCode');
|
|
@@ -3253,9 +3289,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3253
3289
|
})), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
|
|
3254
3290
|
value: value === null || value === void 0 ? void 0 : value.interceptReceiverName,
|
|
3255
3291
|
disabled: disabled || !canEdit,
|
|
3256
|
-
style: {
|
|
3257
|
-
width: '200px'
|
|
3258
|
-
},
|
|
3259
3292
|
placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
|
|
3260
3293
|
onChange: function onChange(e) {
|
|
3261
3294
|
return changeHandle(e.target.value, 'interceptReceiverName');
|
|
@@ -3286,7 +3319,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3286
3319
|
return option.label.includes(input);
|
|
3287
3320
|
}
|
|
3288
3321
|
}), (value === null || value === void 0 ? void 0 : value.interceptStatus) === 'OTHER' && /*#__PURE__*/React.createElement(Input, {
|
|
3289
|
-
disabled: disabled || canEdit,
|
|
3322
|
+
disabled: disabled || !canEdit,
|
|
3290
3323
|
style: {
|
|
3291
3324
|
width: '200px'
|
|
3292
3325
|
},
|
|
@@ -3552,9 +3585,8 @@ var GoodsModal$1 = function GoodsModal(props) {
|
|
|
3552
3585
|
tab: '已选择',
|
|
3553
3586
|
key: 'all'
|
|
3554
3587
|
}]),
|
|
3555
|
-
_useState18 = _slicedToArray(_useState17,
|
|
3556
|
-
tabs = _useState18[0]
|
|
3557
|
-
setTabs = _useState18[1];
|
|
3588
|
+
_useState18 = _slicedToArray(_useState17, 1),
|
|
3589
|
+
tabs = _useState18[0];
|
|
3558
3590
|
var _useState19 = useState([{
|
|
3559
3591
|
name: '上架时间',
|
|
3560
3592
|
value: 'list_time'
|