@kmkf-fe-packages/basic-components 1.0.3 → 1.0.4-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +493 -227
- package/dist/index.js +493 -225
- package/dist/src/bs/component/model/WdtGoodList.d.ts +40 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/jst/Goods/index.d.ts +1 -0
- package/dist/src/wdt/Reissue/index.d.ts +3 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -7574,10 +7574,11 @@ function ApaasPosting(props) {
|
|
|
7574
7574
|
});
|
|
7575
7575
|
}
|
|
7576
7576
|
|
|
7577
|
-
var _excluded$a = ["value", "onChange"];
|
|
7577
|
+
var _excluded$a = ["value", "onChange", "platformType"];
|
|
7578
7578
|
function ApaasLogistics(props) {
|
|
7579
7579
|
var value = props.value,
|
|
7580
7580
|
onChange = props.onChange,
|
|
7581
|
+
platformType = props.platformType,
|
|
7581
7582
|
other = _objectWithoutProperties(props, _excluded$a);
|
|
7582
7583
|
var _useState = React.useState([]),
|
|
7583
7584
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -7590,7 +7591,7 @@ function ApaasLogistics(props) {
|
|
|
7590
7591
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7591
7592
|
while (1) switch (_context.prev = _context.next) {
|
|
7592
7593
|
case 0:
|
|
7593
|
-
express = kmkfUtils.ExpressData.getInstance();
|
|
7594
|
+
express = kmkfUtils.ExpressData.getInstance(platformType);
|
|
7594
7595
|
setOptions(express.expressData || []);
|
|
7595
7596
|
case 2:
|
|
7596
7597
|
case "end":
|
|
@@ -10434,7 +10435,7 @@ var typeInitValueMap = {
|
|
|
10434
10435
|
}]
|
|
10435
10436
|
};
|
|
10436
10437
|
var jstGoods = function jstGoods(props) {
|
|
10437
|
-
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7;
|
|
10438
|
+
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3, _value$changeIndex4, _value$changeIndex5, _value$changeIndex6, _value$changeIndex7, _value$changeIndex8;
|
|
10438
10439
|
var _props$value = props.value,
|
|
10439
10440
|
value = _props$value === void 0 ? [] : _props$value,
|
|
10440
10441
|
onChange = props.onChange,
|
|
@@ -10442,11 +10443,14 @@ var jstGoods = function jstGoods(props) {
|
|
|
10442
10443
|
_props$type = props.type,
|
|
10443
10444
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
10444
10445
|
_props$showField = props.showField,
|
|
10445
|
-
showField = _props$showField === void 0 ? '' : _props$showField
|
|
10446
|
+
showField = _props$showField === void 0 ? '' : _props$showField,
|
|
10447
|
+
_props$platformType = props.platformType,
|
|
10448
|
+
platformType = _props$platformType === void 0 ? 'default' : _props$platformType;
|
|
10446
10449
|
var _useState = React.useState(0),
|
|
10447
10450
|
_useState2 = _slicedToArray(_useState, 2),
|
|
10448
10451
|
changeIndex = _useState2[0],
|
|
10449
10452
|
setChangeIndex = _useState2[1]; //选中的包裹
|
|
10453
|
+
var wdtSendOptions = kmkfUtils.WdtSendData.getInstance().wdtSendData || [];
|
|
10450
10454
|
React.useEffect(function () {
|
|
10451
10455
|
//没有值塞个默认值
|
|
10452
10456
|
if (!(value === null || value === void 0 ? void 0 : value.length)) {
|
|
@@ -10473,6 +10477,18 @@ var jstGoods = function jstGoods(props) {
|
|
|
10473
10477
|
}), /*#__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
10478
|
}));
|
|
10475
10479
|
};
|
|
10480
|
+
var handleSelected = function handleSelected(val, type, option) {
|
|
10481
|
+
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
10482
|
+
changeOrderInfo[type] = val;
|
|
10483
|
+
changeOrderInfo['sendId'] = option.value;
|
|
10484
|
+
var newList = _toConsumableArray(value);
|
|
10485
|
+
newList[changeIndex] = changeOrderInfo;
|
|
10486
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newList);
|
|
10487
|
+
};
|
|
10488
|
+
var filterOption = function filterOption(input, option) {
|
|
10489
|
+
var _option$label;
|
|
10490
|
+
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').includes(input);
|
|
10491
|
+
};
|
|
10476
10492
|
var changeInputHandle = function changeInputHandle(val, type) {
|
|
10477
10493
|
var changeOrderInfo = _objectSpread2({}, value[changeIndex]);
|
|
10478
10494
|
changeOrderInfo[type] = val;
|
|
@@ -10511,10 +10527,12 @@ var jstGoods = function jstGoods(props) {
|
|
|
10511
10527
|
filterOption: function filterOption(input, option) {
|
|
10512
10528
|
return option.label.includes(input);
|
|
10513
10529
|
},
|
|
10530
|
+
dropdownMatchSelectWidth: false,
|
|
10514
10531
|
style: {
|
|
10515
10532
|
minWidth: '100px',
|
|
10516
10533
|
maxWidth: '180px'
|
|
10517
|
-
}
|
|
10534
|
+
},
|
|
10535
|
+
platformType: platformType
|
|
10518
10536
|
}) : null, !showField || showField === 'logisticsCode' ? /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10519
10537
|
disabled: disabled,
|
|
10520
10538
|
placeholder: "\u7269\u6D41\u5355\u53F7",
|
|
@@ -10543,20 +10561,34 @@ var jstGoods = function jstGoods(props) {
|
|
|
10543
10561
|
return changeInputHandle(e.target.value, 'sendId');
|
|
10544
10562
|
},
|
|
10545
10563
|
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.
|
|
10564
|
+
}), ['sendName', 'all'].includes(showField) && (platformType === 'wdt' ? /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
10565
|
+
style: {
|
|
10566
|
+
minWidth: '100px',
|
|
10567
|
+
maxWidth: '180px'
|
|
10568
|
+
},
|
|
10569
|
+
disabled: disabled,
|
|
10570
|
+
placeholder: "\u53D1\u8D27\u4ED3\u540D\u79F0",
|
|
10571
|
+
showSearch: true,
|
|
10572
|
+
options: wdtSendOptions,
|
|
10573
|
+
filterOption: filterOption,
|
|
10574
|
+
value: (_value$changeIndex6 = value[changeIndex]) === null || _value$changeIndex6 === void 0 ? void 0 : _value$changeIndex6.sendName,
|
|
10575
|
+
onChange: function onChange(value, option) {
|
|
10576
|
+
return handleSelected(value, 'sendName', option);
|
|
10577
|
+
}
|
|
10578
|
+
}) : /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10547
10579
|
disabled: disabled,
|
|
10548
10580
|
placeholder: "\u8BF7\u8F93\u5165\u53D1\u8D27\u4ED3\u540D\u79F0",
|
|
10549
10581
|
onChange: function onChange(e) {
|
|
10550
10582
|
return changeInputHandle(e.target.value, 'sendName');
|
|
10551
10583
|
},
|
|
10552
|
-
value: (_value$
|
|
10553
|
-
})) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10584
|
+
value: (_value$changeIndex7 = value[changeIndex]) === null || _value$changeIndex7 === void 0 ? void 0 : _value$changeIndex7.sendName
|
|
10585
|
+
}))) : null, type === 4 ? /*#__PURE__*/React__default['default'].createElement(antd.Space, null, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
10554
10586
|
disabled: disabled,
|
|
10555
10587
|
placeholder: "\u8BF7\u8F93\u5165\u51FA\u5E93\u5355\u7F16\u53F7",
|
|
10556
10588
|
onChange: function onChange(e) {
|
|
10557
10589
|
return changeInputHandle(e.target.value, 'deliveryNo');
|
|
10558
10590
|
},
|
|
10559
|
-
value: (_value$
|
|
10591
|
+
value: (_value$changeIndex8 = value[changeIndex]) === null || _value$changeIndex8 === void 0 ? void 0 : _value$changeIndex8.sendName
|
|
10560
10592
|
})) : null) : null);
|
|
10561
10593
|
};
|
|
10562
10594
|
|
|
@@ -11123,6 +11155,12 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
|
|
|
11123
11155
|
var GoodsModal$2 = /*#__PURE__*/React.forwardRef(GoodsModal$1);
|
|
11124
11156
|
|
|
11125
11157
|
var RangePicker = antd.DatePicker.RangePicker;
|
|
11158
|
+
var getWdtListProduct = function getWdtListProduct(data) {
|
|
11159
|
+
return extendRequest('/qy/gdfw/product/wdtListProduct', {
|
|
11160
|
+
method: 'post',
|
|
11161
|
+
data: data
|
|
11162
|
+
});
|
|
11163
|
+
};
|
|
11126
11164
|
var columns$1 = [{
|
|
11127
11165
|
dataIndex: 'index',
|
|
11128
11166
|
title: 'NO',
|
|
@@ -11197,226 +11235,174 @@ var expandedColumns = [{
|
|
|
11197
11235
|
title: '会员价',
|
|
11198
11236
|
width: 140
|
|
11199
11237
|
}];
|
|
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),
|
|
11238
|
+
var getInitTime = function getInitTime() {
|
|
11239
|
+
var initStartTime = hooks().subtract(30, 'd').hours(0).minutes(0).seconds(0);
|
|
11240
|
+
var initEndTime = hooks().hours(23).minutes(59).seconds(59);
|
|
11241
|
+
return [initStartTime, initEndTime];
|
|
11242
|
+
};
|
|
11243
|
+
var GoodList = function GoodList(props, ref) {
|
|
11244
|
+
var _useState = React.useState([]),
|
|
11226
11245
|
_useState2 = _slicedToArray(_useState, 2),
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
var _useState3 = React.useState(
|
|
11246
|
+
selectList = _useState2[0],
|
|
11247
|
+
setSelect = _useState2[1];
|
|
11248
|
+
var _useState3 = React.useState(1),
|
|
11230
11249
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
11231
|
-
|
|
11232
|
-
|
|
11233
|
-
var _useState5 = React.useState(
|
|
11234
|
-
_useState6 = _slicedToArray(_useState5,
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
var _useState7 = React.useState(1),
|
|
11250
|
+
pageNo = _useState4[0],
|
|
11251
|
+
setPageNo = _useState4[1];
|
|
11252
|
+
var _useState5 = React.useState(10),
|
|
11253
|
+
_useState6 = _slicedToArray(_useState5, 1),
|
|
11254
|
+
pageSize = _useState6[0];
|
|
11255
|
+
var _useState7 = React.useState([]),
|
|
11238
11256
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
var _useState9 = React.useState(
|
|
11242
|
-
_useState10 = _slicedToArray(_useState9,
|
|
11243
|
-
|
|
11244
|
-
|
|
11257
|
+
goodList = _useState8[0],
|
|
11258
|
+
setGoodList = _useState8[1];
|
|
11259
|
+
var _useState9 = React.useState(false),
|
|
11260
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
11261
|
+
loading = _useState10[0],
|
|
11262
|
+
setLoading = _useState10[1];
|
|
11263
|
+
var _useState11 = React.useState(0),
|
|
11245
11264
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
11246
|
-
|
|
11247
|
-
|
|
11248
|
-
var _useState13 = React.useState(
|
|
11265
|
+
total = _useState12[0],
|
|
11266
|
+
setTotal = _useState12[1];
|
|
11267
|
+
var _useState13 = React.useState(null),
|
|
11249
11268
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11253
|
-
|
|
11254
|
-
|
|
11255
|
-
|
|
11269
|
+
dates = _useState14[0],
|
|
11270
|
+
setDates = _useState14[1];
|
|
11271
|
+
React.useImperativeHandle(ref, function () {
|
|
11272
|
+
return {
|
|
11273
|
+
getSelectGoodList: function getSelectGoodList() {
|
|
11274
|
+
return selectList;
|
|
11275
|
+
}
|
|
11276
|
+
};
|
|
11277
|
+
});
|
|
11256
11278
|
var displaySelectList = React.useMemo(function () {
|
|
11257
11279
|
return selectList.map(function (item, i) {
|
|
11258
11280
|
item.index = i + 1;
|
|
11259
11281
|
return item;
|
|
11260
11282
|
});
|
|
11261
11283
|
}, [selectList]);
|
|
11262
|
-
React.useEffect(function () {
|
|
11263
|
-
if (visible) {
|
|
11264
|
-
queryItems();
|
|
11265
|
-
}
|
|
11266
|
-
}, [pageNo, visible]);
|
|
11267
11284
|
var _Form$useForm = antd.Form.useForm(),
|
|
11268
11285
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
11269
11286
|
form = _Form$useForm2[0];
|
|
11270
|
-
//选择页码
|
|
11271
|
-
var pageChange = function pageChange(page) {
|
|
11272
|
-
setPageNo(page);
|
|
11273
|
-
};
|
|
11274
11287
|
/**
|
|
11275
11288
|
* 查询商品
|
|
11276
11289
|
*/
|
|
11277
11290
|
var queryItems = /*#__PURE__*/function () {
|
|
11278
11291
|
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;
|
|
11292
|
+
var _formData$dateTimePic, _formData$dateTimePic2, _formData$dateTimePic3, _formData$dateTimePic4, _formData$dateTimePic5, _formData$dateTimePic6, formData, _getInitTime, _getInitTime2, start, end, startTime, endTime, newTime, earliest, params;
|
|
11299
11293
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11300
11294
|
while (1) switch (_context.prev = _context.next) {
|
|
11301
11295
|
case 0:
|
|
11302
|
-
|
|
11303
|
-
_context.prev = 1;
|
|
11296
|
+
_context.prev = 0;
|
|
11304
11297
|
setLoading(true);
|
|
11305
11298
|
formData = form.getFieldsValue();
|
|
11306
|
-
|
|
11307
|
-
|
|
11299
|
+
_getInitTime = getInitTime(), _getInitTime2 = _slicedToArray(_getInitTime, 2), start = _getInitTime2[0], end = _getInitTime2[1];
|
|
11300
|
+
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');
|
|
11301
|
+
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');
|
|
11302
|
+
endTime = hooks(endTime).hours(23).minutes(59).seconds(59).format('YYYY-MM-DD HH:mm:ss');
|
|
11303
|
+
// PS: 故意推前3分钟,不然极端情况下,接口会报错
|
|
11304
|
+
newTime = hooks().subtract(3, 'm'); // 只能选比现在早的时间
|
|
11305
|
+
if (hooks(endTime).diff(newTime, 'seconds') > 0) {
|
|
11306
|
+
endTime = newTime.format('YYYY-MM-DD HH:mm:ss');
|
|
11307
|
+
}
|
|
11308
|
+
// 30天内
|
|
11309
|
+
earliest = hooks(endTime).subtract(30, 'd');
|
|
11310
|
+
if (earliest.diff(hooks(startTime), 'seconds') > 0) {
|
|
11311
|
+
startTime = earliest.format('YYYY-MM-DD HH:mm:ss');
|
|
11312
|
+
}
|
|
11308
11313
|
params = {
|
|
11309
|
-
// shopCode: shopCode,
|
|
11310
11314
|
pageSize: pageSize,
|
|
11311
11315
|
pageNo: pageNo - 1,
|
|
11312
|
-
goodNo:
|
|
11316
|
+
goodNo: formData.goodNo || null,
|
|
11317
|
+
specNo: formData.specNo || null,
|
|
11313
11318
|
startTime: startTime,
|
|
11314
11319
|
endTime: endTime
|
|
11315
11320
|
};
|
|
11316
|
-
_context.next =
|
|
11317
|
-
return
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11325
|
-
|
|
11326
|
-
|
|
11327
|
-
|
|
11321
|
+
_context.next = 14;
|
|
11322
|
+
return getWdtListProduct(params).then(function (res) {
|
|
11323
|
+
if (res.success) {
|
|
11324
|
+
var _res$data = res.data,
|
|
11325
|
+
_res$data$productList = _res$data.productList,
|
|
11326
|
+
productList = _res$data$productList === void 0 ? [] : _res$data$productList,
|
|
11327
|
+
_res$data$total = _res$data.total,
|
|
11328
|
+
_total = _res$data$total === void 0 ? 0 : _res$data$total;
|
|
11329
|
+
var newProducts = productList.map(function (item, index) {
|
|
11330
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
11331
|
+
index: index + 1
|
|
11332
|
+
});
|
|
11328
11333
|
});
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11332
|
-
|
|
11334
|
+
setGoodList(newProducts);
|
|
11335
|
+
if (pageNo === 1) {
|
|
11336
|
+
setTotal(_total);
|
|
11337
|
+
}
|
|
11338
|
+
} else {
|
|
11339
|
+
var _res$data2;
|
|
11340
|
+
setGoodList([]);
|
|
11341
|
+
setTotal(0);
|
|
11342
|
+
antd.message.error(((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.errorMsg) || res.message);
|
|
11333
11343
|
}
|
|
11334
|
-
}
|
|
11335
|
-
|
|
11336
|
-
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
case 12:
|
|
11340
|
-
_context.prev = 12;
|
|
11344
|
+
}).catch(function (e) {
|
|
11345
|
+
console.log(e);
|
|
11346
|
+
});
|
|
11347
|
+
case 14:
|
|
11348
|
+
_context.prev = 14;
|
|
11341
11349
|
setLoading(false);
|
|
11342
|
-
return _context.finish(
|
|
11343
|
-
case
|
|
11350
|
+
return _context.finish(14);
|
|
11351
|
+
case 17:
|
|
11344
11352
|
case "end":
|
|
11345
11353
|
return _context.stop();
|
|
11346
11354
|
}
|
|
11347
|
-
}, _callee, null, [[
|
|
11355
|
+
}, _callee, null, [[0,, 14, 17]]);
|
|
11348
11356
|
}));
|
|
11349
11357
|
return function queryItems() {
|
|
11350
11358
|
return _ref.apply(this, arguments);
|
|
11351
11359
|
};
|
|
11352
11360
|
}();
|
|
11353
|
-
var
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11359
|
-
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11361
|
+
var disabledDate = function disabledDate(current) {
|
|
11362
|
+
var today = hooks(hooks().format('YYYY-MM-DD'));
|
|
11363
|
+
var currentDay = hooks(current.format('YYYY-MM-DD'));
|
|
11364
|
+
if (currentDay.diff(today, 'days') > 0) {
|
|
11365
|
+
return true;
|
|
11366
|
+
}
|
|
11367
|
+
if (!dates) {
|
|
11368
|
+
return false;
|
|
11369
|
+
}
|
|
11370
|
+
var tooLate = dates[0] && current.diff(dates[0], 'days') > 30;
|
|
11371
|
+
var tooEarly = dates[1] && dates[1].diff(current, 'days') > 30;
|
|
11372
|
+
return !!tooEarly || !!tooLate;
|
|
11373
|
+
};
|
|
11374
|
+
var onOpenChange = function onOpenChange(open) {
|
|
11375
|
+
if (open) {
|
|
11376
|
+
setDates([null, null]);
|
|
11377
|
+
} else {
|
|
11378
|
+
setDates(null);
|
|
11379
|
+
}
|
|
11365
11380
|
};
|
|
11366
11381
|
var onReset = function onReset() {
|
|
11367
|
-
form.resetFields();
|
|
11368
11382
|
form.setFieldsValue({
|
|
11369
|
-
dateTimePicker:
|
|
11370
|
-
|
|
11383
|
+
dateTimePicker: getInitTime(),
|
|
11384
|
+
goodNo: '',
|
|
11385
|
+
specNo: ''
|
|
11371
11386
|
});
|
|
11372
11387
|
setPageNo(function (prev) {
|
|
11373
|
-
if (prev === 1
|
|
11388
|
+
if (prev === 1) {
|
|
11374
11389
|
queryItems();
|
|
11375
11390
|
}
|
|
11376
11391
|
return 1;
|
|
11377
11392
|
});
|
|
11378
11393
|
};
|
|
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) {
|
|
11394
|
+
var handleDelete = function handleDelete(record) {
|
|
11406
11395
|
var newSelectList = selectList.filter(function (item) {
|
|
11407
11396
|
return item.specId !== record.specId;
|
|
11408
11397
|
});
|
|
11409
11398
|
setSelect(_toConsumableArray(newSelectList));
|
|
11410
|
-
setSelectIds(_toConsumableArray(newSelectList.map(function (item) {
|
|
11411
|
-
return item.specId;
|
|
11412
|
-
})));
|
|
11413
11399
|
};
|
|
11414
11400
|
var displaySelectedColumns = [{
|
|
11415
11401
|
dataIndex: 'operation',
|
|
11416
11402
|
title: '',
|
|
11417
11403
|
ellipsis: true,
|
|
11418
11404
|
width: 50,
|
|
11419
|
-
render: function render(_, record
|
|
11405
|
+
render: function render(_, record) {
|
|
11420
11406
|
return /*#__PURE__*/React__default['default'].createElement(icons.DeleteOutlined, {
|
|
11421
11407
|
onClick: function onClick() {
|
|
11422
11408
|
return handleDelete(record);
|
|
@@ -11447,8 +11433,10 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11447
11433
|
}];
|
|
11448
11434
|
var expandedRowSelection = {
|
|
11449
11435
|
fixed: true,
|
|
11450
|
-
selectedRowKeys:
|
|
11451
|
-
|
|
11436
|
+
selectedRowKeys: selectList.map(function (item) {
|
|
11437
|
+
return item.specId;
|
|
11438
|
+
}),
|
|
11439
|
+
onSelect: function onSelect(record, selected) {
|
|
11452
11440
|
var tempList = [];
|
|
11453
11441
|
if (selected) {
|
|
11454
11442
|
tempList = [].concat(_toConsumableArray(selectList), [record]);
|
|
@@ -11458,9 +11446,6 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11458
11446
|
});
|
|
11459
11447
|
}
|
|
11460
11448
|
setSelect(_toConsumableArray(tempList));
|
|
11461
|
-
setSelectIds(_toConsumableArray(tempList.map(function (item) {
|
|
11462
|
-
return item.specId;
|
|
11463
|
-
})));
|
|
11464
11449
|
},
|
|
11465
11450
|
onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
|
|
11466
11451
|
var tempAllList = [];
|
|
@@ -11474,15 +11459,12 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11474
11459
|
});
|
|
11475
11460
|
}
|
|
11476
11461
|
setSelect(_toConsumableArray(tempAllList));
|
|
11477
|
-
setSelectIds(_toConsumableArray(tempAllList.map(function (item) {
|
|
11478
|
-
return item.specId;
|
|
11479
|
-
})));
|
|
11480
11462
|
}
|
|
11481
11463
|
};
|
|
11482
|
-
var expandedRowRender = function expandedRowRender(record
|
|
11464
|
+
var expandedRowRender = function expandedRowRender(record) {
|
|
11483
11465
|
return /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
11484
|
-
rowKey:
|
|
11485
|
-
size:
|
|
11466
|
+
rowKey: "specId",
|
|
11467
|
+
size: "small",
|
|
11486
11468
|
columns: expandedColumns,
|
|
11487
11469
|
dataSource: record.itemDetailList || [],
|
|
11488
11470
|
pagination: false,
|
|
@@ -11492,43 +11474,61 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11492
11474
|
}
|
|
11493
11475
|
});
|
|
11494
11476
|
};
|
|
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, {
|
|
11477
|
+
React__default['default'].useEffect(function () {
|
|
11478
|
+
queryItems();
|
|
11479
|
+
}, []);
|
|
11480
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Form, {
|
|
11507
11481
|
layout: "inline",
|
|
11508
11482
|
form: form,
|
|
11509
|
-
onFinish:
|
|
11510
|
-
onValuesChange: onValuesChange,
|
|
11483
|
+
onFinish: queryItems,
|
|
11511
11484
|
initialValues: {
|
|
11512
|
-
|
|
11485
|
+
goodNo: '',
|
|
11486
|
+
specNo: '',
|
|
11487
|
+
dateTimePicker: getInitTime()
|
|
11513
11488
|
}
|
|
11514
11489
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11515
|
-
name: "dateTimePicker"
|
|
11490
|
+
name: "dateTimePicker",
|
|
11491
|
+
style: {
|
|
11492
|
+
marginBottom: '12px'
|
|
11493
|
+
}
|
|
11516
11494
|
}, /*#__PURE__*/React__default['default'].createElement(RangePicker, {
|
|
11517
11495
|
style: {
|
|
11518
|
-
width: '
|
|
11496
|
+
width: '240px'
|
|
11519
11497
|
},
|
|
11520
11498
|
placeholder: ['开始日期', '结束日期'],
|
|
11521
|
-
showTime:
|
|
11522
|
-
|
|
11499
|
+
showTime: false,
|
|
11500
|
+
disabledDate: disabledDate,
|
|
11501
|
+
onCalendarChange: function onCalendarChange(val) {
|
|
11502
|
+
return setDates(val);
|
|
11503
|
+
},
|
|
11504
|
+
onOpenChange: onOpenChange
|
|
11523
11505
|
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11524
|
-
name: "
|
|
11506
|
+
name: "goodNo",
|
|
11507
|
+
style: {
|
|
11508
|
+
marginBottom: '12px'
|
|
11509
|
+
}
|
|
11525
11510
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
11526
11511
|
placeholder: "\u5546\u54C1SPU\u7F16\u7801",
|
|
11527
11512
|
allowClear: true,
|
|
11528
11513
|
style: {
|
|
11529
11514
|
width: 150
|
|
11530
11515
|
}
|
|
11531
|
-
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item,
|
|
11516
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11517
|
+
name: "specNo",
|
|
11518
|
+
style: {
|
|
11519
|
+
marginBottom: '12px'
|
|
11520
|
+
}
|
|
11521
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Input, {
|
|
11522
|
+
placeholder: "\u5546\u54C1SKU\u7F16\u7801",
|
|
11523
|
+
allowClear: true,
|
|
11524
|
+
style: {
|
|
11525
|
+
width: 150
|
|
11526
|
+
}
|
|
11527
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Form.Item, {
|
|
11528
|
+
style: {
|
|
11529
|
+
marginBottom: '12px'
|
|
11530
|
+
}
|
|
11531
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
11532
11532
|
type: "primary",
|
|
11533
11533
|
htmlType: "submit",
|
|
11534
11534
|
style: {
|
|
@@ -11538,10 +11538,10 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11538
11538
|
onClick: onReset
|
|
11539
11539
|
}, "\u91CD\u7F6E"))), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
11540
11540
|
style: {
|
|
11541
|
-
marginTop: '
|
|
11541
|
+
marginTop: '4px'
|
|
11542
11542
|
}
|
|
11543
11543
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
11544
|
-
rowKey:
|
|
11544
|
+
rowKey: "goodNo",
|
|
11545
11545
|
columns: columns$1,
|
|
11546
11546
|
dataSource: goodList,
|
|
11547
11547
|
loading: loading,
|
|
@@ -11558,14 +11558,14 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11558
11558
|
current: pageNo,
|
|
11559
11559
|
pageSize: pageSize,
|
|
11560
11560
|
pageSizeOptions: [],
|
|
11561
|
-
onChange:
|
|
11561
|
+
onChange: setPageNo
|
|
11562
11562
|
}
|
|
11563
11563
|
})), !!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
11564
|
style: {
|
|
11565
11565
|
marginTop: '16px'
|
|
11566
11566
|
}
|
|
11567
11567
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
11568
|
-
rowKey:
|
|
11568
|
+
rowKey: "specId",
|
|
11569
11569
|
columns: [].concat(displaySelectedColumns, expandedColumns),
|
|
11570
11570
|
dataSource: displaySelectList,
|
|
11571
11571
|
pagination: false,
|
|
@@ -11576,7 +11576,48 @@ var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
|
11576
11576
|
style: {
|
|
11577
11577
|
width: '100%'
|
|
11578
11578
|
}
|
|
11579
|
-
}))))
|
|
11579
|
+
}))));
|
|
11580
|
+
};
|
|
11581
|
+
var WdtGoodList = /*#__PURE__*/React.forwardRef(GoodList);
|
|
11582
|
+
|
|
11583
|
+
var GoodsModal$3 = function GoodsModal(props, ref) {
|
|
11584
|
+
React.useImperativeHandle(ref, function () {
|
|
11585
|
+
return {
|
|
11586
|
+
open: function open() {
|
|
11587
|
+
setVisible(true);
|
|
11588
|
+
}
|
|
11589
|
+
};
|
|
11590
|
+
});
|
|
11591
|
+
var onSubmit = props.onSubmit,
|
|
11592
|
+
width = props.width;
|
|
11593
|
+
var _useState = React.useState(false),
|
|
11594
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11595
|
+
visible = _useState2[0],
|
|
11596
|
+
setVisible = _useState2[1];
|
|
11597
|
+
var wdtGoodListRef = React.useRef(null);
|
|
11598
|
+
var _onCancel = function onCancel() {
|
|
11599
|
+
setVisible(false);
|
|
11600
|
+
};
|
|
11601
|
+
var onOk = function onOk() {
|
|
11602
|
+
var _wdtGoodListRef$curre;
|
|
11603
|
+
var selectedList = ((_wdtGoodListRef$curre = wdtGoodListRef.current) === null || _wdtGoodListRef$curre === void 0 ? void 0 : _wdtGoodListRef$curre.getSelectGoodList()) || [];
|
|
11604
|
+
onSubmit(selectedList);
|
|
11605
|
+
_onCancel();
|
|
11606
|
+
};
|
|
11607
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, visible && /*#__PURE__*/React__default['default'].createElement(antd.Modal, {
|
|
11608
|
+
title: '选择商品',
|
|
11609
|
+
okText: '确认',
|
|
11610
|
+
cancelText: '取消',
|
|
11611
|
+
visible: visible,
|
|
11612
|
+
width: width || 850,
|
|
11613
|
+
onCancel: function onCancel() {
|
|
11614
|
+
_onCancel();
|
|
11615
|
+
},
|
|
11616
|
+
onOk: onOk,
|
|
11617
|
+
wrapClassName: "goodModal"
|
|
11618
|
+
}, /*#__PURE__*/React__default['default'].createElement(WdtGoodList, {
|
|
11619
|
+
ref: wdtGoodListRef
|
|
11620
|
+
})));
|
|
11580
11621
|
};
|
|
11581
11622
|
var WdtGoodsModal = /*#__PURE__*/React.forwardRef(GoodsModal$3);
|
|
11582
11623
|
|
|
@@ -12363,20 +12404,6 @@ var typeMap = {
|
|
|
12363
12404
|
money: 'money',
|
|
12364
12405
|
share: 'share'
|
|
12365
12406
|
}
|
|
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
12407
|
}
|
|
12381
12408
|
};
|
|
12382
12409
|
var BsReissue = function BsReissue(props) {
|
|
@@ -12979,6 +13006,245 @@ var CommonGoods = function CommonGoods(props) {
|
|
|
12979
13006
|
}));
|
|
12980
13007
|
};
|
|
12981
13008
|
|
|
13009
|
+
var _excluded$g = ["value", "onChange", "reasonList", "disabled", "type"];
|
|
13010
|
+
var typeMap$1 = {
|
|
13011
|
+
WDT_REISSUE_GOODS: {
|
|
13012
|
+
key: 'wdtReissueGoods',
|
|
13013
|
+
name: '旺店通',
|
|
13014
|
+
typeName: 'wdtReissueType',
|
|
13015
|
+
wdtSystemOrder: 'wdtSystemOrder',
|
|
13016
|
+
wdtSystemOrderNo: 'wdtSystemOrderNo',
|
|
13017
|
+
reissueSelectList: 'wdtReissueSelectList',
|
|
13018
|
+
reissueSelectListReturn: 'wdtReissueSelectListReturn',
|
|
13019
|
+
reissueDeleteGood: 'wdtReissueDeleteGood',
|
|
13020
|
+
changeShopCode: 'wdtChangeShopCode',
|
|
13021
|
+
reissueType: 'wdtReissueType',
|
|
13022
|
+
formatDefaultField: {
|
|
13023
|
+
money: 'orderPrice',
|
|
13024
|
+
share: 'sharePrice'
|
|
13025
|
+
}
|
|
13026
|
+
}
|
|
13027
|
+
};
|
|
13028
|
+
var wdtReissue = function wdtReissue(props) {
|
|
13029
|
+
var _typeMap$type7, _value$typeMap$type$t3, _typeMap$type11, _typeMap$type25, _typeMap$type26, _value$typeMap$type$w2, _typeMap$type27, _typeMap$type28, _typeMap$type29;
|
|
13030
|
+
var value = props.value,
|
|
13031
|
+
onChange = props.onChange,
|
|
13032
|
+
_props$reasonList = props.reasonList,
|
|
13033
|
+
reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
|
|
13034
|
+
disabled = props.disabled,
|
|
13035
|
+
type = props.type,
|
|
13036
|
+
other = _objectWithoutProperties(props, _excluded$g);
|
|
13037
|
+
var valueRef = React.useRef({});
|
|
13038
|
+
React.useEffect(function () {
|
|
13039
|
+
var _typeMap$type, _typeMap$type4;
|
|
13040
|
+
valueRef.current = value;
|
|
13041
|
+
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) {
|
|
13042
|
+
if (disabled) return;
|
|
13043
|
+
if (value) {
|
|
13044
|
+
var _typeMap$type2, _typeMap$type3;
|
|
13045
|
+
var newValue = _objectSpread2({}, value);
|
|
13046
|
+
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) {
|
|
13047
|
+
return item.sku !== data;
|
|
13048
|
+
});
|
|
13049
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13050
|
+
}
|
|
13051
|
+
});
|
|
13052
|
+
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) {
|
|
13053
|
+
onChange(_objectSpread2(_objectSpread2({}, value), {}, {
|
|
13054
|
+
shopCode: data.shopCode
|
|
13055
|
+
}));
|
|
13056
|
+
});
|
|
13057
|
+
}, [value, disabled]);
|
|
13058
|
+
React.useEffect(function () {
|
|
13059
|
+
var _value$orders, _value$showOrderInfo;
|
|
13060
|
+
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)) {
|
|
13061
|
+
if (type === 'WDT_SYSTEM_ORDER') {
|
|
13062
|
+
getWdtOrderList(value.orderNo);
|
|
13063
|
+
}
|
|
13064
|
+
}
|
|
13065
|
+
return;
|
|
13066
|
+
}, [value]);
|
|
13067
|
+
React.useEffect(function () {
|
|
13068
|
+
var _typeMap$type5;
|
|
13069
|
+
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];
|
|
13070
|
+
if (wdtSystemOrderNo) {
|
|
13071
|
+
var _value$typeMap$type$t, _typeMap$type6;
|
|
13072
|
+
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])) {
|
|
13073
|
+
getGoodItems(wdtSystemOrderNo);
|
|
13074
|
+
}
|
|
13075
|
+
}
|
|
13076
|
+
return;
|
|
13077
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type7 = typeMap$1[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.wdtSystemOrderNo]]);
|
|
13078
|
+
React.useEffect(function () {
|
|
13079
|
+
var _value$typeMap$type$t2, _typeMap$type8, _typeMap$type9;
|
|
13080
|
+
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];
|
|
13081
|
+
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];
|
|
13082
|
+
if (['1'].includes(typeName)) {
|
|
13083
|
+
wdtSystemOrderNo && getGoodItems(wdtSystemOrderNo);
|
|
13084
|
+
} else if (['2'].includes(typeName)) {
|
|
13085
|
+
var _typeMap$type10;
|
|
13086
|
+
var newValue = _objectSpread2({}, value);
|
|
13087
|
+
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)] = [];
|
|
13088
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13089
|
+
}
|
|
13090
|
+
return;
|
|
13091
|
+
}, [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]]);
|
|
13092
|
+
var getGoodItems = function getGoodItems(wdtSystemOrderNo) {
|
|
13093
|
+
var _value$typeMap$type$w, _typeMap$type12, _ref;
|
|
13094
|
+
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;
|
|
13095
|
+
var order = (_ref = orders || []) === null || _ref === void 0 ? void 0 : _ref.find(function (orderItem) {
|
|
13096
|
+
return orderItem.billNo === wdtSystemOrderNo;
|
|
13097
|
+
});
|
|
13098
|
+
if (order) {
|
|
13099
|
+
var _typeMap$type13, _order$goodDetails;
|
|
13100
|
+
var newValue = _objectSpread2({}, value);
|
|
13101
|
+
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) {
|
|
13102
|
+
var _typeMap$type14, _typeMap$type15;
|
|
13103
|
+
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;
|
|
13104
|
+
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;
|
|
13105
|
+
item.canUpdateNumber = true;
|
|
13106
|
+
return item;
|
|
13107
|
+
});
|
|
13108
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13109
|
+
}
|
|
13110
|
+
};
|
|
13111
|
+
var getWdtOrderList = /*#__PURE__*/function () {
|
|
13112
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
|
|
13113
|
+
var _yield$request, success, data, _typeMap$type16, _typeMap$type17, orders, showOrderInfo;
|
|
13114
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13115
|
+
while (1) switch (_context.prev = _context.next) {
|
|
13116
|
+
case 0:
|
|
13117
|
+
_context.next = 2;
|
|
13118
|
+
return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
|
|
13119
|
+
method: 'post',
|
|
13120
|
+
data: {
|
|
13121
|
+
billNo: orderNo
|
|
13122
|
+
}
|
|
13123
|
+
});
|
|
13124
|
+
case 2:
|
|
13125
|
+
_yield$request = _context.sent;
|
|
13126
|
+
success = _yield$request.success;
|
|
13127
|
+
data = _yield$request.data;
|
|
13128
|
+
if (success) {
|
|
13129
|
+
orders = ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
|
|
13130
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
13131
|
+
billNo: item.tradeNo,
|
|
13132
|
+
billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
|
|
13133
|
+
billTag: item.tagName
|
|
13134
|
+
});
|
|
13135
|
+
});
|
|
13136
|
+
showOrderInfo = data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
|
|
13137
|
+
return {
|
|
13138
|
+
billNo: item.tradeNo,
|
|
13139
|
+
billType: kmkfUtils.WDT_ORDER_TYPE_MAP[item.tradeType],
|
|
13140
|
+
billTag: item.tagName
|
|
13141
|
+
};
|
|
13142
|
+
});
|
|
13143
|
+
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]), {}, {
|
|
13144
|
+
showOrderInfo: showOrderInfo,
|
|
13145
|
+
orders: orders
|
|
13146
|
+
}))));
|
|
13147
|
+
}
|
|
13148
|
+
case 6:
|
|
13149
|
+
case "end":
|
|
13150
|
+
return _context.stop();
|
|
13151
|
+
}
|
|
13152
|
+
}, _callee);
|
|
13153
|
+
}));
|
|
13154
|
+
return function getWdtOrderList(_x) {
|
|
13155
|
+
return _ref2.apply(this, arguments);
|
|
13156
|
+
};
|
|
13157
|
+
}();
|
|
13158
|
+
var changeTypeHandle = function changeTypeHandle(val) {
|
|
13159
|
+
var _typeMap$type18, _typeMap$type19;
|
|
13160
|
+
var newValue = _objectSpread2({}, value);
|
|
13161
|
+
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;
|
|
13162
|
+
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)] = [];
|
|
13163
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13164
|
+
valueRef.current = newValue;
|
|
13165
|
+
// if (['2'].includes(val[0])) {
|
|
13166
|
+
// onChange?.(newValue);
|
|
13167
|
+
// valueRef.current = newValue;
|
|
13168
|
+
// }
|
|
13169
|
+
// pubsub.publish(`${typeMap?.[type]?.reissueType}`, {
|
|
13170
|
+
// val: val[0],
|
|
13171
|
+
// goodValue: newValue,
|
|
13172
|
+
// });
|
|
13173
|
+
};
|
|
13174
|
+
|
|
13175
|
+
var changeGoodHandle = function changeGoodHandle(val) {
|
|
13176
|
+
var _typeMap$type20;
|
|
13177
|
+
var newValue = _objectSpread2({}, value);
|
|
13178
|
+
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) {
|
|
13179
|
+
var _typeMap$type21, _typeMap$type22;
|
|
13180
|
+
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;
|
|
13181
|
+
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;
|
|
13182
|
+
return item;
|
|
13183
|
+
});
|
|
13184
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13185
|
+
};
|
|
13186
|
+
var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
|
|
13187
|
+
var _typeMap$type23;
|
|
13188
|
+
var newValue = _objectSpread2({}, value);
|
|
13189
|
+
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;
|
|
13190
|
+
console.log('changeSystemOrderHandle', val, newValue);
|
|
13191
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
13192
|
+
};
|
|
13193
|
+
//显示选择商品按钮 原单换不显示选择商品
|
|
13194
|
+
var showChangeBtn = React.useMemo(function () {
|
|
13195
|
+
var _typeMap$type24;
|
|
13196
|
+
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.wdtSystemOrderNo]);
|
|
13197
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.wdtSystemOrderNo]]);
|
|
13198
|
+
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
|
|
13199
|
+
gutter: 8
|
|
13200
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Col, {
|
|
13201
|
+
className: "gutter-row",
|
|
13202
|
+
span: 6
|
|
13203
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
13204
|
+
style: {
|
|
13205
|
+
marginBottom: '8px'
|
|
13206
|
+
},
|
|
13207
|
+
disabled: disabled,
|
|
13208
|
+
allowClear: false,
|
|
13209
|
+
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)],
|
|
13210
|
+
onChange: function onChange(val) {
|
|
13211
|
+
return changeSystemOrderHandle(val);
|
|
13212
|
+
}
|
|
13213
|
+
}, ((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) {
|
|
13214
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
|
|
13215
|
+
key: item.billNo,
|
|
13216
|
+
value: item.billNo,
|
|
13217
|
+
label: item.billNo
|
|
13218
|
+
}, item.billNo);
|
|
13219
|
+
}))), /*#__PURE__*/React__default['default'].createElement(antd.Col, {
|
|
13220
|
+
className: "gutter-row",
|
|
13221
|
+
span: 6
|
|
13222
|
+
}, /*#__PURE__*/React__default['default'].createElement(antd.Cascader, {
|
|
13223
|
+
style: {
|
|
13224
|
+
marginBottom: '8px'
|
|
13225
|
+
},
|
|
13226
|
+
disabled: disabled,
|
|
13227
|
+
allowClear: false,
|
|
13228
|
+
options: reasonList,
|
|
13229
|
+
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)],
|
|
13230
|
+
onChange: function onChange(val) {
|
|
13231
|
+
return changeTypeHandle(val);
|
|
13232
|
+
}
|
|
13233
|
+
}))), /*#__PURE__*/React__default['default'].createElement(GoodItem$1, _objectSpread2(_objectSpread2({
|
|
13234
|
+
key: 'reissueGoods'
|
|
13235
|
+
}, other), {}, {
|
|
13236
|
+
type: type,
|
|
13237
|
+
disabled: disabled,
|
|
13238
|
+
canUpdateNumber: showChangeBtn,
|
|
13239
|
+
showChangeBtn: showChangeBtn,
|
|
13240
|
+
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
13241
|
+
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)],
|
|
13242
|
+
onChange: function onChange(val) {
|
|
13243
|
+
return changeGoodHandle(val);
|
|
13244
|
+
}
|
|
13245
|
+
})));
|
|
13246
|
+
};
|
|
13247
|
+
|
|
12982
13248
|
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";
|
|
12983
13249
|
styleInject(css_248z$a);
|
|
12984
13250
|
|
|
@@ -13455,12 +13721,12 @@ var Goods$1 = function Goods(props, ref) {
|
|
|
13455
13721
|
};
|
|
13456
13722
|
var index$2 = /*#__PURE__*/React.forwardRef(Goods$1);
|
|
13457
13723
|
|
|
13458
|
-
var _excluded$
|
|
13724
|
+
var _excluded$h = ["onChange", "value", "failValue"];
|
|
13459
13725
|
function CommonStatus(props) {
|
|
13460
13726
|
var onChange = props.onChange,
|
|
13461
13727
|
value = props.value,
|
|
13462
13728
|
failValue = props.failValue,
|
|
13463
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
13729
|
+
other = _objectWithoutProperties(props, _excluded$h);
|
|
13464
13730
|
var changeHandle = function changeHandle(val) {
|
|
13465
13731
|
onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
13466
13732
|
status: val,
|
|
@@ -13579,7 +13845,7 @@ var CommonSystemOrder = function CommonSystemOrder(props) {
|
|
|
13579
13845
|
})) : null) : null);
|
|
13580
13846
|
};
|
|
13581
13847
|
|
|
13582
|
-
var _excluded$
|
|
13848
|
+
var _excluded$i = ["value", "onChange", "disabled", "failValue", "type"];
|
|
13583
13849
|
var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
13584
13850
|
var _value$changeIndex, _value$changeIndex2, _value$changeIndex3;
|
|
13585
13851
|
var _props$value = props.value,
|
|
@@ -13589,7 +13855,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
|
13589
13855
|
failValue = props.failValue,
|
|
13590
13856
|
_props$type = props.type,
|
|
13591
13857
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
13592
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
13858
|
+
other = _objectWithoutProperties(props, _excluded$i);
|
|
13593
13859
|
var _useState = React.useState(0),
|
|
13594
13860
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13595
13861
|
changeIndex = _useState2[0],
|
|
@@ -13655,7 +13921,7 @@ var CommonSystemOrder$1 = function CommonSystemOrder(props) {
|
|
|
13655
13921
|
}, "\u5931\u8D25\u539F\u56E0\uFF1A", (_value$changeIndex3 = value[changeIndex]) === null || _value$changeIndex3 === void 0 ? void 0 : _value$changeIndex3.reason) : null) : null);
|
|
13656
13922
|
};
|
|
13657
13923
|
|
|
13658
|
-
var _excluded$
|
|
13924
|
+
var _excluded$j = ["value", "onChange", "disabled", "failValue", "type"];
|
|
13659
13925
|
var msgTypeCh = {
|
|
13660
13926
|
ding: '钉钉',
|
|
13661
13927
|
wechat: '微信',
|
|
@@ -13671,7 +13937,7 @@ var MsgStatus = function MsgStatus(props) {
|
|
|
13671
13937
|
failValue = props.failValue,
|
|
13672
13938
|
_props$type = props.type,
|
|
13673
13939
|
type = _props$type === void 0 ? 1 : _props$type,
|
|
13674
|
-
other = _objectWithoutProperties(props, _excluded$
|
|
13940
|
+
other = _objectWithoutProperties(props, _excluded$j);
|
|
13675
13941
|
var _useState = React.useState(0),
|
|
13676
13942
|
_useState2 = _slicedToArray(_useState, 2),
|
|
13677
13943
|
changeIndex = _useState2[0],
|
|
@@ -13794,4 +14060,6 @@ exports.Supplier = Supplier;
|
|
|
13794
14060
|
exports.TBGoodId = TBGoodId;
|
|
13795
14061
|
exports.TBGoodSerial = TBGoodSerial;
|
|
13796
14062
|
exports.TradeId = TradeId;
|
|
14063
|
+
exports.WdtGoodList = WdtGoodList;
|
|
14064
|
+
exports.WdtReissue = wdtReissue;
|
|
13797
14065
|
exports.WlnGoods = WlnGoods;
|