@kmkf-fe-packages/basic-components 2.0.79-beta.82 → 2.0.79-beta.84
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 +325 -313
- package/dist/index.js +325 -313
- package/dist/src/constants/orderSubForm.d.ts +6 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -21319,8 +21319,6 @@ var CustomizeUpload = function CustomizeUpload(_ref) {
|
|
|
21319
21319
|
}))), renderImages());
|
|
21320
21320
|
};
|
|
21321
21321
|
|
|
21322
|
-
var expressDateInstance = kmkfUtils.ExpressData.getInstance();
|
|
21323
|
-
var expressData = expressDateInstance.expressData;
|
|
21324
21322
|
var refundTypeMap = {
|
|
21325
21323
|
0: '其他',
|
|
21326
21324
|
1: '已发货仅退款',
|
|
@@ -21380,216 +21378,218 @@ var consignTypeOptions = Object.entries(consignTypeMap).map(function (_ref5) {
|
|
|
21380
21378
|
value: key
|
|
21381
21379
|
};
|
|
21382
21380
|
});
|
|
21383
|
-
var
|
|
21384
|
-
|
|
21385
|
-
|
|
21386
|
-
|
|
21387
|
-
|
|
21388
|
-
|
|
21389
|
-
|
|
21390
|
-
|
|
21391
|
-
|
|
21392
|
-
|
|
21393
|
-
|
|
21394
|
-
|
|
21395
|
-
|
|
21396
|
-
|
|
21397
|
-
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21403
|
-
|
|
21404
|
-
|
|
21405
|
-
|
|
21406
|
-
|
|
21407
|
-
|
|
21408
|
-
|
|
21409
|
-
|
|
21410
|
-
|
|
21411
|
-
|
|
21412
|
-
|
|
21413
|
-
|
|
21414
|
-
|
|
21415
|
-
|
|
21416
|
-
|
|
21417
|
-
|
|
21418
|
-
|
|
21419
|
-
|
|
21420
|
-
|
|
21421
|
-
|
|
21422
|
-
|
|
21423
|
-
|
|
21424
|
-
|
|
21425
|
-
|
|
21426
|
-
|
|
21427
|
-
|
|
21428
|
-
|
|
21429
|
-
|
|
21430
|
-
|
|
21431
|
-
|
|
21432
|
-
|
|
21433
|
-
|
|
21434
|
-
|
|
21435
|
-
|
|
21436
|
-
|
|
21437
|
-
|
|
21438
|
-
|
|
21439
|
-
|
|
21440
|
-
|
|
21441
|
-
|
|
21442
|
-
|
|
21443
|
-
|
|
21444
|
-
|
|
21445
|
-
|
|
21446
|
-
|
|
21447
|
-
|
|
21448
|
-
|
|
21449
|
-
|
|
21450
|
-
|
|
21451
|
-
|
|
21452
|
-
|
|
21453
|
-
|
|
21454
|
-
|
|
21455
|
-
|
|
21456
|
-
|
|
21457
|
-
|
|
21458
|
-
|
|
21459
|
-
|
|
21460
|
-
|
|
21461
|
-
|
|
21462
|
-
|
|
21463
|
-
|
|
21464
|
-
|
|
21465
|
-
|
|
21466
|
-
|
|
21467
|
-
|
|
21468
|
-
|
|
21469
|
-
|
|
21470
|
-
|
|
21471
|
-
|
|
21472
|
-
|
|
21473
|
-
|
|
21474
|
-
|
|
21475
|
-
|
|
21476
|
-
|
|
21477
|
-
|
|
21478
|
-
|
|
21479
|
-
|
|
21480
|
-
|
|
21481
|
-
|
|
21482
|
-
|
|
21483
|
-
|
|
21484
|
-
|
|
21485
|
-
|
|
21486
|
-
|
|
21487
|
-
|
|
21488
|
-
|
|
21489
|
-
|
|
21490
|
-
|
|
21491
|
-
|
|
21492
|
-
|
|
21493
|
-
|
|
21494
|
-
|
|
21495
|
-
|
|
21496
|
-
|
|
21497
|
-
|
|
21498
|
-
|
|
21499
|
-
|
|
21500
|
-
|
|
21501
|
-
|
|
21502
|
-
|
|
21503
|
-
|
|
21504
|
-
|
|
21505
|
-
|
|
21506
|
-
|
|
21507
|
-
|
|
21508
|
-
|
|
21509
|
-
|
|
21510
|
-
|
|
21511
|
-
|
|
21512
|
-
|
|
21513
|
-
|
|
21514
|
-
|
|
21515
|
-
|
|
21516
|
-
|
|
21517
|
-
|
|
21518
|
-
|
|
21519
|
-
|
|
21520
|
-
|
|
21521
|
-
|
|
21522
|
-
|
|
21523
|
-
|
|
21524
|
-
|
|
21525
|
-
|
|
21526
|
-
|
|
21527
|
-
|
|
21528
|
-
|
|
21529
|
-
|
|
21530
|
-
|
|
21531
|
-
|
|
21532
|
-
|
|
21533
|
-
|
|
21534
|
-
|
|
21535
|
-
|
|
21536
|
-
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
|
|
21542
|
-
|
|
21543
|
-
|
|
21544
|
-
|
|
21545
|
-
|
|
21546
|
-
|
|
21547
|
-
|
|
21548
|
-
|
|
21549
|
-
|
|
21550
|
-
|
|
21551
|
-
|
|
21552
|
-
|
|
21553
|
-
|
|
21554
|
-
|
|
21555
|
-
|
|
21556
|
-
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21561
|
-
|
|
21562
|
-
|
|
21563
|
-
|
|
21564
|
-
|
|
21565
|
-
|
|
21566
|
-
|
|
21567
|
-
|
|
21568
|
-
|
|
21569
|
-
|
|
21570
|
-
|
|
21571
|
-
|
|
21572
|
-
|
|
21573
|
-
|
|
21574
|
-
}
|
|
21575
|
-
|
|
21576
|
-
|
|
21577
|
-
|
|
21578
|
-
|
|
21579
|
-
|
|
21580
|
-
|
|
21581
|
-
|
|
21582
|
-
|
|
21583
|
-
|
|
21584
|
-
|
|
21381
|
+
var getOrderSubformColumns = function getOrderSubformColumns(parmas) {
|
|
21382
|
+
var _ref7 = parmas || {},
|
|
21383
|
+
_ref7$expressData = _ref7.expressData,
|
|
21384
|
+
expressData = _ref7$expressData === void 0 ? [] : _ref7$expressData;
|
|
21385
|
+
return [{
|
|
21386
|
+
dataIndex: 'title',
|
|
21387
|
+
title: '商品名称',
|
|
21388
|
+
widget: 'input',
|
|
21389
|
+
widgetProps: {},
|
|
21390
|
+
width: 150
|
|
21391
|
+
}, {
|
|
21392
|
+
dataIndex: 'productCode',
|
|
21393
|
+
title: '商品编码',
|
|
21394
|
+
widget: 'input',
|
|
21395
|
+
width: 150,
|
|
21396
|
+
widgetProps: {}
|
|
21397
|
+
}, {
|
|
21398
|
+
dataIndex: 'picUrl',
|
|
21399
|
+
title: '图片',
|
|
21400
|
+
widget: 'upload',
|
|
21401
|
+
widgetProps: {},
|
|
21402
|
+
width: 100,
|
|
21403
|
+
customizeComponent: function customizeComponent(config) {
|
|
21404
|
+
return /*#__PURE__*/React__default['default'].createElement(CustomizeUpload, {
|
|
21405
|
+
value: config.value,
|
|
21406
|
+
onChange: config.onChange,
|
|
21407
|
+
maxCount: config.maxCount,
|
|
21408
|
+
maxSize: config.maxSize
|
|
21409
|
+
});
|
|
21410
|
+
}
|
|
21411
|
+
}, {
|
|
21412
|
+
dataIndex: 'numIid',
|
|
21413
|
+
title: '商品id',
|
|
21414
|
+
widget: 'input',
|
|
21415
|
+
widgetProps: {},
|
|
21416
|
+
width: 150
|
|
21417
|
+
}, {
|
|
21418
|
+
dataIndex: 'quantity',
|
|
21419
|
+
title: '商品数量',
|
|
21420
|
+
widget: 'inputNumber',
|
|
21421
|
+
width: 100,
|
|
21422
|
+
widgetProps: {
|
|
21423
|
+
precision: 0,
|
|
21424
|
+
min: 0
|
|
21425
|
+
}
|
|
21426
|
+
}, {
|
|
21427
|
+
dataIndex: 'skuId',
|
|
21428
|
+
title: 'SKU ID',
|
|
21429
|
+
widget: 'input',
|
|
21430
|
+
width: 150,
|
|
21431
|
+
widgetProps: {}
|
|
21432
|
+
}, {
|
|
21433
|
+
dataIndex: 'outerSkuId',
|
|
21434
|
+
title: 'SKU 编码',
|
|
21435
|
+
widget: 'input',
|
|
21436
|
+
width: 150,
|
|
21437
|
+
widgetProps: {}
|
|
21438
|
+
}, {
|
|
21439
|
+
dataIndex: 'propertiesName',
|
|
21440
|
+
title: 'SKU 信息',
|
|
21441
|
+
widget: 'input',
|
|
21442
|
+
width: 200,
|
|
21443
|
+
widgetProps: {}
|
|
21444
|
+
}, {
|
|
21445
|
+
dataIndex: 'oid',
|
|
21446
|
+
title: '子订单号',
|
|
21447
|
+
widget: 'input',
|
|
21448
|
+
width: 150,
|
|
21449
|
+
widgetProps: {}
|
|
21450
|
+
}, {
|
|
21451
|
+
dataIndex: 'price',
|
|
21452
|
+
title: '商品单价',
|
|
21453
|
+
widget: 'inputNumber',
|
|
21454
|
+
width: 100,
|
|
21455
|
+
widgetProps: {
|
|
21456
|
+
precision: 2,
|
|
21457
|
+
min: 0
|
|
21458
|
+
}
|
|
21459
|
+
}, {
|
|
21460
|
+
dataIndex: 'actualPayment',
|
|
21461
|
+
title: '[子]实付金额',
|
|
21462
|
+
widget: 'inputNumber',
|
|
21463
|
+
width: 100,
|
|
21464
|
+
widgetProps: {
|
|
21465
|
+
precision: 2,
|
|
21466
|
+
min: 0
|
|
21467
|
+
}
|
|
21468
|
+
}, {
|
|
21469
|
+
dataIndex: 'expressLogisticsCode',
|
|
21470
|
+
title: '[子]运单号',
|
|
21471
|
+
widget: 'input',
|
|
21472
|
+
width: 150,
|
|
21473
|
+
widgetProps: {}
|
|
21474
|
+
}, {
|
|
21475
|
+
dataIndex: 'expressLogisticsCompany',
|
|
21476
|
+
title: '[子]发货快递',
|
|
21477
|
+
widget: 'select',
|
|
21478
|
+
width: 150,
|
|
21479
|
+
widgetProps: {
|
|
21480
|
+
options: expressData,
|
|
21481
|
+
showSearch: true,
|
|
21482
|
+
allowClear: true
|
|
21483
|
+
}
|
|
21484
|
+
}, {
|
|
21485
|
+
dataIndex: 'refundId',
|
|
21486
|
+
title: '退款单ID',
|
|
21487
|
+
widget: 'input',
|
|
21488
|
+
width: 150,
|
|
21489
|
+
widgetProps: {}
|
|
21490
|
+
}, {
|
|
21491
|
+
dataIndex: 'returnExpressLogisticsCode',
|
|
21492
|
+
title: '退货物流单号',
|
|
21493
|
+
widget: 'input',
|
|
21494
|
+
width: 150,
|
|
21495
|
+
widgetProps: {}
|
|
21496
|
+
}, {
|
|
21497
|
+
dataIndex: 'returnExpressLogisticsCompany',
|
|
21498
|
+
title: '退货物流公司',
|
|
21499
|
+
widget: 'select',
|
|
21500
|
+
width: 150,
|
|
21501
|
+
widgetProps: {
|
|
21502
|
+
options: expressData,
|
|
21503
|
+
showSearch: true,
|
|
21504
|
+
allowClear: true
|
|
21505
|
+
}
|
|
21506
|
+
}, {
|
|
21507
|
+
dataIndex: 'reason',
|
|
21508
|
+
title: '退款原因',
|
|
21509
|
+
widget: 'input',
|
|
21510
|
+
width: 200,
|
|
21511
|
+
widgetProps: {}
|
|
21512
|
+
}, {
|
|
21513
|
+
dataIndex: 'refundAmount',
|
|
21514
|
+
title: '退款金额',
|
|
21515
|
+
widget: 'inputNumber',
|
|
21516
|
+
width: 100,
|
|
21517
|
+
widgetProps: {
|
|
21518
|
+
precision: 2,
|
|
21519
|
+
min: 0
|
|
21520
|
+
}
|
|
21521
|
+
}, {
|
|
21522
|
+
dataIndex: 'afterSaleType',
|
|
21523
|
+
title: '退款类型',
|
|
21524
|
+
widget: 'select',
|
|
21525
|
+
width: 150,
|
|
21526
|
+
widgetProps: {
|
|
21527
|
+
options: refundTypeOptions,
|
|
21528
|
+
showSearch: true,
|
|
21529
|
+
allowClear: true
|
|
21530
|
+
}
|
|
21531
|
+
}, {
|
|
21532
|
+
dataIndex: 'platformStatusText',
|
|
21533
|
+
title: '退款状态(平台)',
|
|
21534
|
+
widget: 'input',
|
|
21535
|
+
width: 150,
|
|
21536
|
+
widgetProps: {}
|
|
21537
|
+
}, {
|
|
21538
|
+
dataIndex: 'onlineStatus',
|
|
21539
|
+
title: '退款状态(快麦)',
|
|
21540
|
+
widget: 'select',
|
|
21541
|
+
width: 150,
|
|
21542
|
+
widgetProps: {
|
|
21543
|
+
options: onlineStatusOptions,
|
|
21544
|
+
showSearch: true,
|
|
21545
|
+
allowClear: true
|
|
21546
|
+
}
|
|
21547
|
+
}, {
|
|
21548
|
+
dataIndex: 'applyTime',
|
|
21549
|
+
title: '退款申请时间',
|
|
21550
|
+
widget: 'datePicker',
|
|
21551
|
+
width: 150,
|
|
21552
|
+
widgetProps: {
|
|
21553
|
+
showTime: true,
|
|
21554
|
+
format: 'YYYY-MM-DD HH:mm:ss'
|
|
21555
|
+
}
|
|
21556
|
+
}, {
|
|
21557
|
+
dataIndex: 'returnFreeShipping',
|
|
21558
|
+
title: '退货免运费',
|
|
21559
|
+
widget: 'input',
|
|
21560
|
+
width: 150,
|
|
21561
|
+
widgetProps: {}
|
|
21562
|
+
}, {
|
|
21563
|
+
dataIndex: 'isCNShipment',
|
|
21564
|
+
title: '是否菜鸟仓发货',
|
|
21565
|
+
widget: 'select',
|
|
21566
|
+
width: 100,
|
|
21567
|
+
widgetProps: {
|
|
21568
|
+
options: consignTypeOptions,
|
|
21569
|
+
showSearch: true,
|
|
21570
|
+
allowClear: true
|
|
21571
|
+
}
|
|
21572
|
+
}];
|
|
21573
|
+
};
|
|
21574
|
+
var getSelectWidgetMap = function getSelectWidgetMap(expressDateInstance) {
|
|
21575
|
+
return {
|
|
21576
|
+
expressLogisticsCompany: function expressLogisticsCompany(code) {
|
|
21577
|
+
return expressDateInstance === null || expressDateInstance === void 0 ? void 0 : expressDateInstance.getExpressNameByCode(code);
|
|
21578
|
+
},
|
|
21579
|
+
returnExpressLogisticsCompany: function returnExpressLogisticsCompany(code) {
|
|
21580
|
+
return expressDateInstance === null || expressDateInstance === void 0 ? void 0 : expressDateInstance.getExpressNameByCode(code);
|
|
21581
|
+
},
|
|
21582
|
+
afterSaleType: refundTypeMap,
|
|
21583
|
+
isCNShipment: consignTypeMap,
|
|
21584
|
+
onlineStatus: onlineStatusMap
|
|
21585
|
+
};
|
|
21585
21586
|
};
|
|
21586
21587
|
var orderSubFormConstants = {
|
|
21587
|
-
|
|
21588
|
-
|
|
21589
|
-
orderSubformColumnMap: orderSubformColumnMap
|
|
21588
|
+
getSelectWidgetMap: getSelectWidgetMap,
|
|
21589
|
+
getOrderSubformColumns: getOrderSubformColumns
|
|
21590
21590
|
};
|
|
21591
21591
|
|
|
21592
|
-
var
|
|
21592
|
+
var getSelectWidgetMap$1 = orderSubFormConstants.getSelectWidgetMap;
|
|
21593
21593
|
var singletonMap$8 = new Map();
|
|
21594
21594
|
var getOrderListSingleton$3 = function getOrderListSingleton(parmas) {
|
|
21595
21595
|
var orderNo = parmas.orderNo,
|
|
@@ -21694,7 +21694,6 @@ var renderDate = function renderDate(value) {
|
|
|
21694
21694
|
return value ? hooks(value).format('YYYY-MM-DD HH:mm:ss') : '';
|
|
21695
21695
|
};
|
|
21696
21696
|
var renderImages = function renderImages(value) {
|
|
21697
|
-
console.log('renderImages', value);
|
|
21698
21697
|
var list = value ? value.split(',') : [];
|
|
21699
21698
|
return list.map(function (url) {
|
|
21700
21699
|
var finalSrc = (url === null || url === void 0 ? void 0 : url.startsWith('http')) ? url : "https://kefu.kuaimai.com/".concat(url);
|
|
@@ -21708,11 +21707,13 @@ var renderImages = function renderImages(value) {
|
|
|
21708
21707
|
var renderDetailItem = function renderDetailItem(_ref2) {
|
|
21709
21708
|
var item = _ref2.item,
|
|
21710
21709
|
val = _ref2.val;
|
|
21710
|
+
var expressDateInstance = kmkfUtils.ExpressData.getInstance();
|
|
21711
21711
|
var Component = /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, "\u4E0D\u652F\u6301\u7684\u7C7B\u578B\u7EC4\u4EF6\uFF1A", JSON.stringify(item.widget));
|
|
21712
21712
|
if (['input', 'inputNumber'].includes(item.widget)) {
|
|
21713
21713
|
Component = val;
|
|
21714
21714
|
} else if (item.widget === 'select') {
|
|
21715
|
-
var
|
|
21715
|
+
var _getSelectWidgetMap;
|
|
21716
|
+
var mapValue = (_getSelectWidgetMap = getSelectWidgetMap$1(expressDateInstance)) === null || _getSelectWidgetMap === void 0 ? void 0 : _getSelectWidgetMap[item.dataIndex];
|
|
21716
21717
|
var selectValue;
|
|
21717
21718
|
if (mapValue && typeof mapValue === 'function') {
|
|
21718
21719
|
selectValue = mapValue === null || mapValue === void 0 ? void 0 : mapValue(val);
|
|
@@ -21733,8 +21734,7 @@ var utils = {
|
|
|
21733
21734
|
renderDetailItem: renderDetailItem
|
|
21734
21735
|
};
|
|
21735
21736
|
|
|
21736
|
-
var
|
|
21737
|
-
orderSubformColumnMap$1 = orderSubFormConstants.orderSubformColumnMap;
|
|
21737
|
+
var getOrderSubformColumns$1 = orderSubFormConstants.getOrderSubformColumns;
|
|
21738
21738
|
var renderEditItem$1 = utils.renderEditItem,
|
|
21739
21739
|
renderDetailItem$1 = utils.renderDetailItem,
|
|
21740
21740
|
getOrderListSingleton$4 = utils.getOrderListSingleton;
|
|
@@ -21749,38 +21749,46 @@ var OrderSubForm = function OrderSubForm(props) {
|
|
|
21749
21749
|
manual = props.manual,
|
|
21750
21750
|
correlationList = props.subConfig.correlationList,
|
|
21751
21751
|
effects = props.effects;
|
|
21752
|
-
|
|
21752
|
+
var valueRef = React.useRef(value);
|
|
21753
|
+
React.useEffect(function () {
|
|
21754
|
+
valueRef.current = value;
|
|
21755
|
+
return;
|
|
21756
|
+
}, [value]);
|
|
21753
21757
|
var _useState = React.useState(null),
|
|
21754
21758
|
_useState2 = _slicedToArray(_useState, 2),
|
|
21755
21759
|
hoveredRowIndex = _useState2[0],
|
|
21756
21760
|
setHoveredRowIndex = _useState2[1];
|
|
21757
|
-
var updateHandle = function
|
|
21758
|
-
var
|
|
21759
|
-
if (
|
|
21760
|
-
var
|
|
21761
|
+
var updateHandle = React.useCallback(function (val, index, type) {
|
|
21762
|
+
var _valueRef$current, _valueRef$current$sub;
|
|
21763
|
+
if ((_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : (_valueRef$current$sub = _valueRef$current.subOrderList) === null || _valueRef$current$sub === void 0 ? void 0 : _valueRef$current$sub.length) {
|
|
21764
|
+
var _valueRef$current2;
|
|
21765
|
+
var subOrderList = JSON.parse(JSON.stringify((_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.subOrderList));
|
|
21761
21766
|
subOrderList[index][type] = val;
|
|
21762
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({},
|
|
21767
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
21763
21768
|
subOrderList: subOrderList
|
|
21764
21769
|
}));
|
|
21765
21770
|
}
|
|
21766
|
-
};
|
|
21771
|
+
}, [value === null || value === void 0 ? void 0 : value.subOrderList]);
|
|
21772
|
+
var orderSubformColumns = React.useMemo(function () {
|
|
21773
|
+
return getOrderSubformColumns$1({
|
|
21774
|
+
expressData: kmkfUtils.ExpressData.getInstance().getExpressData()
|
|
21775
|
+
});
|
|
21776
|
+
}, [kmkfUtils.ExpressData]);
|
|
21777
|
+
var orderSubformColumnMap = React.useMemo(function () {
|
|
21778
|
+
return orderSubformColumns.reduce(function (prv, next) {
|
|
21779
|
+
prv[next.dataIndex] = next;
|
|
21780
|
+
return prv;
|
|
21781
|
+
}, {});
|
|
21782
|
+
}, [orderSubformColumns]);
|
|
21767
21783
|
var initColumns = React.useMemo(function () {
|
|
21768
21784
|
return correlationList && (correlationList === null || correlationList === void 0 ? void 0 : correlationList.length) ? correlationList.map(function (t) {
|
|
21769
|
-
return orderSubformColumnMap
|
|
21770
|
-
}) : orderSubformColumns
|
|
21771
|
-
}, [correlationList]);
|
|
21772
|
-
// const initColumnsMap = useMemo(
|
|
21773
|
-
// () =>
|
|
21774
|
-
// initColumns.reduce((prv: any, next) => {
|
|
21775
|
-
// prv[next.dataIndex] = next;
|
|
21776
|
-
// return prv;
|
|
21777
|
-
// }, {}),
|
|
21778
|
-
// [initColumns],
|
|
21779
|
-
// );
|
|
21785
|
+
return orderSubformColumnMap === null || orderSubformColumnMap === void 0 ? void 0 : orderSubformColumnMap[t === null || t === void 0 ? void 0 : t.dataIndex];
|
|
21786
|
+
}) : orderSubformColumns;
|
|
21787
|
+
}, [correlationList, orderSubformColumns]);
|
|
21780
21788
|
var newTableHeader = React.useMemo(function () {
|
|
21781
21789
|
return initColumns.reduce(function (prv, next) {
|
|
21782
21790
|
var t = tableHeader.find(function (t) {
|
|
21783
|
-
return t.key === next.dataIndex;
|
|
21791
|
+
return t.key === (next === null || next === void 0 ? void 0 : next.dataIndex);
|
|
21784
21792
|
}) || {
|
|
21785
21793
|
isShow: true,
|
|
21786
21794
|
isEdit: false,
|
|
@@ -21788,77 +21796,80 @@ var OrderSubForm = function OrderSubForm(props) {
|
|
|
21788
21796
|
width: 150
|
|
21789
21797
|
};
|
|
21790
21798
|
if (t && t.isShow) {
|
|
21791
|
-
prv.push(_objectSpread2(_objectSpread2({}, next), t)
|
|
21799
|
+
prv.push(_objectSpread2(_objectSpread2(_objectSpread2({}, next), t), {}, {
|
|
21800
|
+
widgetProps: (next === null || next === void 0 ? void 0 : next.widgetProps) || {}
|
|
21801
|
+
}));
|
|
21792
21802
|
}
|
|
21793
21803
|
return prv;
|
|
21794
21804
|
}, []);
|
|
21795
|
-
}, [orderSubformColumns
|
|
21796
|
-
var column =
|
|
21797
|
-
|
|
21798
|
-
|
|
21799
|
-
|
|
21800
|
-
|
|
21801
|
-
return /*#__PURE__*/React__default['default'].createElement(HoverTableRowDeleteIcon, {
|
|
21802
|
-
index: index,
|
|
21803
|
-
hoveredRowIndex: hoveredRowIndex,
|
|
21804
|
-
handleClick: function handleClick() {
|
|
21805
|
-
return deleteHandle(record.uuid);
|
|
21806
|
-
}
|
|
21807
|
-
});
|
|
21808
|
-
// return <div style={{ width: 25 }}>{index + 1}</div>;
|
|
21809
|
-
}
|
|
21810
|
-
}].concat(_toConsumableArray(newTableHeader.map(function (t) {
|
|
21811
|
-
return _objectSpread2(_objectSpread2({}, t), {}, {
|
|
21812
|
-
dataIndex: t.dataIndex,
|
|
21813
|
-
title: /*#__PURE__*/React__default['default'].createElement("span", null, t.isRequired ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
21814
|
-
style: {
|
|
21815
|
-
color: 'red'
|
|
21816
|
-
}
|
|
21817
|
-
}, "*") : null, (t === null || t === void 0 ? void 0 : t.settingName) || t.title),
|
|
21818
|
-
ellipsis: true,
|
|
21819
|
-
width: t.width,
|
|
21805
|
+
}, [orderSubformColumns, tableHeader]);
|
|
21806
|
+
var column = React.useMemo(function () {
|
|
21807
|
+
return [{
|
|
21808
|
+
dataIndex: 'index',
|
|
21809
|
+
title: '序号',
|
|
21810
|
+
width: 80,
|
|
21820
21811
|
render: function render(val, record, index) {
|
|
21821
|
-
|
|
21822
|
-
var isDisabled = t.isEdit || disabled;
|
|
21823
|
-
return renderEditItem$1({
|
|
21824
|
-
item: t || {},
|
|
21825
|
-
val: val,
|
|
21826
|
-
disabled: isDisabled,
|
|
21812
|
+
return /*#__PURE__*/React__default['default'].createElement(HoverTableRowDeleteIcon, {
|
|
21827
21813
|
index: index,
|
|
21828
|
-
|
|
21829
|
-
|
|
21814
|
+
hoveredRowIndex: hoveredRowIndex,
|
|
21815
|
+
handleClick: function handleClick() {
|
|
21816
|
+
return deleteHandle(record.uuid);
|
|
21817
|
+
}
|
|
21830
21818
|
});
|
|
21819
|
+
// return <div style={{ width: 25 }}>{index + 1}</div>;
|
|
21831
21820
|
}
|
|
21832
|
-
})
|
|
21833
|
-
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21837
|
-
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
|
|
21849
|
-
|
|
21850
|
-
|
|
21851
|
-
|
|
21852
|
-
|
|
21853
|
-
fontSize: 18
|
|
21854
|
-
},
|
|
21855
|
-
onClick: function onClick() {
|
|
21856
|
-
return deleteHandle(record.uuid);
|
|
21821
|
+
}].concat(_toConsumableArray(newTableHeader.map(function (t) {
|
|
21822
|
+
return _objectSpread2(_objectSpread2({}, t), {}, {
|
|
21823
|
+
dataIndex: t === null || t === void 0 ? void 0 : t.dataIndex,
|
|
21824
|
+
title: /*#__PURE__*/React__default['default'].createElement("span", null, t.isRequired ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
21825
|
+
style: {
|
|
21826
|
+
color: 'red'
|
|
21827
|
+
}
|
|
21828
|
+
}, "*") : null, (t === null || t === void 0 ? void 0 : t.settingName) || t.title),
|
|
21829
|
+
ellipsis: true,
|
|
21830
|
+
width: Number(t.width),
|
|
21831
|
+
render: function render(val, record, index) {
|
|
21832
|
+
// const column = orderSubformColumnMap[t.dataIndex];
|
|
21833
|
+
var isDisabled = t.isEdit || disabled;
|
|
21834
|
+
return renderEditItem$1({
|
|
21835
|
+
item: t || {},
|
|
21836
|
+
val: val,
|
|
21837
|
+
disabled: isDisabled,
|
|
21838
|
+
index: index,
|
|
21839
|
+
type: t === null || t === void 0 ? void 0 : t.dataIndex,
|
|
21840
|
+
updateHandle: updateHandle
|
|
21841
|
+
});
|
|
21857
21842
|
}
|
|
21858
|
-
})
|
|
21859
|
-
}
|
|
21860
|
-
|
|
21861
|
-
|
|
21843
|
+
});
|
|
21844
|
+
})), [disabled ? {} : {
|
|
21845
|
+
dataIndex: 'operation',
|
|
21846
|
+
title: '操作',
|
|
21847
|
+
width: 70,
|
|
21848
|
+
fixed: 'right',
|
|
21849
|
+
render: function render(val, record, index) {
|
|
21850
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Space, null, manual && /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
21851
|
+
title: "\u6DFB\u52A0"
|
|
21852
|
+
}, /*#__PURE__*/React__default['default'].createElement(icons.PlusCircleFilled, {
|
|
21853
|
+
style: {
|
|
21854
|
+
fontSize: 18,
|
|
21855
|
+
color: '#1890ff'
|
|
21856
|
+
},
|
|
21857
|
+
onClick: function onClick() {
|
|
21858
|
+
return addHandle(index + 1);
|
|
21859
|
+
}
|
|
21860
|
+
})), /*#__PURE__*/React__default['default'].createElement(antd.Tooltip, {
|
|
21861
|
+
title: "\u5220\u9664"
|
|
21862
|
+
}, /*#__PURE__*/React__default['default'].createElement(icons.MinusCircleFilled, {
|
|
21863
|
+
style: {
|
|
21864
|
+
fontSize: 18
|
|
21865
|
+
},
|
|
21866
|
+
onClick: function onClick() {
|
|
21867
|
+
return deleteHandle(record.uuid);
|
|
21868
|
+
}
|
|
21869
|
+
})));
|
|
21870
|
+
}
|
|
21871
|
+
}]);
|
|
21872
|
+
}, [newTableHeader, disabled, updateHandle]);
|
|
21862
21873
|
var orderModalColumns = React.useMemo(function () {
|
|
21863
21874
|
return [{
|
|
21864
21875
|
dataIndex: '',
|
|
@@ -21889,37 +21900,37 @@ var OrderSubForm = function OrderSubForm(props) {
|
|
|
21889
21900
|
}, {});
|
|
21890
21901
|
}, [newTableHeader]);
|
|
21891
21902
|
var deleteHandle = function deleteHandle(uuid) {
|
|
21892
|
-
var
|
|
21893
|
-
var newList =
|
|
21903
|
+
var _valueRef$current3, _valueRef$current3$su;
|
|
21904
|
+
var newList = (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : (_valueRef$current3$su = _valueRef$current3.subOrderList) === null || _valueRef$current3$su === void 0 ? void 0 : _valueRef$current3$su.filter(function (item) {
|
|
21894
21905
|
return item.uuid !== uuid;
|
|
21895
21906
|
});
|
|
21896
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(
|
|
21907
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
21908
|
+
subOrderList: newList
|
|
21909
|
+
}));
|
|
21897
21910
|
};
|
|
21898
21911
|
var addHandle = function addHandle(index) {
|
|
21899
|
-
var
|
|
21900
|
-
if (maxCount && (
|
|
21912
|
+
var _valueRef$current4, _valueRef$current4$su, _valueRef$current5;
|
|
21913
|
+
if (maxCount && ((_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : (_valueRef$current4$su = _valueRef$current4.subOrderList) === null || _valueRef$current4$su === void 0 ? void 0 : _valueRef$current4$su.length) >= maxCount) {
|
|
21901
21914
|
antd.message.error("\u8BE5\u5B50\u8868\u5355\u6700\u591A\u6DFB\u52A0".concat(maxCount, "\u6761"));
|
|
21902
21915
|
return;
|
|
21903
21916
|
}
|
|
21904
|
-
var subOrderList = _toConsumableArray((
|
|
21917
|
+
var subOrderList = _toConsumableArray(((_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5.subOrderList) || []);
|
|
21905
21918
|
subOrderList.splice(index, 0, _objectSpread2(_objectSpread2({}, defaultValueMap), {}, {
|
|
21906
21919
|
uuid: kmkfUtils.uuid()
|
|
21907
21920
|
}));
|
|
21908
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({},
|
|
21921
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, valueRef.current), {}, {
|
|
21909
21922
|
subOrderList: subOrderList
|
|
21910
21923
|
}));
|
|
21911
21924
|
};
|
|
21912
21925
|
var getDataSourceAsync = function getDataSourceAsync() {
|
|
21913
|
-
var _effects$form;
|
|
21914
|
-
console.log('22222');
|
|
21926
|
+
var _effects$form, _valueRef$current6, _valueRef$current7;
|
|
21915
21927
|
var _ref = (effects === null || effects === void 0 ? void 0 : (_effects$form = effects.form) === null || _effects$form === void 0 ? void 0 : _effects$form.getFieldsValue()) || {},
|
|
21916
21928
|
_ref$shopId = _ref.shopId,
|
|
21917
21929
|
shopId = _ref$shopId === void 0 ? '' : _ref$shopId;
|
|
21918
|
-
return (
|
|
21919
|
-
orderNo:
|
|
21930
|
+
return ((_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.orderNo) && shopId ? getOrderListSingleton$4({
|
|
21931
|
+
orderNo: (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.orderNo,
|
|
21920
21932
|
shopId: shopId
|
|
21921
21933
|
}).then(function (data) {
|
|
21922
|
-
console.log('333');
|
|
21923
21934
|
// const list = processAllOrders({
|
|
21924
21935
|
// data,
|
|
21925
21936
|
// orderNo: value?.orderNo,
|
|
@@ -21929,16 +21940,17 @@ var OrderSubForm = function OrderSubForm(props) {
|
|
|
21929
21940
|
}) : Promise.resolve();
|
|
21930
21941
|
};
|
|
21931
21942
|
var getAllTradeGoodsDetails = function getAllTradeGoodsDetails() {
|
|
21932
|
-
var
|
|
21943
|
+
var _valueRef$current8;
|
|
21944
|
+
var goodDetails = ((_valueRef$current8 = valueRef.current) === null || _valueRef$current8 === void 0 ? void 0 : _valueRef$current8.allOrders) || [];
|
|
21933
21945
|
return goodDetails;
|
|
21934
21946
|
};
|
|
21935
21947
|
var selectedGoodsChange = React.useCallback(function (skuList) {
|
|
21936
|
-
var _uniqBy;
|
|
21937
|
-
var newValue = _objectSpread2({},
|
|
21948
|
+
var _valueRef$current9, _uniqBy;
|
|
21949
|
+
var newValue = _objectSpread2({}, valueRef.current);
|
|
21938
21950
|
// 原订单商品
|
|
21939
21951
|
var originTradeGoodList = getAllTradeGoodsDetails() || [];
|
|
21940
21952
|
// 当前选中的所有商品【包含了原订单+商品库】
|
|
21941
|
-
var currentSelectGoodList = (
|
|
21953
|
+
var currentSelectGoodList = ((_valueRef$current9 = valueRef.current) === null || _valueRef$current9 === void 0 ? void 0 : _valueRef$current9.subOrderList) || [];
|
|
21942
21954
|
newValue['subOrderList'] = (_uniqBy = lodash.uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
|
|
21943
21955
|
return skuList.includes(item.uuid);
|
|
21944
21956
|
});
|
|
@@ -21946,8 +21958,8 @@ var OrderSubForm = function OrderSubForm(props) {
|
|
|
21946
21958
|
}, [value === null || value === void 0 ? void 0 : value.subOrderList]);
|
|
21947
21959
|
// TODO: 商品订单中以选中商品
|
|
21948
21960
|
var selectedGoods = React.useMemo(function () {
|
|
21949
|
-
var
|
|
21950
|
-
return
|
|
21961
|
+
var _valueRef$current10, _valueRef$current10$s;
|
|
21962
|
+
return (_valueRef$current10 = valueRef.current) === null || _valueRef$current10 === void 0 ? void 0 : (_valueRef$current10$s = _valueRef$current10.subOrderList) === null || _valueRef$current10$s === void 0 ? void 0 : _valueRef$current10$s.map(function (v) {
|
|
21951
21963
|
return v === null || v === void 0 ? void 0 : v.uuid;
|
|
21952
21964
|
});
|
|
21953
21965
|
}, [value === null || value === void 0 ? void 0 : value.subOrderList]);
|
|
@@ -21965,7 +21977,7 @@ var OrderSubForm = function OrderSubForm(props) {
|
|
|
21965
21977
|
width: 850
|
|
21966
21978
|
})), /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
21967
21979
|
columns: column,
|
|
21968
|
-
dataSource: value === null || value === void 0 ? void 0 : value.subOrderList,
|
|
21980
|
+
dataSource: (value === null || value === void 0 ? void 0 : value.subOrderList) || [],
|
|
21969
21981
|
rowKey: 'uuid',
|
|
21970
21982
|
size: "small",
|
|
21971
21983
|
pagination: false,
|