@kmkf-fe-packages/basic-components 0.28.2-rc.9 → 0.29.0-beta.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 +1051 -268
- package/dist/index.js +1054 -266
- package/dist/src/bs/component/model/WdtGoodList.d.ts +40 -0
- package/dist/src/business/LogisticsInterception/index.d.ts +0 -2
- package/dist/src/common/CommonExchangeGoods/index.d.ts +3 -0
- package/dist/src/common/CommonReturnGoods/index.d.ts +3 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/jst/Goods/index.d.ts +1 -0
- package/dist/src/wdt/Reissue/index.d.ts +3 -0
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ var zhCN = require('antd/lib/locale/zh_CN');
|
|
|
12
12
|
var lodash = require('lodash');
|
|
13
13
|
var ahooks = require('ahooks');
|
|
14
14
|
var pubsub = require('pubsub-js');
|
|
15
|
+
var BigNumber = require('bignumber.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
18
|
|
|
@@ -19,6 +20,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
19
20
|
var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
|
|
20
21
|
var zhCN__default = /*#__PURE__*/_interopDefaultLegacy(zhCN);
|
|
21
22
|
var pubsub__default = /*#__PURE__*/_interopDefaultLegacy(pubsub);
|
|
23
|
+
var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
|
|
22
24
|
|
|
23
25
|
function _iterableToArrayLimit(arr, i) {
|
|
24
26
|
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
@@ -7574,10 +7576,11 @@ function ApaasPosting(props) {
|
|
|
7574
7576
|
});
|
|
7575
7577
|
}
|
|
7576
7578
|
|
|
7577
|
-
var _excluded$a = ["value", "onChange"];
|
|
7579
|
+
var _excluded$a = ["value", "onChange", "platformType"];
|
|
7578
7580
|
function ApaasLogistics(props) {
|
|
7579
7581
|
var value = props.value,
|
|
7580
7582
|
onChange = props.onChange,
|
|
7583
|
+
platformType = props.platformType,
|
|
7581
7584
|
other = _objectWithoutProperties(props, _excluded$a);
|
|
7582
7585
|
var _useState = React.useState([]),
|
|
7583
7586
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -7590,7 +7593,7 @@ function ApaasLogistics(props) {
|
|
|
7590
7593
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7591
7594
|
while (1) switch (_context.prev = _context.next) {
|
|
7592
7595
|
case 0:
|
|
7593
|
-
express = kmkfUtils.ExpressData.getInstance();
|
|
7596
|
+
express = kmkfUtils.ExpressData.getInstance(platformType);
|
|
7594
7597
|
setOptions(express.expressData || []);
|
|
7595
7598
|
case 2:
|
|
7596
7599
|
case "end":
|
|
@@ -9709,9 +9712,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9709
9712
|
_props$disabled = props.disabled,
|
|
9710
9713
|
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
|
9711
9714
|
_props$isEditing = props.isEditing,
|
|
9712
|
-
isEditing = _props$isEditing === void 0 ? false : _props$isEditing
|
|
9713
|
-
_props$showState = props.showState,
|
|
9714
|
-
showState = _props$showState === void 0 ? false : _props$showState;
|
|
9715
|
+
isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
|
|
9715
9716
|
var _useState = React.useState(''),
|
|
9716
9717
|
_useState2 = _slicedToArray(_useState, 2),
|
|
9717
9718
|
initCompany = _useState2[0],
|
|
@@ -9846,8 +9847,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9846
9847
|
interceptReceiverMobile: undefined,
|
|
9847
9848
|
interceptLogisticsStatus: undefined,
|
|
9848
9849
|
interceptLogisticsStatusOther: undefined,
|
|
9849
|
-
interceptLogisticsSnapshot: undefined
|
|
9850
|
-
qySelfInterceptStatus: undefined
|
|
9850
|
+
interceptLogisticsSnapshot: undefined
|
|
9851
9851
|
});
|
|
9852
9852
|
}
|
|
9853
9853
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
@@ -9992,24 +9992,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
|
|
|
9992
9992
|
onChange: function onChange(e) {
|
|
9993
9993
|
return changeHandle(e.target.value, 'interceptLogisticsStatusOther');
|
|
9994
9994
|
}
|
|
9995
|
-
})), /*#__PURE__*/React__default['default'].createElement(Item, {
|
|
9996
|
-
label: '拦截状态',
|
|
9997
|
-
key: 'qySelfInterceptStatus',
|
|
9998
|
-
hidden: showState
|
|
9999
|
-
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
10000
|
-
value: value === null || value === void 0 ? void 0 : value.qySelfInterceptStatus,
|
|
10001
|
-
disabled: disabled || isEdit,
|
|
10002
|
-
placeholder: "\u62E6\u622A\u72B6\u6001",
|
|
10003
|
-
onChange: function onChange(val) {
|
|
10004
|
-
return changeHandle(val, 'qySelfInterceptStatus');
|
|
10005
|
-
},
|
|
10006
|
-
options: [{
|
|
10007
|
-
label: '拦截成功',
|
|
10008
|
-
value: '拦截成功'
|
|
10009
|
-
}, {
|
|
10010
|
-
label: '拦截失败',
|
|
10011
|
-
value: '拦截失败'
|
|
10012
|
-
}]
|
|
10013
9995
|
})));
|
|
10014
9996
|
};
|
|
10015
9997
|
|
|
@@ -10434,7 +10416,7 @@ var typeInitValueMap = {
|
|
|
10434
10416
|
}]
|
|
10435
10417
|
};
|
|
10436
10418
|
var jstGoods = function jstGoods(props) {
|
|
10437
|
-
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
|
|
10419
|
+
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7, _value$changeIndex8;
|
|
10438
10420
|
var _props$value = props.value,
|
|
10439
10421
|
value = _props$value === void 0 ? [] : _props$value,
|
|
10440
10422
|
onChange = props.onChange,
|
|
@@ -10442,11 +10424,14 @@ var jstGoods = function jstGoods(props) {
|
|
|
10442
10424
|
_props$type = props.type,
|
|
10443
10425
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
10444
10426
|
_props$showField = props.showField,
|
|
10445
|
-
showField = _props$showField === void 0 ? '' : _props$showField
|
|
10427
|
+
showField = _props$showField === void 0 ? '' : _props$showField,
|
|
10428
|
+
_props$platformType = props.platformType,
|
|
10429
|
+
platformType = _props$platformType === void 0 ? 'default' : _props$platformType;
|
|
10446
10430
|
var _useState = React.useState(0),
|
|
10447
10431
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10448
10432
|
changeIndex = _useState2[0],
|
|
10449
10433
|
setChangeIndex = _useState2[1]; //选中的包裹
|
|
10434
|
+
var wdtSendOptions = kmkfUtils.WdtSendData.getInstance().wdtSendData || [];
|
|
10450
10435
|
React.useEffect(function () {
|
|
10451
10436
|
//没有值塞个默认值
|
|
10452
10437
|
if (!(value === null || value === void 0 ? void 0 : value.length)) {
|
|
@@ -10473,6 +10458,18 @@ var jstGoods = function jstGoods(props) {
|
|
|
10473
10458
|
}), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement("div", null, t.title), /*#__PURE__*/React__default['default'].createElement("div", null, "\u7F16\u7801\uFF1A", t.skuId))));
|
|
10474
10459
|
}));
|
|
10475
10460
|
};
|
|
10461
|
+
var handleSelected = function handleSelected(val, type, option) {
|
|
10462
|
+
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
10463
|
+
changeOrderInfo[type] = val;
|
|
10464
|
+
changeOrderInfo['sendId'] = option.value;
|
|
10465
|
+
var newList = _toConsumableArray(value);
|
|
10466
|
+
newList[changeIndex] = changeOrderInfo;
|
|
10467
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
10468
|
+
};
|
|
10469
|
+
var filterOption = function filterOption(input, option) {
|
|
10470
|
+
var _option$label;
|
|
10471
|
+
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').includes(input);
|
|
10472
|
+
};
|
|
10476
10473
|
var changeInputHandle = function changeInputHandle(val, type) {
|
|
10477
10474
|
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
10478
10475
|
changeOrderInfo[type] = val;
|
|
@@ -10511,10 +10508,12 @@ var jstGoods = function jstGoods(props) {
|
|
|
10511
10508
|
filterOption: function filterOption(input, option) {
|
|
10512
10509
|
return option.label.includes(input);
|
|
10513
10510
|
},
|
|
10511
|
+
dropdownMatchSelectWidth: false,
|
|
10514
10512
|
style: {
|
|
10515
10513
|
minWidth: '100px',
|
|
10516
10514
|
maxWidth: '180px'
|
|
10517
|
-
}
|
|
10515
|
+
},
|
|
10516
|
+
platformType: platformType
|
|
10518
10517
|
}) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10519
10518
|
disabled: disabled,
|
|
10520
10519
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
@@ -10543,20 +10542,34 @@ var jstGoods = function jstGoods(props) {
|
|
|
10543
10542
|
return changeInputHandle(e.target.value, 'sendId');
|
|
10544
10543
|
},
|
|
10545
10544
|
value: (_value$changeIndex5 = value[changeIndex]) === null || _value$changeIndex5 === void 0 ? void 0 : _value$changeIndex5.sendId
|
|
10546
|
-
}), ['sendName', 'all'].includes(showField) && /*#__PURE__*/React__default['default'].createElement(antd.
|
|
10545
|
+
}), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
10546
|
+
style: {
|
|
10547
|
+
minWidth: '100px',
|
|
10548
|
+
maxWidth: '180px'
|
|
10549
|
+
},
|
|
10550
|
+
disabled: disabled,
|
|
10551
|
+
placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
|
|
10552
|
+
showSearch: true,
|
|
10553
|
+
options: wdtSendOptions,
|
|
10554
|
+
filterOption: filterOption,
|
|
10555
|
+
value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName,
|
|
10556
|
+
onChange: function onChange(value, option) {
|
|
10557
|
+
return handleSelected(value, 'sendName', option);
|
|
10558
|
+
}
|
|
10559
|
+
}) : /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10547
10560
|
disabled: disabled,
|
|
10548
10561
|
placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u540D\u79F0",
|
|
10549
10562
|
onChange: function onChange(e) {
|
|
10550
10563
|
return changeInputHandle(e.target.value, 'sendName');
|
|
10551
10564
|
},
|
|
10552
|
-
value: (_value$
|
|
10553
|
-
})) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10565
|
+
value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
|
|
10566
|
+
}))) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10554
10567
|
disabled: disabled,
|
|
10555
10568
|
placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
|
|
10556
10569
|
onChange: function onChange(e) {
|
|
10557
10570
|
return changeInputHandle(e.target.value, 'deliveryNo');
|
|
10558
10571
|
},
|
|
10559
|
-
value: (_value$
|
|
10572
|
+
value: (_value$changeIndex8 = value[changeIndex]) === null || _value$changeIndex8 === void 0 ? void 0 : _value$changeIndex8.sendName
|
|
10560
10573
|
})) : null) : null);
|
|
10561
10574
|
};
|
|
10562
10575
|
|
|
@@ -11123,6 +11136,12 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
11123
11136
|
var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
|
|
11124
11137
|
|
|
11125
11138
|
var RangePicker = antd.DatePicker.RangePicker;
|
|
11139
|
+
var getWdtListProduct = function getWdtListProduct(data) {
|
|
11140
|
+
return extendRequest('/qy/gdfw/product/wdtListProduct', {
|
|
11141
|
+
method: 'post',
|
|
11142
|
+
data: data
|
|
11143
|
+
});
|
|
11144
|
+
};
|
|
11126
11145
|
var columns$1 = [{
|
|
11127
11146
|
dataIndex: 'index',
|
|
11128
11147
|
title: 'NO',
|
|
@@ -11197,226 +11216,174 @@ var expandedColumns = [{
|
|
|
11197
11216
|
title: '会员价',
|
|
11198
11217
|
width: 140
|
|
11199
11218
|
}];
|
|
11200
|
-
var
|
|
11201
|
-
var
|
|
11202
|
-
var
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
setVisible(true);
|
|
11208
|
-
setPageNo(1);
|
|
11209
|
-
setSelect([]);
|
|
11210
|
-
setSelectIds([]);
|
|
11211
|
-
form.setFieldsValue({
|
|
11212
|
-
dateTimePicker: [initStartTime, initEndTime],
|
|
11213
|
-
code: ''
|
|
11214
|
-
});
|
|
11215
|
-
// getShopList();
|
|
11216
|
-
}
|
|
11217
|
-
};
|
|
11218
|
-
});
|
|
11219
|
-
|
|
11220
|
-
var onSubmit = props.onSubmit,
|
|
11221
|
-
shopId = props.shopId,
|
|
11222
|
-
shopList = props.shopList,
|
|
11223
|
-
width = props.width,
|
|
11224
|
-
companyKey = props.companyKey;
|
|
11225
|
-
var _useState = React.useState(false),
|
|
11219
|
+
var getInitTime = function getInitTime() {
|
|
11220
|
+
var initStartTime = hooks().subtract(30, 'd').hours(0).minutes(0).seconds(0);
|
|
11221
|
+
var initEndTime = hooks().hours(23).minutes(59).seconds(59);
|
|
11222
|
+
return [initStartTime, initEndTime];
|
|
11223
|
+
};
|
|
11224
|
+
var GoodList = function GoodList(props, ref) {
|
|
11225
|
+
var _useState = React.useState([]),
|
|
11226
11226
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
var _useState3 = React.useState(
|
|
11227
|
+
selectList = _useState2[0],
|
|
11228
|
+
setSelect = _useState2[1];
|
|
11229
|
+
var _useState3 = React.useState(1),
|
|
11230
11230
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
var _useState5 = React.useState(
|
|
11234
|
-
_useState6 = _slicedToArray(_useState5,
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
var _useState7 = React.useState(1),
|
|
11231
|
+
pageNo = _useState4[0],
|
|
11232
|
+
setPageNo = _useState4[1];
|
|
11233
|
+
var _useState5 = React.useState(10),
|
|
11234
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
11235
|
+
pageSize = _useState6[0];
|
|
11236
|
+
var _useState7 = React.useState([]),
|
|
11238
11237
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
var _useState9 = React.useState(
|
|
11242
|
-
_useState10 = _slicedToArray(_useState9,
|
|
11243
|
-
|
|
11244
|
-
|
|
11238
|
+
goodList = _useState8[0],
|
|
11239
|
+
setGoodList = _useState8[1];
|
|
11240
|
+
var _useState9 = React.useState(false),
|
|
11241
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
11242
|
+
loading = _useState10[0],
|
|
11243
|
+
setLoading = _useState10[1];
|
|
11244
|
+
var _useState11 = React.useState(0),
|
|
11245
11245
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
var _useState13 = React.useState(
|
|
11246
|
+
total = _useState12[0],
|
|
11247
|
+
setTotal = _useState12[1];
|
|
11248
|
+
var _useState13 = React.useState(null),
|
|
11249
11249
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11250
|
+
dates = _useState14[0],
|
|
11251
|
+
setDates = _useState14[1];
|
|
11252
|
+
React.useImperativeHandle(ref, function () {
|
|
11253
|
+
return {
|
|
11254
|
+
getSelectGoodList: function getSelectGoodList() {
|
|
11255
|
+
return selectList;
|
|
11256
|
+
}
|
|
11257
|
+
};
|
|
11258
|
+
});
|
|
11256
11259
|
var displaySelectList = React.useMemo(function () {
|
|
11257
11260
|
return selectList.map(function (item, i) {
|
|
11258
11261
|
item.index = i + 1;
|
|
11259
11262
|
return item;
|
|
11260
11263
|
});
|
|
11261
11264
|
}, [selectList]);
|
|
11262
|
-
React.useEffect(function () {
|
|
11263
|
-
if (visible) {
|
|
11264
|
-
queryItems();
|
|
11265
|
-
}
|
|
11266
|
-
}, [pageNo, visible]);
|
|
11267
11265
|
var _Form$useForm = antd.Form.useForm(),
|
|
11268
11266
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
11269
11267
|
form = _Form$useForm2[0];
|
|
11270
|
-
//选择页码
|
|
11271
|
-
var pageChange = function pageChange(page) {
|
|
11272
|
-
setPageNo(page);
|
|
11273
|
-
};
|
|
11274
11268
|
/**
|
|
11275
11269
|
* 查询商品
|
|
11276
11270
|
*/
|
|
11277
11271
|
var queryItems = /*#__PURE__*/function () {
|
|
11278
11272
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
11279
|
-
var
|
|
11280
|
-
_formData$dateTimePic,
|
|
11281
|
-
_formData$dateTimePic2,
|
|
11282
|
-
_formData$dateTimePic3,
|
|
11283
|
-
_formData$dateTimePic4,
|
|
11284
|
-
_formData$dateTimePic5,
|
|
11285
|
-
_formData$dateTimePic6,
|
|
11286
|
-
formData,
|
|
11287
|
-
startTime,
|
|
11288
|
-
endTime,
|
|
11289
|
-
params,
|
|
11290
|
-
res,
|
|
11291
|
-
_res$data,
|
|
11292
|
-
_res$data$productList,
|
|
11293
|
-
productList,
|
|
11294
|
-
_res$data$total,
|
|
11295
|
-
_total,
|
|
11296
|
-
errorMsg,
|
|
11297
|
-
newProducts,
|
|
11298
|
-
_args = arguments;
|
|
11273
|
+
var _formData$dateTimePic, _formData$dateTimePic2, _formData$dateTimePic3, _formData$dateTimePic4, _formData$dateTimePic5, _formData$dateTimePic6, formData, _getInitTime, _getInitTime2, start, end, startTime, endTime, newTime, earliest, params;
|
|
11299
11274
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11300
11275
|
while (1) switch (_context.prev = _context.next) {
|
|
11301
11276
|
case 0:
|
|
11302
|
-
|
|
11303
|
-
_context.prev = 1;
|
|
11277
|
+
_context.prev = 0;
|
|
11304
11278
|
setLoading(true);
|
|
11305
11279
|
formData = form.getFieldsValue();
|
|
11306
|
-
|
|
11307
|
-
|
|
11280
|
+
_getInitTime = getInitTime(), _getInitTime2 = _slicedToArray(_getInitTime, 2), start = _getInitTime2[0], end = _getInitTime2[1];
|
|
11281
|
+
startTime = ((_formData$dateTimePic = formData.dateTimePicker) === null || _formData$dateTimePic === void 0 ? void 0 : (_formData$dateTimePic2 = _formData$dateTimePic[0]) === null || _formData$dateTimePic2 === void 0 ? void 0 : (_formData$dateTimePic3 = _formData$dateTimePic2.format) === null || _formData$dateTimePic3 === void 0 ? void 0 : _formData$dateTimePic3.call(_formData$dateTimePic2, 'YYYY-MM-DD HH:mm:ss')) || start.format('YYYY-MM-DD HH:mm:ss');
|
|
11282
|
+
endTime = ((_formData$dateTimePic4 = formData.dateTimePicker) === null || _formData$dateTimePic4 === void 0 ? void 0 : (_formData$dateTimePic5 = _formData$dateTimePic4[1]) === null || _formData$dateTimePic5 === void 0 ? void 0 : (_formData$dateTimePic6 = _formData$dateTimePic5.format) === null || _formData$dateTimePic6 === void 0 ? void 0 : _formData$dateTimePic6.call(_formData$dateTimePic5, 'YYYY-MM-DD HH:mm:ss')) || end.format('YYYY-MM-DD HH:mm:ss');
|
|
11283
|
+
endTime = hooks(endTime).hours(23).minutes(59).seconds(59).format('YYYY-MM-DD HH:mm:ss');
|
|
11284
|
+
// PS: 故意推前3分钟,不然极端情况下,接口会报错
|
|
11285
|
+
newTime = hooks().subtract(3, 'm'); // 只能选比现在早的时间
|
|
11286
|
+
if (hooks(endTime).diff(newTime, 'seconds') > 0) {
|
|
11287
|
+
endTime = newTime.format('YYYY-MM-DD HH:mm:ss');
|
|
11288
|
+
}
|
|
11289
|
+
// 30天内
|
|
11290
|
+
earliest = hooks(endTime).subtract(30, 'd');
|
|
11291
|
+
if (earliest.diff(hooks(startTime), 'seconds') > 0) {
|
|
11292
|
+
startTime = earliest.format('YYYY-MM-DD HH:mm:ss');
|
|
11293
|
+
}
|
|
11308
11294
|
params = {
|
|
11309
|
-
// shopCode: shopCode,
|
|
11310
11295
|
pageSize: pageSize,
|
|
11311
11296
|
pageNo: pageNo - 1,
|
|
11312
|
-
goodNo:
|
|
11297
|
+
goodNo: formData.goodNo || null,
|
|
11298
|
+
specNo: formData.specNo || null,
|
|
11313
11299
|
startTime: startTime,
|
|
11314
11300
|
endTime: endTime
|
|
11315
11301
|
};
|
|
11316
|
-
_context.next =
|
|
11317
|
-
return
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11302
|
+
_context.next = 14;
|
|
11303
|
+
return getWdtListProduct(params).then(function (res) {
|
|
11304
|
+
if (res.success) {
|
|
11305
|
+
var _res$data = res.data,
|
|
11306
|
+
_res$data$productList = _res$data.productList,
|
|
11307
|
+
productList = _res$data$productList === void 0 ? [] : _res$data$productList,
|
|
11308
|
+
_res$data$total = _res$data.total,
|
|
11309
|
+
_total = _res$data$total === void 0 ? 0 : _res$data$total;
|
|
11310
|
+
var newProducts = productList.map(function (item, index) {
|
|
11311
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
11312
|
+
index: index + 1
|
|
11313
|
+
});
|
|
11328
11314
|
});
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11332
|
-
|
|
11315
|
+
setGoodList(newProducts);
|
|
11316
|
+
if (pageNo === 1) {
|
|
11317
|
+
setTotal(_total);
|
|
11318
|
+
}
|
|
11319
|
+
} else {
|
|
11320
|
+
var _res$data2;
|
|
11321
|
+
setGoodList([]);
|
|
11322
|
+
setTotal(0);
|
|
11323
|
+
antd.message.error(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.errorMsg) || res.message);
|
|
11333
11324
|
}
|
|
11334
|
-
}
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
case 12:
|
|
11340
|
-
_context.prev = 12;
|
|
11325
|
+
}).catch(function (e) {
|
|
11326
|
+
console.log(e);
|
|
11327
|
+
});
|
|
11328
|
+
case 14:
|
|
11329
|
+
_context.prev = 14;
|
|
11341
11330
|
setLoading(false);
|
|
11342
|
-
return _context.finish(
|
|
11343
|
-
case
|
|
11331
|
+
return _context.finish(14);
|
|
11332
|
+
case 17:
|
|
11344
11333
|
case "end":
|
|
11345
11334
|
return _context.stop();
|
|
11346
11335
|
}
|
|
11347
|
-
}, _callee, null, [[
|
|
11336
|
+
}, _callee, null, [[0,, 14, 17]]);
|
|
11348
11337
|
}));
|
|
11349
11338
|
return function queryItems() {
|
|
11350
11339
|
return _ref.apply(this, arguments);
|
|
11351
11340
|
};
|
|
11352
11341
|
}();
|
|
11353
|
-
var
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11342
|
+
var disabledDate = function disabledDate(current) {
|
|
11343
|
+
var today = hooks(hooks().format('YYYY-MM-DD'));
|
|
11344
|
+
var currentDay = hooks(current.format('YYYY-MM-DD'));
|
|
11345
|
+
if (currentDay.diff(today, 'days') > 0) {
|
|
11346
|
+
return true;
|
|
11347
|
+
}
|
|
11348
|
+
if (!dates) {
|
|
11349
|
+
return false;
|
|
11350
|
+
}
|
|
11351
|
+
var tooLate = dates[0] && current.diff(dates[0], 'days') > 30;
|
|
11352
|
+
var tooEarly = dates[1] && dates[1].diff(current, 'days') > 30;
|
|
11353
|
+
return !!tooEarly || !!tooLate;
|
|
11354
|
+
};
|
|
11355
|
+
var onOpenChange = function onOpenChange(open) {
|
|
11356
|
+
if (open) {
|
|
11357
|
+
setDates([null, null]);
|
|
11358
|
+
} else {
|
|
11359
|
+
setDates(null);
|
|
11360
|
+
}
|
|
11365
11361
|
};
|
|
11366
11362
|
var onReset = function onReset() {
|
|
11367
|
-
form.resetFields();
|
|
11368
11363
|
form.setFieldsValue({
|
|
11369
|
-
dateTimePicker:
|
|
11370
|
-
|
|
11364
|
+
dateTimePicker: getInitTime(),
|
|
11365
|
+
goodNo: '',
|
|
11366
|
+
specNo: ''
|
|
11371
11367
|
});
|
|
11372
11368
|
setPageNo(function (prev) {
|
|
11373
|
-
if (prev === 1
|
|
11369
|
+
if (prev === 1) {
|
|
11374
11370
|
queryItems();
|
|
11375
11371
|
}
|
|
11376
11372
|
return 1;
|
|
11377
11373
|
});
|
|
11378
11374
|
};
|
|
11379
|
-
|
|
11380
|
-
// const { success, data } = await request('/qy/diamond/getConfigInfo', {
|
|
11381
|
-
// method: 'get',
|
|
11382
|
-
// params: {
|
|
11383
|
-
// key: 'company-third-shop-info',
|
|
11384
|
-
// },
|
|
11385
|
-
// });
|
|
11386
|
-
// const obj: any = JSON.parse(data || '{}');
|
|
11387
|
-
// if (success) {
|
|
11388
|
-
// const list = (obj?.[companyKey] || []).map((item: any) => {
|
|
11389
|
-
// return {
|
|
11390
|
-
// label: item.shopName,
|
|
11391
|
-
// value: item.shopCode,
|
|
11392
|
-
// };
|
|
11393
|
-
// });
|
|
11394
|
-
// setShopList(list);
|
|
11395
|
-
// }
|
|
11396
|
-
// };
|
|
11397
|
-
var onValuesChange = function onValuesChange(changedValues) {
|
|
11398
|
-
if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
|
|
11399
|
-
queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
|
|
11400
|
-
pubsub__default['default'].publish('changeShopCode', {
|
|
11401
|
-
shopCode: changedValues.shopId
|
|
11402
|
-
});
|
|
11403
|
-
}
|
|
11404
|
-
};
|
|
11405
|
-
var handleDelete = function handleDelete(record, index) {
|
|
11375
|
+
var handleDelete = function handleDelete(record) {
|
|
11406
11376
|
var newSelectList = selectList.filter(function (item) {
|
|
11407
11377
|
return item.specId !== record.specId;
|
|
11408
11378
|
});
|
|
11409
11379
|
setSelect(_toConsumableArray(newSelectList));
|
|
11410
|
-
setSelectIds(_toConsumableArray(newSelectList.map(function (item) {
|
|
11411
|
-
return item.specId;
|
|
11412
|
-
})));
|
|
11413
11380
|
};
|
|
11414
11381
|
var displaySelectedColumns = [{
|
|
11415
11382
|
dataIndex: 'operation',
|
|
11416
11383
|
title: '',
|
|
11417
11384
|
ellipsis: true,
|
|
11418
11385
|
width: 50,
|
|
11419
|
-
render: function render(_, record
|
|
11386
|
+
render: function render(_, record) {
|
|
11420
11387
|
return /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, {
|
|
11421
11388
|
onClick: function onClick() {
|
|
11422
11389
|
return handleDelete(record);
|
|
@@ -11447,8 +11414,10 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11447
11414
|
}];
|
|
11448
11415
|
var expandedRowSelection = {
|
|
11449
11416
|
fixed: true,
|
|
11450
|
-
selectedRowKeys:
|
|
11451
|
-
|
|
11417
|
+
selectedRowKeys: selectList.map(function (item) {
|
|
11418
|
+
return item.specId;
|
|
11419
|
+
}),
|
|
11420
|
+
onSelect: function onSelect(record, selected) {
|
|
11452
11421
|
var tempList = [];
|
|
11453
11422
|
if (selected) {
|
|
11454
11423
|
tempList = [].concat(_toConsumableArray(selectList), [record]);
|
|
@@ -11458,9 +11427,6 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11458
11427
|
});
|
|
11459
11428
|
}
|
|
11460
11429
|
setSelect(_toConsumableArray(tempList));
|
|
11461
|
-
setSelectIds(_toConsumableArray(tempList.map(function (item) {
|
|
11462
|
-
return item.specId;
|
|
11463
|
-
})));
|
|
11464
11430
|
},
|
|
11465
11431
|
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
|
|
11466
11432
|
var tempAllList = [];
|
|
@@ -11474,15 +11440,12 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11474
11440
|
});
|
|
11475
11441
|
}
|
|
11476
11442
|
setSelect(_toConsumableArray(tempAllList));
|
|
11477
|
-
setSelectIds(_toConsumableArray(tempAllList.map(function (item) {
|
|
11478
|
-
return item.specId;
|
|
11479
|
-
})));
|
|
11480
11443
|
}
|
|
11481
11444
|
};
|
|
11482
|
-
var expandedRowRender = function expandedRowRender(record
|
|
11445
|
+
var expandedRowRender = function expandedRowRender(record) {
|
|
11483
11446
|
return /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
11484
|
-
rowKey:
|
|
11485
|
-
size:
|
|
11447
|
+
rowKey: "specId",
|
|
11448
|
+
size: "small",
|
|
11486
11449
|
columns: expandedColumns,
|
|
11487
11450
|
dataSource: record.itemDetailList || [],
|
|
11488
11451
|
pagination: false,
|
|
@@ -11492,43 +11455,61 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11492
11455
|
}
|
|
11493
11456
|
});
|
|
11494
11457
|
};
|
|
11495
|
-
|
|
11496
|
-
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
visible: visible,
|
|
11500
|
-
width: width || 850,
|
|
11501
|
-
onCancel: function onCancel() {
|
|
11502
|
-
_onCancel();
|
|
11503
|
-
},
|
|
11504
|
-
onOk: onOk,
|
|
11505
|
-
wrapClassName: "goodModal"
|
|
11506
|
-
}, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
|
|
11458
|
+
React__default['default'].useEffect(function () {
|
|
11459
|
+
queryItems();
|
|
11460
|
+
}, []);
|
|
11461
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
|
|
11507
11462
|
layout: "inline",
|
|
11508
11463
|
form: form,
|
|
11509
|
-
onFinish:
|
|
11510
|
-
onValuesChange: onValuesChange,
|
|
11464
|
+
onFinish: queryItems,
|
|
11511
11465
|
initialValues: {
|
|
11512
|
-
|
|
11466
|
+
goodNo: '',
|
|
11467
|
+
specNo: '',
|
|
11468
|
+
dateTimePicker: getInitTime()
|
|
11513
11469
|
}
|
|
11514
11470
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11515
|
-
name: "dateTimePicker"
|
|
11471
|
+
name: "dateTimePicker",
|
|
11472
|
+
style: {
|
|
11473
|
+
marginBottom: '12px'
|
|
11474
|
+
}
|
|
11516
11475
|
}, /*#__PURE__*/React__default['default'].createElement(RangePicker, {
|
|
11517
11476
|
style: {
|
|
11518
|
-
width: '
|
|
11477
|
+
width: '240px'
|
|
11519
11478
|
},
|
|
11520
11479
|
placeholder: ['开始日期', '结束日期'],
|
|
11521
|
-
showTime:
|
|
11522
|
-
|
|
11480
|
+
showTime: false,
|
|
11481
|
+
disabledDate: disabledDate,
|
|
11482
|
+
onCalendarChange: function onCalendarChange(val) {
|
|
11483
|
+
return setDates(val);
|
|
11484
|
+
},
|
|
11485
|
+
onOpenChange: onOpenChange
|
|
11523
11486
|
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11524
|
-
name: "
|
|
11487
|
+
name: "goodNo",
|
|
11488
|
+
style: {
|
|
11489
|
+
marginBottom: '12px'
|
|
11490
|
+
}
|
|
11525
11491
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
11526
11492
|
placeholder: "\u5546\u54C1SPU\u7F16\u7801",
|
|
11527
11493
|
allowClear: true,
|
|
11528
11494
|
style: {
|
|
11529
11495
|
width: 150
|
|
11530
11496
|
}
|
|
11531
|
-
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item,
|
|
11497
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11498
|
+
name: "specNo",
|
|
11499
|
+
style: {
|
|
11500
|
+
marginBottom: '12px'
|
|
11501
|
+
}
|
|
11502
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
11503
|
+
placeholder: "\u5546\u54C1SKU\u7F16\u7801",
|
|
11504
|
+
allowClear: true,
|
|
11505
|
+
style: {
|
|
11506
|
+
width: 150
|
|
11507
|
+
}
|
|
11508
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11509
|
+
style: {
|
|
11510
|
+
marginBottom: '12px'
|
|
11511
|
+
}
|
|
11512
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
11532
11513
|
type: "primary",
|
|
11533
11514
|
htmlType: "submit",
|
|
11534
11515
|
style: {
|
|
@@ -11538,10 +11519,10 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11538
11519
|
onClick: onReset
|
|
11539
11520
|
}, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11540
11521
|
style: {
|
|
11541
|
-
marginTop: '
|
|
11522
|
+
marginTop: '4px'
|
|
11542
11523
|
}
|
|
11543
11524
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
11544
|
-
rowKey:
|
|
11525
|
+
rowKey: "goodNo",
|
|
11545
11526
|
columns: columns$1,
|
|
11546
11527
|
dataSource: goodList,
|
|
11547
11528
|
loading: loading,
|
|
@@ -11558,14 +11539,14 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11558
11539
|
current: pageNo,
|
|
11559
11540
|
pageSize: pageSize,
|
|
11560
11541
|
pageSizeOptions: [],
|
|
11561
|
-
onChange:
|
|
11542
|
+
onChange: setPageNo
|
|
11562
11543
|
}
|
|
11563
11544
|
})), !!selectList.length && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Space, null, "\u5DF2\u7ECF\u9009\u62E9\u5546\u54C1\uFF08", selectList.length, "\uFF09"), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11564
11545
|
style: {
|
|
11565
11546
|
marginTop: '16px'
|
|
11566
11547
|
}
|
|
11567
11548
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
11568
|
-
rowKey:
|
|
11549
|
+
rowKey: "specId",
|
|
11569
11550
|
columns: [].concat(displaySelectedColumns, expandedColumns),
|
|
11570
11551
|
dataSource: displaySelectList,
|
|
11571
11552
|
pagination: false,
|
|
@@ -11576,7 +11557,48 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11576
11557
|
style: {
|
|
11577
11558
|
width: '100%'
|
|
11578
11559
|
}
|
|
11579
|
-
}))))
|
|
11560
|
+
}))));
|
|
11561
|
+
};
|
|
11562
|
+
var WdtGoodList = /*#__PURE__*/React.forwardRef(GoodList);
|
|
11563
|
+
|
|
11564
|
+
var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
11565
|
+
React.useImperativeHandle(ref, function () {
|
|
11566
|
+
return {
|
|
11567
|
+
open: function open() {
|
|
11568
|
+
setVisible(true);
|
|
11569
|
+
}
|
|
11570
|
+
};
|
|
11571
|
+
});
|
|
11572
|
+
var onSubmit = props.onSubmit,
|
|
11573
|
+
width = props.width;
|
|
11574
|
+
var _useState = React.useState(false),
|
|
11575
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11576
|
+
visible = _useState2[0],
|
|
11577
|
+
setVisible = _useState2[1];
|
|
11578
|
+
var wdtGoodListRef = React.useRef(null);
|
|
11579
|
+
var _onCancel = function onCancel() {
|
|
11580
|
+
setVisible(false);
|
|
11581
|
+
};
|
|
11582
|
+
var onOk = function onOk() {
|
|
11583
|
+
var _wdtGoodListRef$curre;
|
|
11584
|
+
var selectedList = ((_wdtGoodListRef$curre = wdtGoodListRef.current) === null || _wdtGoodListRef$curre === void 0 ? void 0 : _wdtGoodListRef$curre.getSelectGoodList()) || [];
|
|
11585
|
+
onSubmit(selectedList);
|
|
11586
|
+
_onCancel();
|
|
11587
|
+
};
|
|
11588
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
11589
|
+
title: '选择商品',
|
|
11590
|
+
okText: '确认',
|
|
11591
|
+
cancelText: '取消',
|
|
11592
|
+
visible: visible,
|
|
11593
|
+
width: width || 850,
|
|
11594
|
+
onCancel: function onCancel() {
|
|
11595
|
+
_onCancel();
|
|
11596
|
+
},
|
|
11597
|
+
onOk: onOk,
|
|
11598
|
+
wrapClassName: "goodModal"
|
|
11599
|
+
}, /*#__PURE__*/React__default['default'].createElement(WdtGoodList, {
|
|
11600
|
+
ref: wdtGoodListRef
|
|
11601
|
+
})));
|
|
11580
11602
|
};
|
|
11581
11603
|
var WdtGoodsModal = /*#__PURE__*/React.forwardRef(GoodsModal$3);
|
|
11582
11604
|
|
|
@@ -11632,9 +11654,34 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
11632
11654
|
React.useEffect(function () {
|
|
11633
11655
|
setSelectedRowKeys([]);
|
|
11634
11656
|
}, [tableSelect, selectType]);
|
|
11635
|
-
var updateHandle = function updateHandle(val, index,
|
|
11657
|
+
var updateHandle = function updateHandle(val, index, columnType) {
|
|
11636
11658
|
if (value === null || value === void 0 ? void 0 : value.length) {
|
|
11637
|
-
value[index][
|
|
11659
|
+
value[index][columnType] = val;
|
|
11660
|
+
if (type === 'WDT_RETURN_GOODS') {
|
|
11661
|
+
if (['sharePrice', 'num'].includes(columnType)) {
|
|
11662
|
+
var totalMoney = null;
|
|
11663
|
+
if (columnType === 'num') {
|
|
11664
|
+
totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].sharePrice));
|
|
11665
|
+
} else {
|
|
11666
|
+
totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
|
|
11667
|
+
}
|
|
11668
|
+
if (totalMoney !== null) {
|
|
11669
|
+
value[index]['returnPrice'] = totalMoney.toString();
|
|
11670
|
+
}
|
|
11671
|
+
}
|
|
11672
|
+
} else if (type === 'WDT_EXCHANGE_GOODS') {
|
|
11673
|
+
if (['price', 'num'].includes(columnType)) {
|
|
11674
|
+
var _totalMoney = null;
|
|
11675
|
+
if (columnType === 'num') {
|
|
11676
|
+
_totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].price));
|
|
11677
|
+
} else {
|
|
11678
|
+
_totalMoney = new BigNumber__default['default'](value[index][columnType]).multipliedBy(new BigNumber__default['default'](value[index].num));
|
|
11679
|
+
}
|
|
11680
|
+
if (_totalMoney !== null) {
|
|
11681
|
+
value[index]['exchangePrice'] = _totalMoney.toString();
|
|
11682
|
+
}
|
|
11683
|
+
}
|
|
11684
|
+
}
|
|
11638
11685
|
onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
|
|
11639
11686
|
}
|
|
11640
11687
|
};
|
|
@@ -11740,6 +11787,260 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
11740
11787
|
}
|
|
11741
11788
|
}];
|
|
11742
11789
|
break;
|
|
11790
|
+
case 'WDT_RETURN_GOODS':
|
|
11791
|
+
{
|
|
11792
|
+
columns = [{
|
|
11793
|
+
dataIndex: 'goodId',
|
|
11794
|
+
title: "SPUID",
|
|
11795
|
+
align: 'center',
|
|
11796
|
+
ellipsis: true,
|
|
11797
|
+
width: 70
|
|
11798
|
+
}, {
|
|
11799
|
+
dataIndex: 'goodNo',
|
|
11800
|
+
title: "\u5546\u54C1SPU\u7F16\u7801",
|
|
11801
|
+
align: 'center',
|
|
11802
|
+
ellipsis: true,
|
|
11803
|
+
width: 180
|
|
11804
|
+
}, {
|
|
11805
|
+
dataIndex: 'goodName',
|
|
11806
|
+
title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
|
|
11807
|
+
align: 'center',
|
|
11808
|
+
ellipsis: true,
|
|
11809
|
+
width: 250
|
|
11810
|
+
}, {
|
|
11811
|
+
dataIndex: 'specId',
|
|
11812
|
+
title: "".concat(text, "SKUID"),
|
|
11813
|
+
align: 'center',
|
|
11814
|
+
ellipsis: true,
|
|
11815
|
+
width: 100
|
|
11816
|
+
}, {
|
|
11817
|
+
dataIndex: 'specNo',
|
|
11818
|
+
title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
|
|
11819
|
+
align: 'center',
|
|
11820
|
+
ellipsis: true,
|
|
11821
|
+
width: 180
|
|
11822
|
+
}, {
|
|
11823
|
+
dataIndex: 'specName',
|
|
11824
|
+
title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
|
|
11825
|
+
align: 'center',
|
|
11826
|
+
ellipsis: true,
|
|
11827
|
+
width: 250
|
|
11828
|
+
}, {
|
|
11829
|
+
dataIndex: 'num',
|
|
11830
|
+
title: "".concat(text, "\u9000\u8D27\u6570\u91CF"),
|
|
11831
|
+
align: 'center',
|
|
11832
|
+
ellipsis: true,
|
|
11833
|
+
width: 100,
|
|
11834
|
+
render: function render(val, record, index) {
|
|
11835
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
11836
|
+
style: {
|
|
11837
|
+
width: 70
|
|
11838
|
+
},
|
|
11839
|
+
value: val,
|
|
11840
|
+
min: 0,
|
|
11841
|
+
precision: 0,
|
|
11842
|
+
onChange: function onChange(num) {
|
|
11843
|
+
return updateHandle(num, index, 'num');
|
|
11844
|
+
}
|
|
11845
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
11846
|
+
}
|
|
11847
|
+
}, {
|
|
11848
|
+
dataIndex: 'sharePrice',
|
|
11849
|
+
title: "\u5206\u644A\u4EF7",
|
|
11850
|
+
align: 'center',
|
|
11851
|
+
ellipsis: true,
|
|
11852
|
+
width: 80,
|
|
11853
|
+
render: function render(val, record, index) {
|
|
11854
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
11855
|
+
style: {
|
|
11856
|
+
width: 70
|
|
11857
|
+
},
|
|
11858
|
+
value: val,
|
|
11859
|
+
min: 0,
|
|
11860
|
+
onChange: function onChange(value) {
|
|
11861
|
+
return updateHandle(value, index, 'sharePrice');
|
|
11862
|
+
}
|
|
11863
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
11864
|
+
}
|
|
11865
|
+
}, {
|
|
11866
|
+
dataIndex: 'returnPrice',
|
|
11867
|
+
title: "".concat(text, "\u9000\u8D27\u91D1\u989D"),
|
|
11868
|
+
align: 'center',
|
|
11869
|
+
ellipsis: true,
|
|
11870
|
+
width: 100
|
|
11871
|
+
}, {
|
|
11872
|
+
dataIndex: 'giftType',
|
|
11873
|
+
title: "\u8D60\u54C1\u65B9\u5F0F",
|
|
11874
|
+
align: 'center',
|
|
11875
|
+
ellipsis: true,
|
|
11876
|
+
width: 100,
|
|
11877
|
+
render: function render(val) {
|
|
11878
|
+
var giftTypeMap = {
|
|
11879
|
+
0: '非赠品',
|
|
11880
|
+
1: '自动赠送',
|
|
11881
|
+
2: '手工赠送',
|
|
11882
|
+
3: '回购自动送赠品',
|
|
11883
|
+
4: '前N有礼送赠品',
|
|
11884
|
+
6: '天猫优仓赠品',
|
|
11885
|
+
7: '淘宝CRM会员送赠'
|
|
11886
|
+
};
|
|
11887
|
+
return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
|
|
11888
|
+
}
|
|
11889
|
+
}, {
|
|
11890
|
+
dataIndex: 'productType',
|
|
11891
|
+
title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
|
|
11892
|
+
align: 'center',
|
|
11893
|
+
ellipsis: true,
|
|
11894
|
+
width: 100,
|
|
11895
|
+
render: function render(val, record, index) {
|
|
11896
|
+
var options = [{
|
|
11897
|
+
label: '单品',
|
|
11898
|
+
value: '1'
|
|
11899
|
+
}, {
|
|
11900
|
+
label: '组合装',
|
|
11901
|
+
value: '2'
|
|
11902
|
+
}];
|
|
11903
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
11904
|
+
style: {
|
|
11905
|
+
width: 70
|
|
11906
|
+
},
|
|
11907
|
+
options: options,
|
|
11908
|
+
value: val,
|
|
11909
|
+
onChange: function onChange(value) {
|
|
11910
|
+
return updateHandle(value, index, 'productType');
|
|
11911
|
+
}
|
|
11912
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
11913
|
+
}
|
|
11914
|
+
}];
|
|
11915
|
+
}
|
|
11916
|
+
break;
|
|
11917
|
+
case 'WDT_EXCHANGE_GOODS':
|
|
11918
|
+
{
|
|
11919
|
+
columns = [{
|
|
11920
|
+
dataIndex: 'goodId',
|
|
11921
|
+
title: "SPUID",
|
|
11922
|
+
align: 'center',
|
|
11923
|
+
ellipsis: true,
|
|
11924
|
+
width: 70
|
|
11925
|
+
}, {
|
|
11926
|
+
dataIndex: 'goodNo',
|
|
11927
|
+
title: "\u5546\u54C1SPU\u7F16\u7801",
|
|
11928
|
+
align: 'center',
|
|
11929
|
+
ellipsis: true,
|
|
11930
|
+
width: 180
|
|
11931
|
+
}, {
|
|
11932
|
+
dataIndex: 'goodName',
|
|
11933
|
+
title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
|
|
11934
|
+
align: 'center',
|
|
11935
|
+
ellipsis: true,
|
|
11936
|
+
width: 250
|
|
11937
|
+
}, {
|
|
11938
|
+
dataIndex: 'specId',
|
|
11939
|
+
title: "".concat(text, "SKUID"),
|
|
11940
|
+
align: 'center',
|
|
11941
|
+
ellipsis: true,
|
|
11942
|
+
width: 100
|
|
11943
|
+
}, {
|
|
11944
|
+
dataIndex: 'specNo',
|
|
11945
|
+
title: "".concat(text, "\u5546\u54C1SKU\u7F16\u7801"),
|
|
11946
|
+
align: 'center',
|
|
11947
|
+
ellipsis: true,
|
|
11948
|
+
width: 180
|
|
11949
|
+
}, {
|
|
11950
|
+
dataIndex: 'specName',
|
|
11951
|
+
title: "".concat(text, "\u5546\u54C1SKU\u540D\u79F0"),
|
|
11952
|
+
align: 'center',
|
|
11953
|
+
ellipsis: true,
|
|
11954
|
+
width: 250
|
|
11955
|
+
}, {
|
|
11956
|
+
dataIndex: 'num',
|
|
11957
|
+
title: "".concat(text, "\u6362\u51FA\u6570\u91CF"),
|
|
11958
|
+
align: 'center',
|
|
11959
|
+
ellipsis: true,
|
|
11960
|
+
width: 100,
|
|
11961
|
+
render: function render(val, record, index) {
|
|
11962
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
11963
|
+
style: {
|
|
11964
|
+
width: 70
|
|
11965
|
+
},
|
|
11966
|
+
value: val,
|
|
11967
|
+
min: 0,
|
|
11968
|
+
precision: 0,
|
|
11969
|
+
onChange: function onChange(num) {
|
|
11970
|
+
return updateHandle(num, index, 'num');
|
|
11971
|
+
}
|
|
11972
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
11973
|
+
}
|
|
11974
|
+
}, {
|
|
11975
|
+
dataIndex: 'price',
|
|
11976
|
+
title: "".concat(text, "\u5546\u54C1\u5355\u4EF7"),
|
|
11977
|
+
align: 'center',
|
|
11978
|
+
ellipsis: true,
|
|
11979
|
+
width: 100,
|
|
11980
|
+
render: function render(val, record, index) {
|
|
11981
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
11982
|
+
style: {
|
|
11983
|
+
width: 70
|
|
11984
|
+
},
|
|
11985
|
+
value: val,
|
|
11986
|
+
min: 0,
|
|
11987
|
+
onChange: function onChange(value) {
|
|
11988
|
+
return updateHandle(value, index, 'price');
|
|
11989
|
+
}
|
|
11990
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
11991
|
+
}
|
|
11992
|
+
}, {
|
|
11993
|
+
dataIndex: 'exchangePrice',
|
|
11994
|
+
title: "".concat(text, "\u6362\u51FA\u91D1\u989D"),
|
|
11995
|
+
align: 'center',
|
|
11996
|
+
ellipsis: true,
|
|
11997
|
+
width: 100
|
|
11998
|
+
}, {
|
|
11999
|
+
dataIndex: 'giftType',
|
|
12000
|
+
title: "\u8D60\u54C1\u65B9\u5F0F",
|
|
12001
|
+
align: 'center',
|
|
12002
|
+
ellipsis: true,
|
|
12003
|
+
width: 100,
|
|
12004
|
+
render: function render(val) {
|
|
12005
|
+
var giftTypeMap = {
|
|
12006
|
+
0: '非赠品',
|
|
12007
|
+
1: '自动赠送',
|
|
12008
|
+
2: '手工赠送',
|
|
12009
|
+
3: '回购自动送赠品',
|
|
12010
|
+
4: '前N有礼送赠品',
|
|
12011
|
+
6: '天猫优仓赠品',
|
|
12012
|
+
7: '淘宝CRM会员送赠'
|
|
12013
|
+
};
|
|
12014
|
+
return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
|
|
12015
|
+
}
|
|
12016
|
+
}, {
|
|
12017
|
+
dataIndex: 'productType',
|
|
12018
|
+
title: "".concat(text, "\u5546\u54C1\u7C7B\u578B"),
|
|
12019
|
+
align: 'center',
|
|
12020
|
+
ellipsis: true,
|
|
12021
|
+
width: 100,
|
|
12022
|
+
render: function render(val, record, index) {
|
|
12023
|
+
var options = [{
|
|
12024
|
+
label: '单品',
|
|
12025
|
+
value: '1'
|
|
12026
|
+
}, {
|
|
12027
|
+
label: '组合装',
|
|
12028
|
+
value: '2'
|
|
12029
|
+
}];
|
|
12030
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
12031
|
+
style: {
|
|
12032
|
+
width: 70
|
|
12033
|
+
},
|
|
12034
|
+
options: options,
|
|
12035
|
+
value: val,
|
|
12036
|
+
onChange: function onChange(value) {
|
|
12037
|
+
return updateHandle(value, index, 'productType');
|
|
12038
|
+
}
|
|
12039
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
12040
|
+
}
|
|
12041
|
+
}];
|
|
12042
|
+
}
|
|
12043
|
+
break;
|
|
11743
12044
|
default:
|
|
11744
12045
|
columns = [{
|
|
11745
12046
|
dataIndex: 'mark',
|
|
@@ -11881,7 +12182,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
11881
12182
|
}, [showHeader, value, disabled]);
|
|
11882
12183
|
var onSubmit = function onSubmit(list) {
|
|
11883
12184
|
var newList = [];
|
|
11884
|
-
if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
|
|
12185
|
+
if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
|
|
11885
12186
|
newList = list.map(function (item) {
|
|
11886
12187
|
item.uuid = kmkfUtils.uuid();
|
|
11887
12188
|
item.canDelete = true;
|
|
@@ -11889,6 +12190,10 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
11889
12190
|
item.orderPrice = 0;
|
|
11890
12191
|
item.sharePrice = 0;
|
|
11891
12192
|
item.canUpdateNumber = canUpdateNumber;
|
|
12193
|
+
if (type === 'WDT_EXCHANGE_GOODS') {
|
|
12194
|
+
item.price = item.retailPrice;
|
|
12195
|
+
item.productType = '1';
|
|
12196
|
+
}
|
|
11892
12197
|
return item;
|
|
11893
12198
|
});
|
|
11894
12199
|
} else {
|
|
@@ -11959,7 +12264,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
11959
12264
|
locale: {
|
|
11960
12265
|
emptyText: '暂无数据'
|
|
11961
12266
|
}
|
|
11962
|
-
})), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React__default['default'].createElement(WdtGoodsModal, {
|
|
12267
|
+
})), ['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type) ? /*#__PURE__*/React__default['default'].createElement(WdtGoodsModal, {
|
|
11963
12268
|
ref: refModal,
|
|
11964
12269
|
onSubmit: onSubmit,
|
|
11965
12270
|
width: width,
|
|
@@ -12363,20 +12668,6 @@ var typeMap = {
|
|
|
12363
12668
|
money: 'money',
|
|
12364
12669
|
share: 'share'
|
|
12365
12670
|
}
|
|
12366
|
-
},
|
|
12367
|
-
WDT_REISSUE_GOODS: {
|
|
12368
|
-
key: 'wdtReissueGoods',
|
|
12369
|
-
name: '旺店通',
|
|
12370
|
-
typeName: 'wdtReissueType',
|
|
12371
|
-
reissueSelectList: 'wdtReissueSelectList',
|
|
12372
|
-
reissueSelectListReturn: 'wdtReissueSelectListReturn',
|
|
12373
|
-
reissueDeleteGood: 'wdtReissueDeleteGood',
|
|
12374
|
-
changeShopCode: 'wdtChangeShopCode',
|
|
12375
|
-
reissueType: 'wdtReissueType',
|
|
12376
|
-
formatDefaultField: {
|
|
12377
|
-
money: 'orderPrice',
|
|
12378
|
-
share: 'sharePrice'
|
|
12379
|
-
}
|
|
12380
12671
|
}
|
|
12381
12672
|
};
|
|
12382
12673
|
var BsReissue = function BsReissue(props) {
|
|
@@ -12630,7 +12921,7 @@ var index$1 = (function (props) {
|
|
|
12630
12921
|
getWdtOrderList(value.orderNo);
|
|
12631
12922
|
}
|
|
12632
12923
|
}
|
|
12633
|
-
}, [value, type]);
|
|
12924
|
+
}, [value === null || value === void 0 ? void 0 : value.orderNo, type]);
|
|
12634
12925
|
var columns = React.useMemo(function () {
|
|
12635
12926
|
var _columnsNameMap$type, _columnsNameMap$type2;
|
|
12636
12927
|
return [{
|
|
@@ -12843,8 +13134,10 @@ var componentMap$1 = {
|
|
|
12843
13134
|
reissueType: 'wdtReissueType',
|
|
12844
13135
|
returnType: 'wdtReturnType',
|
|
12845
13136
|
returnSelectListReturn: 'wdtReturnSelectListReturn',
|
|
13137
|
+
returnSelectList: 'wdtReturnSelectList',
|
|
12846
13138
|
deleteGood: 'wdtDeleteGood',
|
|
12847
|
-
returnDeleteGood: 'wdtReturnDeleteGood'
|
|
13139
|
+
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
13140
|
+
exchangeDeleteGood: 'wdtExchangeDeleteGood'
|
|
12848
13141
|
}
|
|
12849
13142
|
}
|
|
12850
13143
|
};
|
|
@@ -12911,7 +13204,7 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
12911
13204
|
setTableSelect(['2', '4'].includes(data.val));
|
|
12912
13205
|
if (['1', '3'].includes(data.val)) {
|
|
12913
13206
|
var _valueRef$current5, _valueRef$current6;
|
|
12914
|
-
pubsub__default['default'].publish(componentMap$1[
|
|
13207
|
+
pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.returnSelectListReturn, {
|
|
12915
13208
|
list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5[componentMap$1[compType].key]) || []),
|
|
12916
13209
|
shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
|
|
12917
13210
|
goodValue: data === null || data === void 0 ? void 0 : data.goodValue
|
|
@@ -12929,15 +13222,15 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
12929
13222
|
};
|
|
12930
13223
|
}, [disabled]);
|
|
12931
13224
|
var _onSelect = function onSelect(list) {
|
|
12932
|
-
var _withInfo$current, _withInfo$current2, _valueRef$current7;
|
|
13225
|
+
var _typeMap, _withInfo$current, _withInfo$current2, _valueRef$current7;
|
|
12933
13226
|
if (disabled) return;
|
|
12934
13227
|
var newList = lodash.cloneDeep(list);
|
|
12935
|
-
var typeMap =
|
|
13228
|
+
var typeMap = (_typeMap = {
|
|
12936
13229
|
// type: componentMap[compType].eventNameMap.selectList,
|
|
12937
13230
|
// returnType: componentMap[compType].eventNameMap.returnSelectList,
|
|
12938
13231
|
// reissueType: componentMap[compType].eventNameMap.reissueSelectList,
|
|
12939
13232
|
type: componentMap$1[compType].eventNameMap.selectList
|
|
12940
|
-
}, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
|
|
13233
|
+
}, _defineProperty(_typeMap, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList), _defineProperty(_typeMap, "".concat(componentMap$1[compType].type, "ReturnType"), componentMap$1[compType].eventNameMap.returnSelectList), _typeMap);
|
|
12941
13234
|
var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
|
|
12942
13235
|
// console.log('onSelect', type, withInfo.current, newList);
|
|
12943
13236
|
pubsub__default['default'].publish(type, {
|
|
@@ -12955,6 +13248,7 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
12955
13248
|
pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
|
|
12956
13249
|
pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
|
|
12957
13250
|
pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
|
|
13251
|
+
pubsub__default['default'].publish(componentMap$1[compType].eventNameMap.exchangeDeleteGood, deleteId);
|
|
12958
13252
|
};
|
|
12959
13253
|
var changeHandle = function changeHandle(list) {
|
|
12960
13254
|
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
|
|
@@ -12979,12 +13273,502 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
12979
13273
|
}));
|
|
12980
13274
|
};
|
|
12981
13275
|
|
|
12982
|
-
var
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
13276
|
+
var componentMap$2 = {
|
|
13277
|
+
'WDT_RETURN_GOODS': {
|
|
13278
|
+
type: 'wdt',
|
|
13279
|
+
valueKey: 'wdtReturnGoods',
|
|
13280
|
+
returnTypeKey: 'wdtReturnType',
|
|
13281
|
+
name: '旺店通',
|
|
13282
|
+
eventNameMap: {
|
|
13283
|
+
changeShopCode: 'wdtChangeShopCode',
|
|
13284
|
+
returnType: 'wdtReturnType',
|
|
13285
|
+
returnSelectListReturn: 'wdtReturnSelectListReturn',
|
|
13286
|
+
returnDeleteGood: 'wdtReturnDeleteGood',
|
|
13287
|
+
returnSelectList: 'wdtReturnSelectList',
|
|
13288
|
+
exchangeCopyGood: 'wdtExchangeCopyGood',
|
|
13289
|
+
exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
|
|
13290
|
+
}
|
|
13291
|
+
}
|
|
13292
|
+
};
|
|
13293
|
+
var CommonReturnGoods = function CommonReturnGoods(props) {
|
|
13294
|
+
var value = props.value,
|
|
13295
|
+
onChange = props.onChange,
|
|
13296
|
+
_props$reasonList = props.reasonList,
|
|
13297
|
+
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
13298
|
+
disabled = props.disabled,
|
|
13299
|
+
compType = props.type;
|
|
13300
|
+
var valueRef = React.useRef({});
|
|
13301
|
+
React.useEffect(function () {
|
|
13302
|
+
var subscription = pubsub__default['default'].subscribe(componentMap$2[compType].eventNameMap.exchangeCopyGood, function () {
|
|
13303
|
+
var _valueRef$current, _valueRef$current2;
|
|
13304
|
+
pubsub__default['default'].publish(componentMap$2[compType].eventNameMap.exchangeBackCopyGood, {
|
|
13305
|
+
list: lodash.cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current[componentMap$2[compType].valueKey]) || []),
|
|
13306
|
+
shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode
|
|
13307
|
+
});
|
|
13308
|
+
});
|
|
13309
|
+
return function () {
|
|
13310
|
+
pubsub__default['default'].unsubscribe(subscription);
|
|
13311
|
+
};
|
|
13312
|
+
}, []);
|
|
13313
|
+
React.useEffect(function () {
|
|
13314
|
+
var subscription = pubsub__default['default'].subscribe(componentMap$2[compType].eventNameMap.returnSelectList, function (_, data) {
|
|
13315
|
+
if (disabled) return;
|
|
13316
|
+
var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
|
|
13317
|
+
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
13318
|
+
});
|
|
13319
|
+
if (compType === 'WDT_RETURN_GOODS') {
|
|
13320
|
+
newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
|
|
13321
|
+
if (typeof item.productType === 'undefined') {
|
|
13322
|
+
item.productType = '1';
|
|
13323
|
+
}
|
|
13324
|
+
if (typeof item.returnPrice === 'undefined') {
|
|
13325
|
+
item.returnPrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.sharePrice)).toString();
|
|
13326
|
+
}
|
|
13327
|
+
return item;
|
|
13328
|
+
});
|
|
13329
|
+
} else {
|
|
13330
|
+
newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
13331
|
+
}
|
|
13332
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13333
|
+
});
|
|
13334
|
+
return function () {
|
|
13335
|
+
pubsub__default['default'].unsubscribe(subscription);
|
|
13336
|
+
};
|
|
13337
|
+
}, []);
|
|
13338
|
+
React.useEffect(function () {
|
|
13339
|
+
var subscription = pubsub__default['default'].subscribe(componentMap$2[compType].eventNameMap.returnSelectListReturn, function (_, data) {
|
|
13340
|
+
if (disabled) return;
|
|
13341
|
+
var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
|
|
13342
|
+
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
13343
|
+
});
|
|
13344
|
+
if (compType === 'WDT_RETURN_GOODS') {
|
|
13345
|
+
newValue[componentMap$2[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
|
|
13346
|
+
if (typeof item.productType === 'undefined') {
|
|
13347
|
+
item.productType = '1';
|
|
13348
|
+
}
|
|
13349
|
+
if (typeof item.returnPrice === 'undefined') {
|
|
13350
|
+
item.returnPrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.sharePrice)).toString();
|
|
13351
|
+
}
|
|
13352
|
+
return item;
|
|
13353
|
+
});
|
|
13354
|
+
} else {
|
|
13355
|
+
newValue[componentMap$2[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
13356
|
+
}
|
|
13357
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13358
|
+
});
|
|
13359
|
+
return function () {
|
|
13360
|
+
pubsub__default['default'].unsubscribe(subscription);
|
|
13361
|
+
};
|
|
13362
|
+
}, []);
|
|
13363
|
+
React.useEffect(function () {
|
|
13364
|
+
valueRef.current = value;
|
|
13365
|
+
pubsub__default['default'].subscribeOnce(componentMap$2[compType].eventNameMap.returnDeleteGood, function (_, data) {
|
|
13366
|
+
if (disabled) return;
|
|
13367
|
+
if (value) {
|
|
13368
|
+
var newValue = _objectSpread2({}, value);
|
|
13369
|
+
newValue[componentMap$2[compType].valueKey] = newValue[componentMap$2[compType].valueKey].filter(function (item) {
|
|
13370
|
+
return item.sku !== data;
|
|
13371
|
+
});
|
|
13372
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13373
|
+
}
|
|
13374
|
+
});
|
|
13375
|
+
pubsub__default['default'].subscribeOnce(componentMap$2[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
13376
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
13377
|
+
shopCode: data.shopCode
|
|
13378
|
+
}));
|
|
13379
|
+
});
|
|
13380
|
+
}, [value, disabled]);
|
|
13381
|
+
var changeTypeHandle = function changeTypeHandle(val) {
|
|
13382
|
+
var newValue = _objectSpread2({}, value);
|
|
13383
|
+
newValue[componentMap$2[compType].returnTypeKey] = val;
|
|
13384
|
+
newValue[componentMap$2[compType].valueKey] = [];
|
|
13385
|
+
if (['2'].includes(val[0])) {
|
|
13386
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13387
|
+
valueRef.current = newValue;
|
|
13388
|
+
}
|
|
13389
|
+
pubsub__default['default'].publish(componentMap$2[compType].eventNameMap.returnType, {
|
|
13390
|
+
val: val[0],
|
|
13391
|
+
goodValue: newValue
|
|
13392
|
+
});
|
|
13393
|
+
};
|
|
13394
|
+
var changeGoodHandle = function changeGoodHandle(val) {
|
|
13395
|
+
var newValue = _objectSpread2({}, value);
|
|
13396
|
+
newValue[componentMap$2[compType].valueKey] = val;
|
|
13397
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13398
|
+
};
|
|
13399
|
+
//显示选择商品按钮 原单换不显示选择商品
|
|
13400
|
+
// const showChangeBtn = useMemo(() => {
|
|
13401
|
+
// return ['2'].includes(value?.[componentMap[compType].returnTypeKey]?.[0]);
|
|
13402
|
+
// }, [value?.[componentMap[compType].returnTypeKey]]);
|
|
13403
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
13404
|
+
style: {
|
|
13405
|
+
marginBottom: '8px'
|
|
13406
|
+
},
|
|
13407
|
+
disabled: disabled,
|
|
13408
|
+
allowClear: false,
|
|
13409
|
+
options: reasonList,
|
|
13410
|
+
value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].returnTypeKey],
|
|
13411
|
+
onChange: function onChange(val) {
|
|
13412
|
+
return changeTypeHandle(val);
|
|
13413
|
+
}
|
|
13414
|
+
}), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
13415
|
+
key: componentMap$2[compType].type
|
|
13416
|
+
}, props), {}, {
|
|
13417
|
+
disabled: disabled,
|
|
13418
|
+
canUpdateNumber: true,
|
|
13419
|
+
showChangeBtn: false,
|
|
13420
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
13421
|
+
value: value === null || value === void 0 ? void 0 : value[componentMap$2[compType].valueKey],
|
|
13422
|
+
onChange: function onChange(val) {
|
|
13423
|
+
return changeGoodHandle(val);
|
|
13424
|
+
}
|
|
13425
|
+
})));
|
|
13426
|
+
};
|
|
13427
|
+
|
|
13428
|
+
var componentMap$3 = {
|
|
13429
|
+
'WDT_EXCHANGE_GOODS': {
|
|
13430
|
+
type: 'wdt',
|
|
13431
|
+
valueKey: 'wdtExchangeGoods',
|
|
13432
|
+
returnTypeKey: 'wdtExchangeType',
|
|
13433
|
+
name: '旺店通',
|
|
13434
|
+
eventNameMap: {
|
|
13435
|
+
changeShopCode: 'wdtChangeShopCode',
|
|
13436
|
+
exchangeDeleteGood: 'wdtExchangeDeleteGood',
|
|
13437
|
+
exchangeCopyGood: 'wdtExchangeCopyGood',
|
|
13438
|
+
exchangeBackCopyGood: 'wdtExchangeBackCopyGood'
|
|
13439
|
+
}
|
|
13440
|
+
}
|
|
13441
|
+
};
|
|
13442
|
+
var CommonExchangeGoods = function CommonExchangeGoods(props) {
|
|
13443
|
+
var value = props.value,
|
|
13444
|
+
onChange = props.onChange,
|
|
13445
|
+
disabled = props.disabled,
|
|
13446
|
+
compType = props.type;
|
|
13447
|
+
var valueRef = React.useRef({});
|
|
13448
|
+
React.useEffect(function () {
|
|
13449
|
+
var subscription = pubsub__default['default'].subscribe(componentMap$3[compType].eventNameMap.exchangeBackCopyGood, function (_, data) {
|
|
13450
|
+
if (disabled) return;
|
|
13451
|
+
var newValue = {
|
|
13452
|
+
shopCode: data === null || data === void 0 ? void 0 : data.shopCode
|
|
13453
|
+
};
|
|
13454
|
+
if (compType === 'WDT_EXCHANGE_GOODS') {
|
|
13455
|
+
newValue[componentMap$3[compType].valueKey] = ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
|
|
13456
|
+
if (typeof item.productType === 'undefined') {
|
|
13457
|
+
item.productType = '1';
|
|
13458
|
+
}
|
|
13459
|
+
item.price = item.sharePrice;
|
|
13460
|
+
if (typeof item.exchangePrice === 'undefined') {
|
|
13461
|
+
item.exchangePrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.price)).toString();
|
|
13462
|
+
}
|
|
13463
|
+
return item;
|
|
13464
|
+
});
|
|
13465
|
+
} else {
|
|
13466
|
+
newValue[componentMap$3[compType].valueKey] = (data === null || data === void 0 ? void 0 : data.list) || [];
|
|
13467
|
+
}
|
|
13468
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13469
|
+
});
|
|
13470
|
+
return function () {
|
|
13471
|
+
pubsub__default['default'].unsubscribe(subscription);
|
|
13472
|
+
};
|
|
13473
|
+
});
|
|
13474
|
+
React.useEffect(function () {
|
|
13475
|
+
valueRef.current = value;
|
|
13476
|
+
pubsub__default['default'].subscribeOnce(componentMap$3[compType].eventNameMap.exchangeDeleteGood, function (_, data) {
|
|
13477
|
+
if (disabled) return;
|
|
13478
|
+
if (value) {
|
|
13479
|
+
var newValue = _objectSpread2({}, value);
|
|
13480
|
+
newValue[componentMap$3[compType].valueKey] = newValue[componentMap$3[compType].valueKey].filter(function (item) {
|
|
13481
|
+
return item.sku !== data;
|
|
13482
|
+
});
|
|
13483
|
+
onChange(newValue);
|
|
13484
|
+
}
|
|
13485
|
+
});
|
|
13486
|
+
pubsub__default['default'].subscribeOnce(componentMap$3[compType].eventNameMap.changeShopCode, function (type, data) {
|
|
13487
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
13488
|
+
shopCode: data.shopCode
|
|
13489
|
+
}));
|
|
13490
|
+
});
|
|
13491
|
+
}, [value]);
|
|
13492
|
+
var changeGoodHandle = function changeGoodHandle(val) {
|
|
13493
|
+
var newValue = _objectSpread2({}, value);
|
|
13494
|
+
if (compType === 'WDT_EXCHANGE_GOODS') {
|
|
13495
|
+
val = val.map(function (item) {
|
|
13496
|
+
item.exchangePrice = new BigNumber__default['default'](item.num).multipliedBy(new BigNumber__default['default'](item.price)).toString();
|
|
13497
|
+
return item;
|
|
13498
|
+
});
|
|
13499
|
+
}
|
|
13500
|
+
newValue[componentMap$3[compType].valueKey] = val;
|
|
13501
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13502
|
+
};
|
|
13503
|
+
var copyGoods = function copyGoods() {
|
|
13504
|
+
var copyHandle = function copyHandle() {
|
|
13505
|
+
pubsub__default['default'].publish(componentMap$3[compType].eventNameMap.exchangeCopyGood, 'WDT_EXCHANGE_GOODS');
|
|
13506
|
+
};
|
|
13507
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
13508
|
+
type: "link",
|
|
13509
|
+
onClick: copyHandle
|
|
13510
|
+
}, "\u590D\u5236\u9000\u56DE\u5546\u54C1");
|
|
13511
|
+
};
|
|
13512
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
13513
|
+
key: componentMap$3[compType].type
|
|
13514
|
+
}, props), {}, {
|
|
13515
|
+
disabled: disabled,
|
|
13516
|
+
canUpdateNumber: true,
|
|
13517
|
+
showChangeBtn: true,
|
|
13518
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
13519
|
+
value: value === null || value === void 0 ? void 0 : value[componentMap$3[compType].valueKey],
|
|
13520
|
+
otherOperations: copyGoods(),
|
|
13521
|
+
onChange: function onChange(val) {
|
|
13522
|
+
return changeGoodHandle(val);
|
|
13523
|
+
}
|
|
13524
|
+
})));
|
|
13525
|
+
};
|
|
13526
|
+
|
|
13527
|
+
var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
|
|
13528
|
+
var typeMap$1 = {
|
|
13529
|
+
WDT_REISSUE_GOODS: {
|
|
13530
|
+
key: 'wdtReissueGoods',
|
|
13531
|
+
name: '旺店通',
|
|
13532
|
+
typeName: 'wdtReissueType',
|
|
13533
|
+
wdtSystemOrder: 'wdtSystemOrder',
|
|
13534
|
+
wdtSystemOrderNo: 'wdtSystemOrderNo',
|
|
13535
|
+
reissueSelectList: 'wdtReissueSelectList',
|
|
13536
|
+
reissueSelectListReturn: 'wdtReissueSelectListReturn',
|
|
13537
|
+
reissueDeleteGood: 'wdtReissueDeleteGood',
|
|
13538
|
+
changeShopCode: 'wdtChangeShopCode',
|
|
13539
|
+
reissueType: 'wdtReissueType',
|
|
13540
|
+
formatDefaultField: {
|
|
13541
|
+
money: 'orderPrice',
|
|
13542
|
+
share: 'sharePrice'
|
|
13543
|
+
}
|
|
13544
|
+
}
|
|
13545
|
+
};
|
|
13546
|
+
var wdtReissue = function wdtReissue(props) {
|
|
13547
|
+
var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type11, _typeMap$type25, _typeMap$type26, _value$typeMap$type$w2, _typeMap$type27, _typeMap$type28, _typeMap$type29;
|
|
13548
|
+
var value = props.value,
|
|
13549
|
+
onChange = props.onChange,
|
|
13550
|
+
_props$reasonList = props.reasonList,
|
|
13551
|
+
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
13552
|
+
disabled = props.disabled,
|
|
13553
|
+
type = props.type,
|
|
13554
|
+
other = _objectWithoutProperties(props, _excluded$g);
|
|
13555
|
+
var valueRef = React.useRef({});
|
|
13556
|
+
React.useEffect(function () {
|
|
13557
|
+
var _typeMap$type, _typeMap$type4;
|
|
13558
|
+
valueRef.current = value;
|
|
13559
|
+
pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type = typeMap$1[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueDeleteGood), function (_, data) {
|
|
13560
|
+
if (disabled) return;
|
|
13561
|
+
if (value) {
|
|
13562
|
+
var _typeMap$type2, _typeMap$type3;
|
|
13563
|
+
var newValue = _objectSpread2({}, value);
|
|
13564
|
+
newValue["".concat((_typeMap$type2 = typeMap$1[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type3 = typeMap$1[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.key)].filter(function (item) {
|
|
13565
|
+
return item.sku !== data;
|
|
13566
|
+
});
|
|
13567
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13568
|
+
}
|
|
13569
|
+
});
|
|
13570
|
+
pubsub__default['default'].subscribeOnce("".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type4 = typeMap$1[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.changeShopCode), function (type, data) {
|
|
13571
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
13572
|
+
shopCode: data.shopCode
|
|
13573
|
+
}));
|
|
13574
|
+
});
|
|
13575
|
+
}, [value, disabled]);
|
|
13576
|
+
React.useEffect(function () {
|
|
13577
|
+
var _value$orders, _value$showOrderInfo;
|
|
13578
|
+
if (!(value === null || value === void 0 ? void 0 : (_value$orders = value.orders) === null || _value$orders === void 0 ? void 0 : _value$orders.length) && (value === null || value === void 0 ? void 0 : value.orderNo) && (value === null || value === void 0 ? void 0 : (_value$showOrderInfo = value.showOrderInfo) === null || _value$showOrderInfo === void 0 ? void 0 : _value$showOrderInfo.length)) {
|
|
13579
|
+
if (type === 'WDT_SYSTEM_ORDER') {
|
|
13580
|
+
getWdtOrderList(value.orderNo);
|
|
13581
|
+
}
|
|
13582
|
+
}
|
|
13583
|
+
return;
|
|
13584
|
+
}, [value]);
|
|
13585
|
+
React.useEffect(function () {
|
|
13586
|
+
var _typeMap$type5;
|
|
13587
|
+
var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type5 = typeMap$1[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.wdtSystemOrderNo];
|
|
13588
|
+
if (wdtSystemOrderNo) {
|
|
13589
|
+
var _value$typeMap$type$t, _typeMap$type6;
|
|
13590
|
+
if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type6 = typeMap$1[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) {
|
|
13591
|
+
getGoodItems(wdtSystemOrderNo);
|
|
13592
|
+
}
|
|
13593
|
+
}
|
|
13594
|
+
return;
|
|
13595
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
|
|
13596
|
+
React.useEffect(function () {
|
|
13597
|
+
var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
|
|
13598
|
+
var typeName = value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type8 = typeMap$1[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0];
|
|
13599
|
+
var wdtSystemOrderNo = value === null || value === void 0 ? void 0 : value[(_typeMap$type9 = typeMap$1[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.wdtSystemOrderNo];
|
|
13600
|
+
if (['1'].includes(typeName)) {
|
|
13601
|
+
wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
|
|
13602
|
+
} else if (['2'].includes(typeName)) {
|
|
13603
|
+
var _typeMap$type10;
|
|
13604
|
+
var newValue = _objectSpread2({}, value);
|
|
13605
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type10 = typeMap$1[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = [];
|
|
13606
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13607
|
+
}
|
|
13608
|
+
return;
|
|
13609
|
+
}, [value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type11 = typeMap$1[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0]]);
|
|
13610
|
+
var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
|
|
13611
|
+
var _value$typeMap$type$w, _typeMap$type12, _ref;
|
|
13612
|
+
var orders = value === null || value === void 0 ? void 0 : (_value$typeMap$type$w = value[(_typeMap$type12 = typeMap$1[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.wdtSystemOrder]) === null || _value$typeMap$type$w === void 0 ? void 0 : _value$typeMap$type$w.orders;
|
|
13613
|
+
var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
|
|
13614
|
+
return orderItem.billNo === wdtSystemOrderNo;
|
|
13615
|
+
});
|
|
13616
|
+
if (order) {
|
|
13617
|
+
var _typeMap$type13, _order$goodDetails;
|
|
13618
|
+
var newValue = _objectSpread2({}, value);
|
|
13619
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type13 = typeMap$1[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key)] = order === null || order === void 0 ? void 0 : (_order$goodDetails = order.goodDetails) === null || _order$goodDetails === void 0 ? void 0 : _order$goodDetails.map(function (item) {
|
|
13620
|
+
var _typeMap$type14, _typeMap$type15;
|
|
13621
|
+
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type14 = typeMap$1[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.formatDefaultField.money)] = 0;
|
|
13622
|
+
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type15 = typeMap$1[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.formatDefaultField.share)] = 0;
|
|
13623
|
+
item.canUpdateNumber = true;
|
|
13624
|
+
return item;
|
|
13625
|
+
});
|
|
13626
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13627
|
+
}
|
|
13628
|
+
};
|
|
13629
|
+
var getWdtOrderList = /*#__PURE__*/function () {
|
|
13630
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
13631
|
+
var _yield$request, success, data, _typeMap$type16, _typeMap$type17, orders, showOrderInfo;
|
|
13632
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13633
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13634
|
+
case 0:
|
|
13635
|
+
_context.next = 2;
|
|
13636
|
+
return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
|
|
13637
|
+
method: 'post',
|
|
13638
|
+
data: {
|
|
13639
|
+
billNo: orderNo
|
|
13640
|
+
}
|
|
13641
|
+
});
|
|
13642
|
+
case 2:
|
|
13643
|
+
_yield$request = _context.sent;
|
|
13644
|
+
success = _yield$request.success;
|
|
13645
|
+
data = _yield$request.data;
|
|
13646
|
+
if (success) {
|
|
13647
|
+
orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
|
|
13648
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13649
|
+
billNo: item.tradeNo,
|
|
13650
|
+
billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
|
|
13651
|
+
billTag: item.tagName
|
|
13652
|
+
});
|
|
13653
|
+
});
|
|
13654
|
+
showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
|
|
13655
|
+
return {
|
|
13656
|
+
billNo: item.tradeNo,
|
|
13657
|
+
billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
|
|
13658
|
+
billTag: item.tagName
|
|
13659
|
+
};
|
|
13660
|
+
});
|
|
13661
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type16 = typeMap$1[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.wdtSystemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type17 = typeMap$1[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.wdtSystemOrder]), {}, {
|
|
13662
|
+
showOrderInfo: showOrderInfo,
|
|
13663
|
+
orders: orders
|
|
13664
|
+
}))));
|
|
13665
|
+
}
|
|
13666
|
+
case 6:
|
|
13667
|
+
case "end":
|
|
13668
|
+
return _context.stop();
|
|
13669
|
+
}
|
|
13670
|
+
}, _callee);
|
|
13671
|
+
}));
|
|
13672
|
+
return function getWdtOrderList(_x) {
|
|
13673
|
+
return _ref2.apply(this, arguments);
|
|
13674
|
+
};
|
|
13675
|
+
}();
|
|
13676
|
+
var changeTypeHandle = function changeTypeHandle(val) {
|
|
13677
|
+
var _typeMap$type18, _typeMap$type19;
|
|
13678
|
+
var newValue = _objectSpread2({}, value);
|
|
13679
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type18 = typeMap$1[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.typeName)] = val;
|
|
13680
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type19 = typeMap$1[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.key)] = [];
|
|
13681
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13682
|
+
valueRef.current = newValue;
|
|
13683
|
+
// if (['2'].includes(val[0])) {
|
|
13684
|
+
// onChange?.(newValue);
|
|
13685
|
+
// valueRef.current = newValue;
|
|
13686
|
+
// }
|
|
13687
|
+
// pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
|
|
13688
|
+
// val: val[0],
|
|
13689
|
+
// goodValue: newValue,
|
|
13690
|
+
// });
|
|
13691
|
+
};
|
|
13692
|
+
|
|
13693
|
+
var changeGoodHandle = function changeGoodHandle(val) {
|
|
13694
|
+
var _typeMap$type20;
|
|
13695
|
+
var newValue = _objectSpread2({}, value);
|
|
13696
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type20 = typeMap$1[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = (val || []).map(function (item) {
|
|
13697
|
+
var _typeMap$type21, _typeMap$type22;
|
|
13698
|
+
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type21 = typeMap$1[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.formatDefaultField.money)] = 0;
|
|
13699
|
+
item["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type22 = typeMap$1[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.formatDefaultField.share)] = 0;
|
|
13700
|
+
return item;
|
|
13701
|
+
});
|
|
13702
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13703
|
+
};
|
|
13704
|
+
var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
|
|
13705
|
+
var _typeMap$type23;
|
|
13706
|
+
var newValue = _objectSpread2({}, value);
|
|
13707
|
+
newValue["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type23 = typeMap$1[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.wdtSystemOrderNo)] = val;
|
|
13708
|
+
console.log('changeSystemOrderHandle', val, newValue);
|
|
13709
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13710
|
+
};
|
|
13711
|
+
//显示选择商品按钮 原单换不显示选择商品
|
|
13712
|
+
var showChangeBtn = React.useMemo(function () {
|
|
13713
|
+
var _typeMap$type24;
|
|
13714
|
+
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.wdtSystemOrderNo]);
|
|
13715
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]]);
|
|
13716
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
|
|
13717
|
+
gutter: 8
|
|
13718
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
|
|
13719
|
+
className: "gutter-row",
|
|
13720
|
+
span: 6
|
|
13721
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
13722
|
+
style: {
|
|
13723
|
+
marginBottom: '8px'
|
|
13724
|
+
},
|
|
13725
|
+
disabled: disabled,
|
|
13726
|
+
allowClear: false,
|
|
13727
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.wdtSystemOrderNo)],
|
|
13728
|
+
onChange: function onChange(val) {
|
|
13729
|
+
return changeSystemOrderHandle(val);
|
|
13730
|
+
}
|
|
13731
|
+
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$w2 = value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.wdtSystemOrder]) === null || _value$typeMap$type$w2 === void 0 ? void 0 : _value$typeMap$type$w2.showOrderInfo) || []).map(function (item) {
|
|
13732
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
|
|
13733
|
+
key: item.billNo,
|
|
13734
|
+
value: item.billNo,
|
|
13735
|
+
label: item.billNo
|
|
13736
|
+
}, item.billNo);
|
|
13737
|
+
}))), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
|
|
13738
|
+
className: "gutter-row",
|
|
13739
|
+
span: 6
|
|
13740
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
13741
|
+
style: {
|
|
13742
|
+
marginBottom: '8px'
|
|
13743
|
+
},
|
|
13744
|
+
disabled: disabled,
|
|
13745
|
+
allowClear: false,
|
|
13746
|
+
options: reasonList,
|
|
13747
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type28 = typeMap$1[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.typeName)],
|
|
13748
|
+
onChange: function onChange(val) {
|
|
13749
|
+
return changeTypeHandle(val);
|
|
13750
|
+
}
|
|
13751
|
+
}))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
13752
|
+
key: 'reissueGoods'
|
|
13753
|
+
}, other), {}, {
|
|
13754
|
+
type: type,
|
|
13755
|
+
disabled: disabled,
|
|
13756
|
+
canUpdateNumber: showChangeBtn,
|
|
13757
|
+
showChangeBtn: showChangeBtn,
|
|
13758
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
13759
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.key)],
|
|
13760
|
+
onChange: function onChange(val) {
|
|
13761
|
+
return changeGoodHandle(val);
|
|
13762
|
+
}
|
|
13763
|
+
})));
|
|
13764
|
+
};
|
|
13765
|
+
|
|
13766
|
+
var css_248z$a = ".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";
|
|
13767
|
+
styleInject(css_248z$a);
|
|
13768
|
+
|
|
13769
|
+
var TabPane$1 = antd.Tabs.TabPane;
|
|
13770
|
+
var Option$2 = antd.Select.Option;
|
|
13771
|
+
var Search$1 = antd.Input.Search;
|
|
12988
13772
|
var GoodsModal$4 = function GoodsModal(props) {
|
|
12989
13773
|
var onSubmit = props.onSubmit,
|
|
12990
13774
|
_onCancel = props.onCancel,
|
|
@@ -13455,12 +14239,12 @@ var Goods$1 = function Goods(props, ref) {
|
|
|
13455
14239
|
};
|
|
13456
14240
|
var index$2 = /*#__PURE__*/React.forwardRef(Goods$1);
|
|
13457
14241
|
|
|
13458
|
-
var _excluded$
|
|
14242
|
+
var _excluded$h = ["onChange", "value", "failValue"];
|
|
13459
14243
|
function CommonStatus(props) {
|
|
13460
14244
|
var onChange = props.onChange,
|
|
13461
14245
|
value = props.value,
|
|
13462
14246
|
failValue = props.failValue,
|
|
13463
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
14247
|
+
other = _objectWithoutProperties(props, _excluded$h);
|
|
13464
14248
|
var changeHandle = function changeHandle(val) {
|
|
13465
14249
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
13466
14250
|
status: val,
|
|
@@ -13569,17 +14353,17 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
|
|
|
13569
14353
|
},
|
|
13570
14354
|
value: (_value$changeIndex2 = value[changeIndex]) === null || _value$changeIndex2 === void 0 ? void 0 : _value$changeIndex2.returnGoodsTradeId
|
|
13571
14355
|
})) : null, type === 3 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
13572
|
-
disabled:
|
|
14356
|
+
disabled: disabled,
|
|
13573
14357
|
placeholder: "\u8BF7\u8F93\u5165\u8865\u53D1\u5355id",
|
|
13574
14358
|
value: (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.billNo
|
|
13575
14359
|
})) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
13576
|
-
disabled:
|
|
14360
|
+
disabled: disabled,
|
|
13577
14361
|
placeholder: "\u8BF7\u8F93\u5165\u6362\u8D27\u5355id",
|
|
13578
14362
|
value: (_value$changeIndex4 = value[changeIndex]) === null || _value$changeIndex4 === void 0 ? void 0 : _value$changeIndex4.billNo
|
|
13579
14363
|
})) : null) : null);
|
|
13580
14364
|
};
|
|
13581
14365
|
|
|
13582
|
-
var _excluded$
|
|
14366
|
+
var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
|
|
13583
14367
|
var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
13584
14368
|
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
|
|
13585
14369
|
var _props$value = props.value,
|
|
@@ -13589,7 +14373,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
|
13589
14373
|
failValue = props.failValue,
|
|
13590
14374
|
_props$type = props.type,
|
|
13591
14375
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
13592
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
14376
|
+
other = _objectWithoutProperties(props, _excluded$i);
|
|
13593
14377
|
var _useState = React.useState(0),
|
|
13594
14378
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13595
14379
|
changeIndex = _useState2[0],
|
|
@@ -13655,7 +14439,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
|
13655
14439
|
}, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
|
|
13656
14440
|
};
|
|
13657
14441
|
|
|
13658
|
-
var _excluded$
|
|
14442
|
+
var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
|
|
13659
14443
|
var msgTypeCh = {
|
|
13660
14444
|
ding: '钉钉',
|
|
13661
14445
|
wechat: '微信',
|
|
@@ -13671,7 +14455,7 @@ var MsgStatus = function MsgStatus(props) {
|
|
|
13671
14455
|
failValue = props.failValue,
|
|
13672
14456
|
_props$type = props.type,
|
|
13673
14457
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
13674
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
14458
|
+
other = _objectWithoutProperties(props, _excluded$j);
|
|
13675
14459
|
var _useState = React.useState(0),
|
|
13676
14460
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13677
14461
|
changeIndex = _useState2[0],
|
|
@@ -13768,8 +14552,10 @@ exports.BsSystemOrder = index$1;
|
|
|
13768
14552
|
exports.BuyerNick = BuyerNick;
|
|
13769
14553
|
exports.CalculationInput = CalculationInput;
|
|
13770
14554
|
exports.ChooseBaby = ChooseBaby;
|
|
14555
|
+
exports.CommonExchangeGoods = CommonExchangeGoods;
|
|
13771
14556
|
exports.CommonGoods = CommonGoods;
|
|
13772
14557
|
exports.CommonMultiStatus = CommonSystemOrder$1;
|
|
14558
|
+
exports.CommonReturnGoods = CommonReturnGoods;
|
|
13773
14559
|
exports.CommonStatus = CommonStatus;
|
|
13774
14560
|
exports.CommonSystemOrder = CommonSystemOrder;
|
|
13775
14561
|
exports.ExpressLogistics = ExpressLogistics;
|
|
@@ -13794,4 +14580,6 @@ exports.Supplier = Supplier;
|
|
|
13794
14580
|
exports.TBGoodId = TBGoodId;
|
|
13795
14581
|
exports.TBGoodSerial = TBGoodSerial;
|
|
13796
14582
|
exports.TradeId = TradeId;
|
|
14583
|
+
exports.WdtGoodList = WdtGoodList;
|
|
14584
|
+
exports.WdtReissue = wdtReissue;
|
|
13797
14585
|
exports.WlnGoods = WlnGoods;
|