@kmkf-fe-packages/basic-components 0.7.1 → 0.7.3-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.esm.js +165 -85
- package/dist/index.js +165 -83
- package/dist/src/common/IdentifyAddress/index.d.ts +13 -0
- package/dist/src/index.d.ts +2 -0
- package/package.json +5 -5
package/README.md
CHANGED
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useRef, useState, useEffect, useMemo, forwardRef, useImperativeH
|
|
|
2
2
|
import { Cascader, DatePicker, Input, InputNumber, Select, Upload, Image, message, Radio, Space, Spin, Checkbox, Row, Col, Slider, Rate, Form, Tabs, Modal, Button, ConfigProvider, Pagination, Popover } from 'antd';
|
|
3
3
|
import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
|
|
4
4
|
import request, { extend } from 'umi-request';
|
|
5
|
-
import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
5
|
+
import { AddressData, request as request$1, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
6
6
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
7
7
|
|
|
8
8
|
function _iterableToArrayLimit(arr, i) {
|
|
@@ -3059,40 +3059,24 @@ var ParseLogistics = function ParseLogistics(props) {
|
|
|
3059
3059
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3060
3060
|
value = _useState2[0],
|
|
3061
3061
|
setValue = _useState2[1];
|
|
3062
|
-
var handleIdentify =
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
});
|
|
3081
|
-
case 4:
|
|
3082
|
-
_yield$request = _context.sent;
|
|
3083
|
-
data = _yield$request.data;
|
|
3084
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(data);
|
|
3085
|
-
case 7:
|
|
3086
|
-
case "end":
|
|
3087
|
-
return _context.stop();
|
|
3088
|
-
}
|
|
3089
|
-
}, _callee);
|
|
3090
|
-
}));
|
|
3091
|
-
return function handleIdentify() {
|
|
3092
|
-
return _ref.apply(this, arguments);
|
|
3093
|
-
};
|
|
3094
|
-
}();
|
|
3095
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextArea$1, {
|
|
3062
|
+
var handleIdentify = function handleIdentify() {
|
|
3063
|
+
if (!value) {
|
|
3064
|
+
return;
|
|
3065
|
+
}
|
|
3066
|
+
request$1({
|
|
3067
|
+
url: '/qy/logistics/addressAnalysis',
|
|
3068
|
+
method: 'post',
|
|
3069
|
+
data: {
|
|
3070
|
+
fullAddress: value
|
|
3071
|
+
}
|
|
3072
|
+
}).then(function (res) {
|
|
3073
|
+
var data = res.data;
|
|
3074
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(data);
|
|
3075
|
+
}).catch(function (e) {
|
|
3076
|
+
console.log(e);
|
|
3077
|
+
});
|
|
3078
|
+
};
|
|
3079
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TextArea$1, {
|
|
3096
3080
|
placeholder: "\u590D\u5236\u7269\u6D41\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
|
|
3097
3081
|
rows: 3,
|
|
3098
3082
|
value: value,
|
|
@@ -3111,7 +3095,65 @@ var ParseLogistics = function ParseLogistics(props) {
|
|
|
3111
3095
|
}, "\u6E05\u7A7A")));
|
|
3112
3096
|
};
|
|
3113
3097
|
|
|
3098
|
+
var IdentifyAddress = function IdentifyAddress(props) {
|
|
3099
|
+
var value = props.value,
|
|
3100
|
+
onChange = props.onChange,
|
|
3101
|
+
_props$disabled = props.disabled,
|
|
3102
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
3103
|
+
var changeHandle = function changeHandle(val, type) {
|
|
3104
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val)));
|
|
3105
|
+
};
|
|
3106
|
+
var handleParseLogistics = function handleParseLogistics(val) {
|
|
3107
|
+
var params = {
|
|
3108
|
+
detail: val === null || val === void 0 ? void 0 : val.addressDetail,
|
|
3109
|
+
receiverName: val === null || val === void 0 ? void 0 : val.name,
|
|
3110
|
+
receiverMobile: val === null || val === void 0 ? void 0 : val.phone,
|
|
3111
|
+
address: []
|
|
3112
|
+
};
|
|
3113
|
+
if (val === null || val === void 0 ? void 0 : val.province) {
|
|
3114
|
+
params.address = [AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.province), AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.city), AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
|
|
3115
|
+
}
|
|
3116
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
3117
|
+
};
|
|
3118
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !disabled && /*#__PURE__*/React.createElement(ParseLogistics, {
|
|
3119
|
+
onChange: handleParseLogistics
|
|
3120
|
+
}), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Province, {
|
|
3121
|
+
value: value.address,
|
|
3122
|
+
onChange: function onChange(val) {
|
|
3123
|
+
return changeHandle(val, 'address');
|
|
3124
|
+
},
|
|
3125
|
+
options: [],
|
|
3126
|
+
disabled: disabled
|
|
3127
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
3128
|
+
value: value.detail,
|
|
3129
|
+
disabled: disabled,
|
|
3130
|
+
placeholder: "\u8BE6\u7EC6\u5730\u5740",
|
|
3131
|
+
onChange: function onChange(e) {
|
|
3132
|
+
return changeHandle(e.target.value, 'detail');
|
|
3133
|
+
}
|
|
3134
|
+
})), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Input, {
|
|
3135
|
+
value: value.receiverName,
|
|
3136
|
+
disabled: disabled,
|
|
3137
|
+
placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
|
|
3138
|
+
onChange: function onChange(e) {
|
|
3139
|
+
return changeHandle(e.target.value, 'receiverName');
|
|
3140
|
+
}
|
|
3141
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
3142
|
+
value: value.receiverMobile,
|
|
3143
|
+
disabled: disabled,
|
|
3144
|
+
placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
|
|
3145
|
+
onChange: function onChange(e) {
|
|
3146
|
+
return changeHandle(e.target.value, 'receiverMobile');
|
|
3147
|
+
}
|
|
3148
|
+
})));
|
|
3149
|
+
};
|
|
3150
|
+
|
|
3151
|
+
var css_248z$6 = ".interceptBox :global(.ant-select-item-option-content) {\n overflow: auto !important;\n white-space: initial !important;\n}\n";
|
|
3152
|
+
styleInject(css_248z$6);
|
|
3153
|
+
|
|
3114
3154
|
var Item = Form.Item;
|
|
3155
|
+
var LogisticsAddress = LogisticsAddressData.getInstance();
|
|
3156
|
+
var address$1 = AddressData.getInstance();
|
|
3115
3157
|
var LogisticsInterception = function LogisticsInterception(props) {
|
|
3116
3158
|
var _props$value = props.value,
|
|
3117
3159
|
value = _props$value === void 0 ? {} : _props$value,
|
|
@@ -3144,7 +3186,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3144
3186
|
setIsInterface = _useState8[1];
|
|
3145
3187
|
var firstIn = useRef(true);
|
|
3146
3188
|
useEffect(function () {
|
|
3147
|
-
AddressData.getInstance();
|
|
3148
3189
|
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3149
3190
|
if (firstIn.current && JSON.stringify(value) !== '{}') {
|
|
3150
3191
|
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
@@ -3200,12 +3241,19 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3200
3241
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3201
3242
|
})) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
|
|
3202
3243
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3203
|
-
|
|
3204
|
-
var
|
|
3244
|
+
//是否回退新地址
|
|
3245
|
+
var showReturnAddress = useMemo(function () {
|
|
3205
3246
|
var _find2, _find2$config;
|
|
3206
3247
|
return (_find2 = (typeOptions || []).find(function (item) {
|
|
3207
3248
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3208
|
-
})) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.
|
|
3249
|
+
})) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.showAddressSelect;
|
|
3250
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3251
|
+
//是否展示发件人手机号
|
|
3252
|
+
var showSenderMobile = useMemo(function () {
|
|
3253
|
+
var _find3, _find3$config;
|
|
3254
|
+
return (_find3 = (typeOptions || []).find(function (item) {
|
|
3255
|
+
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3256
|
+
})) === null || _find3 === void 0 ? void 0 : (_find3$config = _find3.config) === null || _find3$config === void 0 ? void 0 : _find3$config.showSenderMobile;
|
|
3209
3257
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3210
3258
|
//判断是否能修改物流信息
|
|
3211
3259
|
var isEdit = useMemo(function () {
|
|
@@ -3214,19 +3262,39 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3214
3262
|
});
|
|
3215
3263
|
return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
|
|
3216
3264
|
}, [isEditing, initCompany]);
|
|
3265
|
+
//退回地址列表
|
|
3266
|
+
var logisticsAddressOptions = useMemo(function () {
|
|
3267
|
+
return ((LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || []).filter(function (item) {
|
|
3268
|
+
return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3269
|
+
});
|
|
3270
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3271
|
+
var returnValue = useMemo(function () {
|
|
3272
|
+
var _value$interceptAddre, _value$interceptAddre2, _value$interceptAddre3;
|
|
3273
|
+
var uk = LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getUkByInfo({
|
|
3274
|
+
cpCode: (value === null || value === void 0 ? void 0 : value.interceptCompany) || '',
|
|
3275
|
+
province: value === null || value === void 0 ? void 0 : (_value$interceptAddre = value.interceptAddress) === null || _value$interceptAddre === void 0 ? void 0 : _value$interceptAddre[0],
|
|
3276
|
+
city: value === null || value === void 0 ? void 0 : (_value$interceptAddre2 = value.interceptAddress) === null || _value$interceptAddre2 === void 0 ? void 0 : _value$interceptAddre2[1],
|
|
3277
|
+
district: value === null || value === void 0 ? void 0 : (_value$interceptAddre3 = value.interceptAddress) === null || _value$interceptAddre3 === void 0 ? void 0 : _value$interceptAddre3[2],
|
|
3278
|
+
detail: (value === null || value === void 0 ? void 0 : value.interceptDetail) || '',
|
|
3279
|
+
userName: (value === null || value === void 0 ? void 0 : value.interceptReceiverName) || '',
|
|
3280
|
+
mobile: (value === null || value === void 0 ? void 0 : value.interceptReceiverMobile) || ''
|
|
3281
|
+
});
|
|
3282
|
+
return uk || undefined;
|
|
3283
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, value === null || value === void 0 ? void 0 : value.interceptAddress]);
|
|
3284
|
+
//选择回调
|
|
3217
3285
|
var changeHandle = function changeHandle(val, type) {
|
|
3218
3286
|
var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
|
|
3219
3287
|
if (type === 'interceptCompany') {
|
|
3220
3288
|
var interceptCompany = expressInterceptData.find(function (item) {
|
|
3221
3289
|
return item.value === val;
|
|
3222
3290
|
});
|
|
3223
|
-
var
|
|
3291
|
+
var _returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
|
|
3224
3292
|
var _item$config3;
|
|
3225
3293
|
return item === null || item === void 0 ? void 0 : (_item$config3 = item.config) === null || _item$config3 === void 0 ? void 0 : _item$config3.isDefault;
|
|
3226
3294
|
});
|
|
3227
3295
|
newValue = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3228
3296
|
interceptCompany: val,
|
|
3229
|
-
interceptType:
|
|
3297
|
+
interceptType: _returnValue === null || _returnValue === void 0 ? void 0 : _returnValue.value,
|
|
3230
3298
|
interceptSenderMobile: undefined,
|
|
3231
3299
|
interceptAddress: [],
|
|
3232
3300
|
interceptDetail: undefined,
|
|
@@ -3238,18 +3306,33 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3238
3306
|
}
|
|
3239
3307
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
3240
3308
|
};
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3309
|
+
//智能识别回调
|
|
3310
|
+
var changeIdentify = function changeIdentify(val) {
|
|
3311
|
+
//智能识别返填
|
|
3312
|
+
var parseValue = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3313
|
+
interceptAddress: (val === null || val === void 0 ? void 0 : val.address) || [],
|
|
3314
|
+
interceptDetail: (val === null || val === void 0 ? void 0 : val.detail) || '',
|
|
3315
|
+
interceptReceiverName: (val === null || val === void 0 ? void 0 : val.receiverName) || '',
|
|
3316
|
+
interceptReceiverMobile: (val === null || val === void 0 ? void 0 : val.receiverMobile) || ''
|
|
3246
3317
|
});
|
|
3247
|
-
|
|
3248
|
-
|
|
3318
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(parseValue);
|
|
3319
|
+
};
|
|
3320
|
+
//选择退回地址
|
|
3321
|
+
var changeReturnAddress = function changeReturnAddress(uk) {
|
|
3322
|
+
var item = LogisticsAddress.getItemByUk(uk);
|
|
3323
|
+
console.log(item);
|
|
3324
|
+
if (item) {
|
|
3325
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
3326
|
+
interceptAddress: [item === null || item === void 0 ? void 0 : item.province, item === null || item === void 0 ? void 0 : item.city, item === null || item === void 0 ? void 0 : item.district],
|
|
3327
|
+
interceptDetail: item === null || item === void 0 ? void 0 : item.detail,
|
|
3328
|
+
interceptReceiverName: item === null || item === void 0 ? void 0 : item.userName,
|
|
3329
|
+
interceptReceiverMobile: item === null || item === void 0 ? void 0 : item.mobile
|
|
3330
|
+
}));
|
|
3249
3331
|
}
|
|
3250
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
3251
3332
|
};
|
|
3252
|
-
return /*#__PURE__*/React.createElement(
|
|
3333
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
3334
|
+
className: css_248z$6.interceptBox
|
|
3335
|
+
}, /*#__PURE__*/React.createElement(Item, {
|
|
3253
3336
|
label: '物流信息',
|
|
3254
3337
|
required: required,
|
|
3255
3338
|
key: 'logistics'
|
|
@@ -3307,41 +3390,38 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3307
3390
|
return changeHandle(e.target.value, 'interceptSenderMobile');
|
|
3308
3391
|
}
|
|
3309
3392
|
})), /*#__PURE__*/React.createElement(Item, {
|
|
3393
|
+
label: '退回地址',
|
|
3394
|
+
required: true,
|
|
3395
|
+
key: 'returnAddress',
|
|
3396
|
+
hidden: !showReturnAddress
|
|
3397
|
+
}, /*#__PURE__*/React.createElement(Select, {
|
|
3398
|
+
disabled: disabled || isEdit,
|
|
3399
|
+
value: returnValue,
|
|
3400
|
+
onChange: changeReturnAddress,
|
|
3401
|
+
placeholder: "\u8BF7\u9009\u62E9\u9000\u56DE\u5730\u5740",
|
|
3402
|
+
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
3403
|
+
return triggerNode.parentElement;
|
|
3404
|
+
}
|
|
3405
|
+
}, logisticsAddressOptions.map(function (item) {
|
|
3406
|
+
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
3407
|
+
key: item.uk,
|
|
3408
|
+
value: item.uk
|
|
3409
|
+
}, "".concat(address$1.getNameByCode(item === null || item === void 0 ? void 0 : item.province) || '').concat(address$1.getNameByCode(item === null || item === void 0 ? void 0 : item.city) || '').concat(address$1.getNameByCode(item === null || item === void 0 ? void 0 : item.district) || '').concat(item.detail, " ").concat(item === null || item === void 0 ? void 0 : item.userName, ":").concat(item === null || item === void 0 ? void 0 : item.mobile));
|
|
3410
|
+
}))), /*#__PURE__*/React.createElement(Item, {
|
|
3310
3411
|
label: '派送地址',
|
|
3311
3412
|
required: true,
|
|
3312
3413
|
key: 'newAddress',
|
|
3313
3414
|
hidden: !showNewAddress
|
|
3314
|
-
},
|
|
3315
|
-
onChange: handleParseLogistics
|
|
3316
|
-
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Province, {
|
|
3317
|
-
value: value === null || value === void 0 ? void 0 : value.interceptAddress,
|
|
3318
|
-
onChange: function onChange(val) {
|
|
3319
|
-
return changeHandle(val, 'interceptAddress');
|
|
3320
|
-
},
|
|
3321
|
-
options: [],
|
|
3322
|
-
disabled: disabled || isEdit
|
|
3323
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
3324
|
-
value: value === null || value === void 0 ? void 0 : value.interceptDetail,
|
|
3415
|
+
}, /*#__PURE__*/React.createElement(IdentifyAddress, {
|
|
3325
3416
|
disabled: disabled || isEdit,
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
onChange: function onChange(e) {
|
|
3335
|
-
return changeHandle(e.target.value, 'interceptReceiverName');
|
|
3336
|
-
}
|
|
3337
|
-
}), /*#__PURE__*/React.createElement(Input, {
|
|
3338
|
-
value: value === null || value === void 0 ? void 0 : value.interceptReceiverMobile,
|
|
3339
|
-
disabled: disabled || isEdit,
|
|
3340
|
-
placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
|
|
3341
|
-
onChange: function onChange(e) {
|
|
3342
|
-
return changeHandle(e.target.value, 'interceptReceiverMobile');
|
|
3343
|
-
}
|
|
3344
|
-
}))), /*#__PURE__*/React.createElement(Item, {
|
|
3417
|
+
value: {
|
|
3418
|
+
address: (value === null || value === void 0 ? void 0 : value.interceptAddress) || [],
|
|
3419
|
+
detail: (value === null || value === void 0 ? void 0 : value.interceptDetail) || '',
|
|
3420
|
+
receiverName: (value === null || value === void 0 ? void 0 : value.interceptReceiverName) || '',
|
|
3421
|
+
receiverMobile: (value === null || value === void 0 ? void 0 : value.interceptReceiverMobile) || ''
|
|
3422
|
+
},
|
|
3423
|
+
onChange: changeIdentify
|
|
3424
|
+
})), /*#__PURE__*/React.createElement(Item, {
|
|
3345
3425
|
label: '物流状态',
|
|
3346
3426
|
key: 'interceptLogisticsStatus'
|
|
3347
3427
|
}, /*#__PURE__*/React.createElement(Select, {
|
|
@@ -3485,8 +3565,8 @@ var jstGoods = function jstGoods(props) {
|
|
|
3485
3565
|
})) : null) : null);
|
|
3486
3566
|
};
|
|
3487
3567
|
|
|
3488
|
-
var css_248z$
|
|
3489
|
-
styleInject(css_248z$
|
|
3568
|
+
var css_248z$7 = ".jstGoodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.jstGoodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.jstGoodsBox .right-context {\n font-size: 12px;\n}\n.jstGoodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.jstGoodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.jstGoodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.jstimgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n display: flex;\n justify-items: center;\n align-items: center;\n}\n.jstimgBox .add-btn {\n color: #86909c;\n}\n.jstimgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
|
|
3569
|
+
styleInject(css_248z$7);
|
|
3490
3570
|
|
|
3491
3571
|
var ItemList = function ItemList(props) {
|
|
3492
3572
|
var _props$value = props.value,
|
|
@@ -3559,8 +3639,8 @@ var ItemList = function ItemList(props) {
|
|
|
3559
3639
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
3560
3640
|
};
|
|
3561
3641
|
|
|
3562
|
-
var css_248z$
|
|
3563
|
-
styleInject(css_248z$
|
|
3642
|
+
var css_248z$8 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
|
|
3643
|
+
styleInject(css_248z$8);
|
|
3564
3644
|
|
|
3565
3645
|
var TabPane$1 = Tabs.TabPane;
|
|
3566
3646
|
var Option$2 = Select.Option;
|
|
@@ -4035,4 +4115,4 @@ var Goods$1 = function Goods(props, ref) {
|
|
|
4035
4115
|
};
|
|
4036
4116
|
var index = /*#__PURE__*/forwardRef(Goods$1);
|
|
4037
4117
|
|
|
4038
|
-
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasMultipleSelect, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, BuyerNick, ChooseBaby, ExpressLogistics, Goods, index as GoodsTable, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };
|
|
4118
|
+
export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasMultipleSelect, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, ApaasUploadAsync, BuyerNick, ChooseBaby, ExpressLogistics, Goods, index as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId };
|
package/dist/index.js
CHANGED
|
@@ -3069,40 +3069,24 @@ var ParseLogistics = function ParseLogistics(props) {
|
|
|
3069
3069
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3070
3070
|
value = _useState2[0],
|
|
3071
3071
|
setValue = _useState2[1];
|
|
3072
|
-
var handleIdentify =
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
});
|
|
3091
|
-
case 4:
|
|
3092
|
-
_yield$request = _context.sent;
|
|
3093
|
-
data = _yield$request.data;
|
|
3094
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(data);
|
|
3095
|
-
case 7:
|
|
3096
|
-
case "end":
|
|
3097
|
-
return _context.stop();
|
|
3098
|
-
}
|
|
3099
|
-
}, _callee);
|
|
3100
|
-
}));
|
|
3101
|
-
return function handleIdentify() {
|
|
3102
|
-
return _ref.apply(this, arguments);
|
|
3103
|
-
};
|
|
3104
|
-
}();
|
|
3105
|
-
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(TextArea$1, {
|
|
3072
|
+
var handleIdentify = function handleIdentify() {
|
|
3073
|
+
if (!value) {
|
|
3074
|
+
return;
|
|
3075
|
+
}
|
|
3076
|
+
kmkfUtils.request({
|
|
3077
|
+
url: '/qy/logistics/addressAnalysis',
|
|
3078
|
+
method: 'post',
|
|
3079
|
+
data: {
|
|
3080
|
+
fullAddress: value
|
|
3081
|
+
}
|
|
3082
|
+
}).then(function (res) {
|
|
3083
|
+
var data = res.data;
|
|
3084
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(data);
|
|
3085
|
+
}).catch(function (e) {
|
|
3086
|
+
console.log(e);
|
|
3087
|
+
});
|
|
3088
|
+
};
|
|
3089
|
+
return /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(TextArea$1, {
|
|
3106
3090
|
placeholder: "\u590D\u5236\u7269\u6D41\u4FE1\u606F\uFF0C\u70B9\u51FB\u667A\u80FD\u8BC6\u522B",
|
|
3107
3091
|
rows: 3,
|
|
3108
3092
|
value: value,
|
|
@@ -3121,7 +3105,65 @@ var ParseLogistics = function ParseLogistics(props) {
|
|
|
3121
3105
|
}, "\u6E05\u7A7A")));
|
|
3122
3106
|
};
|
|
3123
3107
|
|
|
3108
|
+
var IdentifyAddress = function IdentifyAddress(props) {
|
|
3109
|
+
var value = props.value,
|
|
3110
|
+
onChange = props.onChange,
|
|
3111
|
+
_props$disabled = props.disabled,
|
|
3112
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
3113
|
+
var changeHandle = function changeHandle(val, type) {
|
|
3114
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val)));
|
|
3115
|
+
};
|
|
3116
|
+
var handleParseLogistics = function handleParseLogistics(val) {
|
|
3117
|
+
var params = {
|
|
3118
|
+
detail: val === null || val === void 0 ? void 0 : val.addressDetail,
|
|
3119
|
+
receiverName: val === null || val === void 0 ? void 0 : val.name,
|
|
3120
|
+
receiverMobile: val === null || val === void 0 ? void 0 : val.phone,
|
|
3121
|
+
address: []
|
|
3122
|
+
};
|
|
3123
|
+
if (val === null || val === void 0 ? void 0 : val.province) {
|
|
3124
|
+
params.address = [kmkfUtils.AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.province), kmkfUtils.AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.city), kmkfUtils.AddressData.getInstance().getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
|
|
3125
|
+
}
|
|
3126
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
3127
|
+
};
|
|
3128
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, !disabled && /*#__PURE__*/React__default['default'].createElement(ParseLogistics, {
|
|
3129
|
+
onChange: handleParseLogistics
|
|
3130
|
+
}), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(Province, {
|
|
3131
|
+
value: value.address,
|
|
3132
|
+
onChange: function onChange(val) {
|
|
3133
|
+
return changeHandle(val, 'address');
|
|
3134
|
+
},
|
|
3135
|
+
options: [],
|
|
3136
|
+
disabled: disabled
|
|
3137
|
+
}), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3138
|
+
value: value.detail,
|
|
3139
|
+
disabled: disabled,
|
|
3140
|
+
placeholder: "\u8BE6\u7EC6\u5730\u5740",
|
|
3141
|
+
onChange: function onChange(e) {
|
|
3142
|
+
return changeHandle(e.target.value, 'detail');
|
|
3143
|
+
}
|
|
3144
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3145
|
+
value: value.receiverName,
|
|
3146
|
+
disabled: disabled,
|
|
3147
|
+
placeholder: "\u6536\u4EF6\u4EBA\u59D3\u540D",
|
|
3148
|
+
onChange: function onChange(e) {
|
|
3149
|
+
return changeHandle(e.target.value, 'receiverName');
|
|
3150
|
+
}
|
|
3151
|
+
}), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3152
|
+
value: value.receiverMobile,
|
|
3153
|
+
disabled: disabled,
|
|
3154
|
+
placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
|
|
3155
|
+
onChange: function onChange(e) {
|
|
3156
|
+
return changeHandle(e.target.value, 'receiverMobile');
|
|
3157
|
+
}
|
|
3158
|
+
})));
|
|
3159
|
+
};
|
|
3160
|
+
|
|
3161
|
+
var css_248z$6 = ".interceptBox :global(.ant-select-item-option-content) {\n overflow: auto !important;\n white-space: initial !important;\n}\n";
|
|
3162
|
+
styleInject(css_248z$6);
|
|
3163
|
+
|
|
3124
3164
|
var Item = antd.Form.Item;
|
|
3165
|
+
var LogisticsAddress = kmkfUtils.LogisticsAddressData.getInstance();
|
|
3166
|
+
var address$1 = kmkfUtils.AddressData.getInstance();
|
|
3125
3167
|
var LogisticsInterception = function LogisticsInterception(props) {
|
|
3126
3168
|
var _props$value = props.value,
|
|
3127
3169
|
value = _props$value === void 0 ? {} : _props$value,
|
|
@@ -3154,7 +3196,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3154
3196
|
setIsInterface = _useState8[1];
|
|
3155
3197
|
var firstIn = React.useRef(true);
|
|
3156
3198
|
React.useEffect(function () {
|
|
3157
|
-
kmkfUtils.AddressData.getInstance();
|
|
3158
3199
|
//存入第一次的物流地址,防止非对接物流切换成对接物流后无法编辑
|
|
3159
3200
|
if (firstIn.current && JSON.stringify(value) !== '{}') {
|
|
3160
3201
|
setInitCompany(value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
@@ -3210,12 +3251,19 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3210
3251
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3211
3252
|
})) === null || _find === void 0 ? void 0 : (_find$config = _find.config) === null || _find$config === void 0 ? void 0 : _find$config.showAddress;
|
|
3212
3253
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3213
|
-
|
|
3214
|
-
var
|
|
3254
|
+
//是否回退新地址
|
|
3255
|
+
var showReturnAddress = React.useMemo(function () {
|
|
3215
3256
|
var _find2, _find2$config;
|
|
3216
3257
|
return (_find2 = (typeOptions || []).find(function (item) {
|
|
3217
3258
|
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3218
|
-
})) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.
|
|
3259
|
+
})) === null || _find2 === void 0 ? void 0 : (_find2$config = _find2.config) === null || _find2$config === void 0 ? void 0 : _find2$config.showAddressSelect;
|
|
3260
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3261
|
+
//是否展示发件人手机号
|
|
3262
|
+
var showSenderMobile = React.useMemo(function () {
|
|
3263
|
+
var _find3, _find3$config;
|
|
3264
|
+
return (_find3 = (typeOptions || []).find(function (item) {
|
|
3265
|
+
return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
|
|
3266
|
+
})) === null || _find3 === void 0 ? void 0 : (_find3$config = _find3.config) === null || _find3$config === void 0 ? void 0 : _find3$config.showSenderMobile;
|
|
3219
3267
|
}, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3220
3268
|
//判断是否能修改物流信息
|
|
3221
3269
|
var isEdit = React.useMemo(function () {
|
|
@@ -3224,19 +3272,39 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3224
3272
|
});
|
|
3225
3273
|
return isEditing && !!(company === null || company === void 0 ? void 0 : company.isInterface);
|
|
3226
3274
|
}, [isEditing, initCompany]);
|
|
3275
|
+
//退回地址列表
|
|
3276
|
+
var logisticsAddressOptions = React.useMemo(function () {
|
|
3277
|
+
return ((LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || []).filter(function (item) {
|
|
3278
|
+
return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
|
|
3279
|
+
});
|
|
3280
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
|
|
3281
|
+
var returnValue = React.useMemo(function () {
|
|
3282
|
+
var _value$interceptAddre, _value$interceptAddre2, _value$interceptAddre3;
|
|
3283
|
+
var uk = LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getUkByInfo({
|
|
3284
|
+
cpCode: (value === null || value === void 0 ? void 0 : value.interceptCompany) || '',
|
|
3285
|
+
province: value === null || value === void 0 ? void 0 : (_value$interceptAddre = value.interceptAddress) === null || _value$interceptAddre === void 0 ? void 0 : _value$interceptAddre[0],
|
|
3286
|
+
city: value === null || value === void 0 ? void 0 : (_value$interceptAddre2 = value.interceptAddress) === null || _value$interceptAddre2 === void 0 ? void 0 : _value$interceptAddre2[1],
|
|
3287
|
+
district: value === null || value === void 0 ? void 0 : (_value$interceptAddre3 = value.interceptAddress) === null || _value$interceptAddre3 === void 0 ? void 0 : _value$interceptAddre3[2],
|
|
3288
|
+
detail: (value === null || value === void 0 ? void 0 : value.interceptDetail) || '',
|
|
3289
|
+
userName: (value === null || value === void 0 ? void 0 : value.interceptReceiverName) || '',
|
|
3290
|
+
mobile: (value === null || value === void 0 ? void 0 : value.interceptReceiverMobile) || ''
|
|
3291
|
+
});
|
|
3292
|
+
return uk || undefined;
|
|
3293
|
+
}, [value === null || value === void 0 ? void 0 : value.interceptCompany, value === null || value === void 0 ? void 0 : value.interceptAddress]);
|
|
3294
|
+
//选择回调
|
|
3227
3295
|
var changeHandle = function changeHandle(val, type) {
|
|
3228
3296
|
var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
|
|
3229
3297
|
if (type === 'interceptCompany') {
|
|
3230
3298
|
var interceptCompany = expressInterceptData.find(function (item) {
|
|
3231
3299
|
return item.value === val;
|
|
3232
3300
|
});
|
|
3233
|
-
var
|
|
3301
|
+
var _returnValue = ((interceptCompany === null || interceptCompany === void 0 ? void 0 : interceptCompany.interceptionTypeList) || []).find(function (item) {
|
|
3234
3302
|
var _item$config3;
|
|
3235
3303
|
return item === null || item === void 0 ? void 0 : (_item$config3 = item.config) === null || _item$config3 === void 0 ? void 0 : _item$config3.isDefault;
|
|
3236
3304
|
});
|
|
3237
3305
|
newValue = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3238
3306
|
interceptCompany: val,
|
|
3239
|
-
interceptType:
|
|
3307
|
+
interceptType: _returnValue === null || _returnValue === void 0 ? void 0 : _returnValue.value,
|
|
3240
3308
|
interceptSenderMobile: undefined,
|
|
3241
3309
|
interceptAddress: [],
|
|
3242
3310
|
interceptDetail: undefined,
|
|
@@ -3248,18 +3316,33 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3248
3316
|
}
|
|
3249
3317
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
3250
3318
|
};
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3319
|
+
//智能识别回调
|
|
3320
|
+
var changeIdentify = function changeIdentify(val) {
|
|
3321
|
+
//智能识别返填
|
|
3322
|
+
var parseValue = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
3323
|
+
interceptAddress: (val === null || val === void 0 ? void 0 : val.address) || [],
|
|
3324
|
+
interceptDetail: (val === null || val === void 0 ? void 0 : val.detail) || '',
|
|
3325
|
+
interceptReceiverName: (val === null || val === void 0 ? void 0 : val.receiverName) || '',
|
|
3326
|
+
interceptReceiverMobile: (val === null || val === void 0 ? void 0 : val.receiverMobile) || ''
|
|
3256
3327
|
});
|
|
3257
|
-
|
|
3258
|
-
|
|
3328
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(parseValue);
|
|
3329
|
+
};
|
|
3330
|
+
//选择退回地址
|
|
3331
|
+
var changeReturnAddress = function changeReturnAddress(uk) {
|
|
3332
|
+
var item = LogisticsAddress.getItemByUk(uk);
|
|
3333
|
+
console.log(item);
|
|
3334
|
+
if (item) {
|
|
3335
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
3336
|
+
interceptAddress: [item === null || item === void 0 ? void 0 : item.province, item === null || item === void 0 ? void 0 : item.city, item === null || item === void 0 ? void 0 : item.district],
|
|
3337
|
+
interceptDetail: item === null || item === void 0 ? void 0 : item.detail,
|
|
3338
|
+
interceptReceiverName: item === null || item === void 0 ? void 0 : item.userName,
|
|
3339
|
+
interceptReceiverMobile: item === null || item === void 0 ? void 0 : item.mobile
|
|
3340
|
+
}));
|
|
3259
3341
|
}
|
|
3260
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2({}, params));
|
|
3261
3342
|
};
|
|
3262
|
-
return /*#__PURE__*/React__default['default'].createElement(
|
|
3343
|
+
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
3344
|
+
className: css_248z$6.interceptBox
|
|
3345
|
+
}, /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
3263
3346
|
label: '物流信息',
|
|
3264
3347
|
required: required,
|
|
3265
3348
|
key: 'logistics'
|
|
@@ -3317,41 +3400,38 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
3317
3400
|
return changeHandle(e.target.value, 'interceptSenderMobile');
|
|
3318
3401
|
}
|
|
3319
3402
|
})), /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
3403
|
+
label: '退回地址',
|
|
3404
|
+
required: true,
|
|
3405
|
+
key: 'returnAddress',
|
|
3406
|
+
hidden: !showReturnAddress
|
|
3407
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
3408
|
+
disabled: disabled || isEdit,
|
|
3409
|
+
value: returnValue,
|
|
3410
|
+
onChange: changeReturnAddress,
|
|
3411
|
+
placeholder: "\u8BF7\u9009\u62E9\u9000\u56DE\u5730\u5740",
|
|
3412
|
+
getPopupContainer: function getPopupContainer(triggerNode) {
|
|
3413
|
+
return triggerNode.parentElement;
|
|
3414
|
+
}
|
|
3415
|
+
}, logisticsAddressOptions.map(function (item) {
|
|
3416
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
|
|
3417
|
+
key: item.uk,
|
|
3418
|
+
value: item.uk
|
|
3419
|
+
}, "".concat(address$1.getNameByCode(item === null || item === void 0 ? void 0 : item.province) || '').concat(address$1.getNameByCode(item === null || item === void 0 ? void 0 : item.city) || '').concat(address$1.getNameByCode(item === null || item === void 0 ? void 0 : item.district) || '').concat(item.detail, " ").concat(item === null || item === void 0 ? void 0 : item.userName, ":").concat(item === null || item === void 0 ? void 0 : item.mobile));
|
|
3420
|
+
}))), /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
3320
3421
|
label: '派送地址',
|
|
3321
3422
|
required: true,
|
|
3322
3423
|
key: 'newAddress',
|
|
3323
3424
|
hidden: !showNewAddress
|
|
3324
|
-
},
|
|
3325
|
-
onChange: handleParseLogistics
|
|
3326
|
-
}), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(Province, {
|
|
3327
|
-
value: value === null || value === void 0 ? void 0 : value.interceptAddress,
|
|
3328
|
-
onChange: function onChange(val) {
|
|
3329
|
-
return changeHandle(val, 'interceptAddress');
|
|
3330
|
-
},
|
|
3331
|
-
options: [],
|
|
3332
|
-
disabled: disabled || isEdit
|
|
3333
|
-
}), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3334
|
-
value: value === null || value === void 0 ? void 0 : value.interceptDetail,
|
|
3425
|
+
}, /*#__PURE__*/React__default['default'].createElement(IdentifyAddress, {
|
|
3335
3426
|
disabled: disabled || isEdit,
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
onChange: function onChange(e) {
|
|
3345
|
-
return changeHandle(e.target.value, 'interceptReceiverName');
|
|
3346
|
-
}
|
|
3347
|
-
}), /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
3348
|
-
value: value === null || value === void 0 ? void 0 : value.interceptReceiverMobile,
|
|
3349
|
-
disabled: disabled || isEdit,
|
|
3350
|
-
placeholder: "\u6536\u4EF6\u4EBA\u7535\u8BDD",
|
|
3351
|
-
onChange: function onChange(e) {
|
|
3352
|
-
return changeHandle(e.target.value, 'interceptReceiverMobile');
|
|
3353
|
-
}
|
|
3354
|
-
}))), /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
3427
|
+
value: {
|
|
3428
|
+
address: (value === null || value === void 0 ? void 0 : value.interceptAddress) || [],
|
|
3429
|
+
detail: (value === null || value === void 0 ? void 0 : value.interceptDetail) || '',
|
|
3430
|
+
receiverName: (value === null || value === void 0 ? void 0 : value.interceptReceiverName) || '',
|
|
3431
|
+
receiverMobile: (value === null || value === void 0 ? void 0 : value.interceptReceiverMobile) || ''
|
|
3432
|
+
},
|
|
3433
|
+
onChange: changeIdentify
|
|
3434
|
+
})), /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
3355
3435
|
label: '物流状态',
|
|
3356
3436
|
key: 'interceptLogisticsStatus'
|
|
3357
3437
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
@@ -3495,8 +3575,8 @@ var jstGoods = function jstGoods(props) {
|
|
|
3495
3575
|
})) : null) : null);
|
|
3496
3576
|
};
|
|
3497
3577
|
|
|
3498
|
-
var css_248z$
|
|
3499
|
-
styleInject(css_248z$
|
|
3578
|
+
var css_248z$7 = ".jstGoodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.jstGoodsBox .goodBox-Img {\n width: 80px;\n margin: 0 10px 10px 0;\n}\n.jstGoodsBox .right-context {\n font-size: 12px;\n}\n.jstGoodsBox .right-context .ant-input {\n font-size: 12px;\n width: 80px;\n height: 20px;\n padding-left: 5px;\n padding-right: 5px;\n}\n.jstGoodsBox .right-context .ant-input.id-textarea {\n width: 80px;\n resize: none;\n height: 45px;\n}\n.jstGoodsBox.goodsBox-item-horizontal--box {\n flex-direction: row;\n width: auto;\n}\n.jstimgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border-radius: 4px;\n border: 1px solid #f2f3f5;\n margin: 0 10px 10px 0;\n text-align: center;\n background-color: #f2f3f5;\n display: flex;\n justify-items: center;\n align-items: center;\n}\n.jstimgBox .add-btn {\n color: #86909c;\n}\n.jstimgBox .text {\n color: #86909c;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4e5969;\n}\n.searchBox {\n display: flex;\n justify-content: space-between;\n flex-wrap: wrap;\n margin-bottom: 10px;\n}\n.searchBox .search {\n width: 150px;\n margin-left: 6px;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodsMain {\n display: flex;\n flex-wrap: wrap;\n height: 400px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodsMain .goodItem {\n width: 142px;\n height: 184px;\n padding: 7px;\n margin: 0 16px 16px 0;\n border-radius: 4px;\n background: #ffffff;\n box-sizing: border-box;\n /* 主题色/常规 */\n border: 1px solid #c9cdd4;\n}\n.goodsMain .goodItem .goodImg {\n width: 128px;\n height: 128px;\n border-radius: 4px;\n overflow: hidden;\n}\n.goodsMain .goodItem .goodImg img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goodsMain .goodItem .goodText {\n text-align: center;\n font-size: 12px;\n color: #4e5969;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodsMain .goodItem .goodPrice {\n text-align: center;\n font-size: 14px;\n color: #1d2129;\n}\n.goodsMain .goodItem.active {\n border: 1px solid #1b5bf3;\n}\n@media screen and (max-width: 500px) {\n .goodsMain {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n grid-gap: 8px;\n height: 300px;\n }\n .goodsMain .goodItem {\n height: 126px;\n width: 83px;\n padding: 4px;\n margin: 0;\n border-radius: 4px;\n background: #FFFFFF;\n box-sizing: border-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n }\n .goodsMain .goodItem .goodImg {\n width: 98%;\n height: 77px;\n }\n .goodsMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n .goodsMain .goodItem.active {\n border: 1px solid #3089dc;\n }\n .searchBox {\n display: flex;\n flex-wrap: wrap;\n justify-content: initial;\n }\n .searchBox .classify {\n width: 120px;\n }\n .goodModal .ant-modal-body {\n padding: 8px;\n }\n}\n.goods-uploaded-count {\n color: #ff3638;\n}\n.footer {\n display: flex;\n justify-content: flex-end;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n.right-context .info-row {\n width: 80px;\n display: flex;\n align-items: center;\n padding: 0px 8px;\n border-radius: 2px;\n cursor: pointer;\n background: #f2f3f5;\n margin-bottom: 4px;\n}\n.right-context .info-row > div {\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n word-break: break-all;\n}\n.sphPagination {\n display: flex;\n align-items: center;\n}\n.sphPagination .shpBtn {\n display: flex;\n justify-content: center;\n align-items: center;\n padding: 0 8px;\n height: 32px;\n border: 1px solid #d9d9d9;\n border-radius: 2px;\n cursor: pointer;\n margin: 0 8px;\n}\n.sphPagination .shpBtn.unCursor {\n color: #eee;\n cursor: not-allowed;\n}\n";
|
|
3579
|
+
styleInject(css_248z$7);
|
|
3500
3580
|
|
|
3501
3581
|
var ItemList = function ItemList(props) {
|
|
3502
3582
|
var _props$value = props.value,
|
|
@@ -3569,8 +3649,8 @@ var ItemList = function ItemList(props) {
|
|
|
3569
3649
|
}, "\u6682\u4E0D\u652F\u6301\u6DFB\u52A0")) : null);
|
|
3570
3650
|
};
|
|
3571
3651
|
|
|
3572
|
-
var css_248z$
|
|
3573
|
-
styleInject(css_248z$
|
|
3652
|
+
var css_248z$8 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
|
|
3653
|
+
styleInject(css_248z$8);
|
|
3574
3654
|
|
|
3575
3655
|
var TabPane$1 = antd.Tabs.TabPane;
|
|
3576
3656
|
var Option$2 = antd.Select.Option;
|
|
@@ -4067,10 +4147,12 @@ exports.ChooseBaby = ChooseBaby;
|
|
|
4067
4147
|
exports.ExpressLogistics = ExpressLogistics;
|
|
4068
4148
|
exports.Goods = Goods;
|
|
4069
4149
|
exports.GoodsTable = index;
|
|
4150
|
+
exports.IdentifyAddress = IdentifyAddress;
|
|
4070
4151
|
exports.Invoice = Invoice;
|
|
4071
4152
|
exports.JstGoods = jstGoods;
|
|
4072
4153
|
exports.JstItemList = ItemList;
|
|
4073
4154
|
exports.LogisticsInterception = LogisticsInterception;
|
|
4155
|
+
exports.ParseLogistics = ParseLogistics;
|
|
4074
4156
|
exports.Payment = Payment;
|
|
4075
4157
|
exports.Remark = RemarkInput;
|
|
4076
4158
|
exports.ReturnLogistics = ExpressLogistics;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IdentifyAddressProps {
|
|
3
|
+
value: {
|
|
4
|
+
address: any[];
|
|
5
|
+
detail: string;
|
|
6
|
+
receiverName: string;
|
|
7
|
+
receiverMobile: string;
|
|
8
|
+
};
|
|
9
|
+
onChange: (value: any) => void;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const IdentifyAddress: (props: IdentifyAddressProps) => React.JSX.Element;
|
|
13
|
+
export default IdentifyAddress;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -33,3 +33,5 @@ export { default as Goods } from './common/Goods';
|
|
|
33
33
|
export { default as JstGoods } from './jst/Goods';
|
|
34
34
|
export { default as JstItemList } from './jst/ItemList';
|
|
35
35
|
export { default as GoodsTable } from './common/GoodsTable';
|
|
36
|
+
export { default as ParseLogistics } from './common/ParseLogistics';
|
|
37
|
+
export { default as IdentifyAddress } from './common/IdentifyAddress';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3-alpha.0",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"lint": "eslint '**/*.{ts,tsx}'",
|
|
17
17
|
"lint:fix": "eslint --fix '**/*.{ts,tsx}'",
|
|
18
18
|
"start": "dumi dev",
|
|
19
|
-
"
|
|
20
|
-
"
|
|
19
|
+
"test": "jest",
|
|
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.7.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.7.3-alpha.0",
|
|
24
24
|
"umi-request": "^1.4.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "b0f87f2b77d722025171a0f3e03132a8684da6e0"
|
|
58
58
|
}
|