@kmkf-fe-packages/basic-components 1.22.1-beta.1 → 1.22.1-beta.11
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 +310 -19
- package/dist/index.js +309 -18
- package/dist/src/bs/component/GoodItem/wdtReissueGoodsColumns.d.ts +21 -0
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -4,7 +4,7 @@ import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } fro
|
|
|
4
4
|
import request, { extend as extend$1 } from 'umi-request';
|
|
5
5
|
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|
6
6
|
import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, uuid, LogisticsAddressData, SendDataCenter, BS_E3_BOOLEAN_STATUS_MAP, filterWdtOrders, WDT_ORDER_TYPE_MAP, filterBsE3Orders, filterKmOrders, KM_SYSTEM_ORDER_CONFIG, BS_E3_ORDER_STATUS_MAP, updateWdtGoodsHandle, updateBsE3GoodsHandle } from '@kmkf-fe-packages/kmkf-utils';
|
|
7
|
-
import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty } from 'lodash';
|
|
7
|
+
import { debounce, isNaN as isNaN$1, isNumber as isNumber$1, cloneDeep, difference, differenceWith, takeRight, reject, isEmpty, intersection } from 'lodash';
|
|
8
8
|
import { useUpdateEffect, useDebounceEffect, useAntdTable } from 'ahooks';
|
|
9
9
|
import zhCN from 'antd/lib/locale/zh_CN';
|
|
10
10
|
import pubsub from 'pubsub-js';
|
|
@@ -12576,6 +12576,104 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
|
|
|
12576
12576
|
});
|
|
12577
12577
|
};
|
|
12578
12578
|
|
|
12579
|
+
var columns$4 = [{
|
|
12580
|
+
dataIndex: 'goodId',
|
|
12581
|
+
title: "\u5546\u54C1ID",
|
|
12582
|
+
width: 70
|
|
12583
|
+
}, {
|
|
12584
|
+
dataIndex: 'goodNo',
|
|
12585
|
+
title: "\u5546\u54C1\u7F16\u7801",
|
|
12586
|
+
width: 180
|
|
12587
|
+
}, {
|
|
12588
|
+
dataIndex: 'goodName',
|
|
12589
|
+
title: "\u5546\u54C1\u540D\u79F0",
|
|
12590
|
+
width: 250
|
|
12591
|
+
}, {
|
|
12592
|
+
dataIndex: 'specId',
|
|
12593
|
+
title: "SKUID",
|
|
12594
|
+
width: 100
|
|
12595
|
+
}, {
|
|
12596
|
+
dataIndex: 'specNo',
|
|
12597
|
+
title: "\u5546\u54C1SKU\u7F16\u7801",
|
|
12598
|
+
width: 180
|
|
12599
|
+
}, {
|
|
12600
|
+
dataIndex: 'specName',
|
|
12601
|
+
title: "\u5546\u54C1SKU\u540D\u79F0",
|
|
12602
|
+
width: 250
|
|
12603
|
+
}, {
|
|
12604
|
+
dataIndex: 'orderPrice',
|
|
12605
|
+
title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
|
|
12606
|
+
width: 100
|
|
12607
|
+
}, {
|
|
12608
|
+
dataIndex: 'num',
|
|
12609
|
+
title: "\u6570\u91CF",
|
|
12610
|
+
width: 100
|
|
12611
|
+
}, {
|
|
12612
|
+
dataIndex: 'sharePrice',
|
|
12613
|
+
title: "\u5206\u644A\u4EF7",
|
|
12614
|
+
width: 70
|
|
12615
|
+
}, {
|
|
12616
|
+
dataIndex: 'giftType',
|
|
12617
|
+
title: "\u8D60\u54C1\u65B9\u5F0F",
|
|
12618
|
+
width: 100
|
|
12619
|
+
}];
|
|
12620
|
+
var renderFieldMap$1 = {
|
|
12621
|
+
num: function num(_ref) {
|
|
12622
|
+
var disabled = _ref.disabled,
|
|
12623
|
+
updateHandle = _ref.updateHandle;
|
|
12624
|
+
return function (val, record, index) {
|
|
12625
|
+
return !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
12626
|
+
style: {
|
|
12627
|
+
width: 70
|
|
12628
|
+
},
|
|
12629
|
+
value: val,
|
|
12630
|
+
min: 1,
|
|
12631
|
+
precision: 0,
|
|
12632
|
+
onChange: function onChange(num) {
|
|
12633
|
+
return updateHandle(num, index, 'num');
|
|
12634
|
+
}
|
|
12635
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
12636
|
+
};
|
|
12637
|
+
},
|
|
12638
|
+
giftType: function giftType(_ref2) {
|
|
12639
|
+
var disabled = _ref2.disabled,
|
|
12640
|
+
updateHandle = _ref2.updateHandle;
|
|
12641
|
+
return function (val) {
|
|
12642
|
+
var giftTypeMap = {
|
|
12643
|
+
0: '非赠品',
|
|
12644
|
+
1: '自动赠送',
|
|
12645
|
+
2: '手工赠送',
|
|
12646
|
+
3: '回购自动送赠品',
|
|
12647
|
+
4: '前N有礼送赠品',
|
|
12648
|
+
6: '天猫优仓赠品',
|
|
12649
|
+
7: '淘宝CRM会员送赠'
|
|
12650
|
+
};
|
|
12651
|
+
return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
|
|
12652
|
+
};
|
|
12653
|
+
}
|
|
12654
|
+
};
|
|
12655
|
+
var getWdtReissueGoodColumns = function getWdtReissueGoodColumns(_ref3) {
|
|
12656
|
+
var disabled = _ref3.disabled,
|
|
12657
|
+
updateHandle = _ref3.updateHandle,
|
|
12658
|
+
operate = _ref3.operate;
|
|
12659
|
+
return columns$4.map(function (item) {
|
|
12660
|
+
var newItem = _objectSpread2({
|
|
12661
|
+
align: 'center',
|
|
12662
|
+
ellipsis: true
|
|
12663
|
+
}, item);
|
|
12664
|
+
if (operate && (renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex])) {
|
|
12665
|
+
return _objectSpread2(_objectSpread2({}, newItem), {}, {
|
|
12666
|
+
render: renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex]({
|
|
12667
|
+
disabled: disabled,
|
|
12668
|
+
updateHandle: updateHandle
|
|
12669
|
+
})
|
|
12670
|
+
});
|
|
12671
|
+
}
|
|
12672
|
+
return newItem;
|
|
12673
|
+
});
|
|
12674
|
+
};
|
|
12675
|
+
|
|
12676
|
+
var MAIN_FIELD = 'id';
|
|
12579
12677
|
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
12580
12678
|
var columns = _ref.columns,
|
|
12581
12679
|
dataSource = _ref.dataSource,
|
|
@@ -12591,11 +12689,20 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
12591
12689
|
var closeModal = function closeModal() {
|
|
12592
12690
|
return setTradeGoodsVisible(false);
|
|
12593
12691
|
};
|
|
12692
|
+
var currentTradeOriginGoods = intersection(dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
12693
|
+
return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
|
|
12694
|
+
}), selectedRowKeys);
|
|
12695
|
+
var unCurrentTradeOriginGoods = difference(selectedRowKeys, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
12696
|
+
return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
|
|
12697
|
+
}));
|
|
12698
|
+
var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
|
|
12699
|
+
console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
|
|
12700
|
+
onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
|
|
12701
|
+
};
|
|
12594
12702
|
var rowSelection = {
|
|
12595
12703
|
selectedRowKeys: selectedRowKeys,
|
|
12596
|
-
onChange:
|
|
12704
|
+
onChange: handleChangeSelectedKeys
|
|
12597
12705
|
};
|
|
12598
|
-
console.debug('选择订单商品-dataSource', dataSource, selectedRowKeys);
|
|
12599
12706
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
12600
12707
|
type: "link",
|
|
12601
12708
|
onClick: openModal
|
|
@@ -12605,7 +12712,7 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
12605
12712
|
footer: null,
|
|
12606
12713
|
onCancel: closeModal
|
|
12607
12714
|
}, /*#__PURE__*/React.createElement(Table, {
|
|
12608
|
-
rowKey:
|
|
12715
|
+
rowKey: MAIN_FIELD,
|
|
12609
12716
|
rowSelection: rowSelection,
|
|
12610
12717
|
columns: columns,
|
|
12611
12718
|
dataSource: dataSource,
|
|
@@ -12614,7 +12721,17 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
12614
12721
|
x: 500,
|
|
12615
12722
|
y: 500
|
|
12616
12723
|
}
|
|
12617
|
-
}), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(",
|
|
12724
|
+
}), /*#__PURE__*/React.createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/", dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, ")")));
|
|
12725
|
+
};
|
|
12726
|
+
var getButtonText = function getButtonText() {
|
|
12727
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12728
|
+
if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
12729
|
+
return '选择百胜ERP商品';
|
|
12730
|
+
}
|
|
12731
|
+
if (['WDT_REISSUE_GOODS'].includes(type)) {
|
|
12732
|
+
return '选择旺店通商品';
|
|
12733
|
+
}
|
|
12734
|
+
return '选择商品';
|
|
12618
12735
|
};
|
|
12619
12736
|
var GoodItem$1 = function GoodItem(props) {
|
|
12620
12737
|
var _props$value = props.value,
|
|
@@ -12671,7 +12788,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12671
12788
|
// TODO: 商品订单中以选中商品
|
|
12672
12789
|
var selectedGoods = useMemo(function () {
|
|
12673
12790
|
return value === null || value === void 0 ? void 0 : value.map(function (v) {
|
|
12674
|
-
return v
|
|
12791
|
+
return v === null || v === void 0 ? void 0 : v[MAIN_FIELD];
|
|
12675
12792
|
});
|
|
12676
12793
|
}, [value]);
|
|
12677
12794
|
var updateHandle = function updateHandle(val, index, columnType) {
|
|
@@ -12712,6 +12829,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12712
12829
|
var columns = [];
|
|
12713
12830
|
switch (type) {
|
|
12714
12831
|
case 'WDT_REISSUE_GOODS':
|
|
12832
|
+
{
|
|
12833
|
+
columns = getWdtReissueGoodColumns({
|
|
12834
|
+
disabled: disabled,
|
|
12835
|
+
updateHandle: updateHandle,
|
|
12836
|
+
operate: operate
|
|
12837
|
+
});
|
|
12838
|
+
}
|
|
12839
|
+
break;
|
|
12715
12840
|
case 'WDT_GOODS':
|
|
12716
12841
|
columns = [{
|
|
12717
12842
|
dataIndex: 'goodId',
|
|
@@ -13147,13 +13272,39 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13147
13272
|
title: "\u5546\u54C1\u6570\u91CF",
|
|
13148
13273
|
align: 'center',
|
|
13149
13274
|
ellipsis: true,
|
|
13150
|
-
width: 100
|
|
13275
|
+
width: 100,
|
|
13276
|
+
render: function render(val, record, index) {
|
|
13277
|
+
return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
13278
|
+
style: {
|
|
13279
|
+
width: 70
|
|
13280
|
+
},
|
|
13281
|
+
value: val,
|
|
13282
|
+
min: 1,
|
|
13283
|
+
precision: 0,
|
|
13284
|
+
onChange: function onChange(num) {
|
|
13285
|
+
return updateHandle(num, index, 'goodsNumber');
|
|
13286
|
+
}
|
|
13287
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
13288
|
+
}
|
|
13151
13289
|
}, {
|
|
13152
13290
|
dataIndex: 'goodsPrice',
|
|
13153
13291
|
title: "\u5546\u54C1\u5355\u4EF7",
|
|
13154
13292
|
align: 'center',
|
|
13155
13293
|
ellipsis: true,
|
|
13156
|
-
width: 120
|
|
13294
|
+
width: 120,
|
|
13295
|
+
render: function render(val, record, index) {
|
|
13296
|
+
return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
13297
|
+
style: {
|
|
13298
|
+
width: 70
|
|
13299
|
+
},
|
|
13300
|
+
value: val,
|
|
13301
|
+
min: 0,
|
|
13302
|
+
precision: 2,
|
|
13303
|
+
onChange: function onChange(num) {
|
|
13304
|
+
return updateHandle(num, index, 'goodsPrice');
|
|
13305
|
+
}
|
|
13306
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
13307
|
+
}
|
|
13157
13308
|
}, {
|
|
13158
13309
|
dataIndex: 'shopPrice',
|
|
13159
13310
|
title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
|
|
@@ -13177,7 +13328,20 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13177
13328
|
title: "\u5B9E\u4ED8\u91D1\u989D",
|
|
13178
13329
|
align: 'center',
|
|
13179
13330
|
ellipsis: true,
|
|
13180
|
-
width: 120
|
|
13331
|
+
width: 120,
|
|
13332
|
+
render: function render(val, record, index) {
|
|
13333
|
+
return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
13334
|
+
style: {
|
|
13335
|
+
width: 70
|
|
13336
|
+
},
|
|
13337
|
+
value: val,
|
|
13338
|
+
min: 0,
|
|
13339
|
+
precision: 2,
|
|
13340
|
+
onChange: function onChange(num) {
|
|
13341
|
+
return updateHandle(num, index, 'payment');
|
|
13342
|
+
}
|
|
13343
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
13344
|
+
}
|
|
13181
13345
|
}, {
|
|
13182
13346
|
dataIndex: 'tcSku',
|
|
13183
13347
|
title: "\u5957\u9910SKU",
|
|
@@ -13217,6 +13381,116 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13217
13381
|
});
|
|
13218
13382
|
}
|
|
13219
13383
|
break;
|
|
13384
|
+
case 'BS_GOODS':
|
|
13385
|
+
columns = [{
|
|
13386
|
+
dataIndex: 'mark',
|
|
13387
|
+
title: "\u5546\u54C1\u6807\u8BB0",
|
|
13388
|
+
align: 'center',
|
|
13389
|
+
ellipsis: true,
|
|
13390
|
+
width: 70,
|
|
13391
|
+
render: function render(val, record, index) {
|
|
13392
|
+
return /*#__PURE__*/React.createElement(Select, {
|
|
13393
|
+
options: [{
|
|
13394
|
+
label: '是',
|
|
13395
|
+
value: '是'
|
|
13396
|
+
}, {
|
|
13397
|
+
label: '否',
|
|
13398
|
+
value: '否'
|
|
13399
|
+
}],
|
|
13400
|
+
disabled: disabled,
|
|
13401
|
+
value: val,
|
|
13402
|
+
onChange: function onChange(val) {
|
|
13403
|
+
return updateHandle(val, index, 'mark');
|
|
13404
|
+
}
|
|
13405
|
+
});
|
|
13406
|
+
}
|
|
13407
|
+
}, {
|
|
13408
|
+
dataIndex: 'skuName',
|
|
13409
|
+
title: "".concat(text, "sku\u540D\u79F0"),
|
|
13410
|
+
align: 'center',
|
|
13411
|
+
ellipsis: true,
|
|
13412
|
+
width: 250
|
|
13413
|
+
}, {
|
|
13414
|
+
dataIndex: 'sku',
|
|
13415
|
+
title: "".concat(text, "sku\u7F16\u7801"),
|
|
13416
|
+
align: 'center',
|
|
13417
|
+
ellipsis: true,
|
|
13418
|
+
width: 100
|
|
13419
|
+
}, {
|
|
13420
|
+
dataIndex: 'name',
|
|
13421
|
+
title: "".concat(text, "\u540D\u79F0"),
|
|
13422
|
+
align: 'center',
|
|
13423
|
+
ellipsis: true,
|
|
13424
|
+
width: 250
|
|
13425
|
+
}, {
|
|
13426
|
+
dataIndex: 'pic',
|
|
13427
|
+
title: "\u56FE\u7247",
|
|
13428
|
+
align: 'center',
|
|
13429
|
+
ellipsis: true,
|
|
13430
|
+
width: 100,
|
|
13431
|
+
render: function render(val) {
|
|
13432
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
13433
|
+
width: 60,
|
|
13434
|
+
src: val
|
|
13435
|
+
});
|
|
13436
|
+
}
|
|
13437
|
+
}, {
|
|
13438
|
+
dataIndex: 'code',
|
|
13439
|
+
title: "".concat(text, "\u7F16\u7801"),
|
|
13440
|
+
align: 'center',
|
|
13441
|
+
ellipsis: true,
|
|
13442
|
+
width: 100
|
|
13443
|
+
}, {
|
|
13444
|
+
dataIndex: 'money',
|
|
13445
|
+
title: "\u5B9E\u4ED8\u91D1\u989D",
|
|
13446
|
+
align: 'center',
|
|
13447
|
+
ellipsis: true,
|
|
13448
|
+
width: 100
|
|
13449
|
+
}, {
|
|
13450
|
+
dataIndex: 'number',
|
|
13451
|
+
title: "".concat(text, "\u6570\u91CF"),
|
|
13452
|
+
align: 'center',
|
|
13453
|
+
ellipsis: true,
|
|
13454
|
+
width: 100,
|
|
13455
|
+
render: function render(val, record, index) {
|
|
13456
|
+
return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
|
|
13457
|
+
style: {
|
|
13458
|
+
width: 70
|
|
13459
|
+
},
|
|
13460
|
+
value: val,
|
|
13461
|
+
min: 1,
|
|
13462
|
+
precision: 0,
|
|
13463
|
+
onChange: function onChange(num) {
|
|
13464
|
+
return updateHandle(num, index, 'number');
|
|
13465
|
+
}
|
|
13466
|
+
}) : /*#__PURE__*/React.createElement("span", null, val);
|
|
13467
|
+
}
|
|
13468
|
+
}, {
|
|
13469
|
+
dataIndex: 'share',
|
|
13470
|
+
title: "\u5206\u644A\u4EF7",
|
|
13471
|
+
align: 'center',
|
|
13472
|
+
ellipsis: true,
|
|
13473
|
+
width: 70
|
|
13474
|
+
}, {
|
|
13475
|
+
dataIndex: 'type',
|
|
13476
|
+
title: "\u8D60\u54C1\u7C7B\u578B",
|
|
13477
|
+
align: 'center',
|
|
13478
|
+
ellipsis: true,
|
|
13479
|
+
width: 100
|
|
13480
|
+
}, {
|
|
13481
|
+
dataIndex: 'batch',
|
|
13482
|
+
title: "\u6279\u6B21\u53F7",
|
|
13483
|
+
align: 'center',
|
|
13484
|
+
ellipsis: true,
|
|
13485
|
+
width: 100
|
|
13486
|
+
}, {
|
|
13487
|
+
dataIndex: 'expireDate',
|
|
13488
|
+
title: "\u6709\u6548\u671F",
|
|
13489
|
+
align: 'center',
|
|
13490
|
+
ellipsis: true,
|
|
13491
|
+
width: 100
|
|
13492
|
+
}];
|
|
13493
|
+
break;
|
|
13220
13494
|
default:
|
|
13221
13495
|
columns = [{
|
|
13222
13496
|
dataIndex: 'mark',
|
|
@@ -13370,6 +13644,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13370
13644
|
}].concat(_toConsumableArray(columns));
|
|
13371
13645
|
}, []);
|
|
13372
13646
|
var onSubmit = function onSubmit(list) {
|
|
13647
|
+
console.log('🚀 ~ onSubmit ~ list:', list);
|
|
13373
13648
|
var newList = [];
|
|
13374
13649
|
if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
|
|
13375
13650
|
newList = list.map(function (item) {
|
|
@@ -13414,6 +13689,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13414
13689
|
isGift: '',
|
|
13415
13690
|
uuid: uuid(),
|
|
13416
13691
|
canDelete: true,
|
|
13692
|
+
canEdit: true,
|
|
13417
13693
|
goodsNumber: 1,
|
|
13418
13694
|
canUpdateNumber: canUpdateNumber
|
|
13419
13695
|
});
|
|
@@ -13485,7 +13761,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13485
13761
|
}), /*#__PURE__*/React.createElement(Button, {
|
|
13486
13762
|
type: "link",
|
|
13487
13763
|
onClick: handleChangeGoods
|
|
13488
|
-
},
|
|
13764
|
+
}, getButtonText(type)), otherOperations), /*#__PURE__*/React.createElement(Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
|
|
13489
13765
|
columns: newColumns,
|
|
13490
13766
|
dataSource: value,
|
|
13491
13767
|
rowKey: 'uuid',
|
|
@@ -15164,7 +15440,7 @@ var typeMap$1 = {
|
|
|
15164
15440
|
}
|
|
15165
15441
|
};
|
|
15166
15442
|
var wdtReissue = function wdtReissue(props) {
|
|
15167
|
-
var _value$wdtSystemOrder, _typeMap$
|
|
15443
|
+
var _value$wdtSystemOrder, _typeMap$type25, _typeMap$type27, _typeMap$type28, _value$typeMap$type$s5, _typeMap$type29, _typeMap$type30, _typeMap$type31;
|
|
15168
15444
|
var value = props.value,
|
|
15169
15445
|
onChange = props.onChange,
|
|
15170
15446
|
_props$reasonList = props.reasonList,
|
|
@@ -15324,11 +15600,20 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15324
15600
|
}
|
|
15325
15601
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
15326
15602
|
};
|
|
15603
|
+
var selectedGoodsChange = useCallback(function (skuList) {
|
|
15604
|
+
var _typeMap$type23, _value, _typeMap$type24;
|
|
15605
|
+
var newValue = _objectSpread2({}, value);
|
|
15606
|
+
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.key)] = value === null || value === void 0 ? void 0 : (_value = value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)]) === null || _value === void 0 ? void 0 : _value.filter(function (item) {
|
|
15607
|
+
return skuList.includes(item.id);
|
|
15608
|
+
});
|
|
15609
|
+
console.log('newValue', newValue);
|
|
15610
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
15611
|
+
}, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.key)]]);
|
|
15327
15612
|
//显示选择商品按钮 原单换不显示选择商品
|
|
15328
15613
|
var showChangeBtn = useMemo(function () {
|
|
15329
|
-
var _typeMap$
|
|
15330
|
-
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$
|
|
15331
|
-
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$
|
|
15614
|
+
var _typeMap$type26;
|
|
15615
|
+
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrderNo]);
|
|
15616
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]]);
|
|
15332
15617
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
|
|
15333
15618
|
gutter: 8,
|
|
15334
15619
|
wrap: true
|
|
@@ -15346,12 +15631,12 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15346
15631
|
},
|
|
15347
15632
|
disabled: disabled,
|
|
15348
15633
|
allowClear: false,
|
|
15349
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15634
|
+
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.systemOrderNo)],
|
|
15350
15635
|
onChange: function onChange(val) {
|
|
15351
15636
|
return changeSystemOrderHandle(val);
|
|
15352
15637
|
},
|
|
15353
15638
|
placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
|
|
15354
|
-
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$
|
|
15639
|
+
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
|
|
15355
15640
|
return /*#__PURE__*/React.createElement(Select.Option, {
|
|
15356
15641
|
key: item.billNo,
|
|
15357
15642
|
value: item.billNo,
|
|
@@ -15372,7 +15657,7 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15372
15657
|
disabled: disabled,
|
|
15373
15658
|
allowClear: false,
|
|
15374
15659
|
options: reasonList,
|
|
15375
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15660
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type30 = typeMap$1[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.typeName)],
|
|
15376
15661
|
onChange: function onChange(val) {
|
|
15377
15662
|
return changeTypeHandle(val);
|
|
15378
15663
|
}
|
|
@@ -15384,13 +15669,19 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15384
15669
|
canUpdateNumber: showChangeBtn,
|
|
15385
15670
|
showChangeBtn: showChangeBtn,
|
|
15386
15671
|
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
15387
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15672
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type31 = typeMap$1[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.key)],
|
|
15388
15673
|
onChange: function onChange(val) {
|
|
15389
15674
|
return changeGoodHandle(val);
|
|
15390
15675
|
},
|
|
15391
15676
|
onModeChange: handleModeChange,
|
|
15392
15677
|
showModeBtn: showModeBtn,
|
|
15393
|
-
isStrict: isStrict
|
|
15678
|
+
isStrict: isStrict,
|
|
15679
|
+
tradeGoods: {
|
|
15680
|
+
originDataSource: getGoodDetails({
|
|
15681
|
+
mode: isStrict
|
|
15682
|
+
}),
|
|
15683
|
+
selectedGoodsChange: selectedGoodsChange
|
|
15684
|
+
}
|
|
15394
15685
|
})));
|
|
15395
15686
|
};
|
|
15396
15687
|
|
package/dist/index.js
CHANGED
|
@@ -12588,6 +12588,104 @@ var getBsE3ReissueGoodColumns = function getBsE3ReissueGoodColumns(_ref4) {
|
|
|
12588
12588
|
});
|
|
12589
12589
|
};
|
|
12590
12590
|
|
|
12591
|
+
var columns$4 = [{
|
|
12592
|
+
dataIndex: 'goodId',
|
|
12593
|
+
title: "\u5546\u54C1ID",
|
|
12594
|
+
width: 70
|
|
12595
|
+
}, {
|
|
12596
|
+
dataIndex: 'goodNo',
|
|
12597
|
+
title: "\u5546\u54C1\u7F16\u7801",
|
|
12598
|
+
width: 180
|
|
12599
|
+
}, {
|
|
12600
|
+
dataIndex: 'goodName',
|
|
12601
|
+
title: "\u5546\u54C1\u540D\u79F0",
|
|
12602
|
+
width: 250
|
|
12603
|
+
}, {
|
|
12604
|
+
dataIndex: 'specId',
|
|
12605
|
+
title: "SKUID",
|
|
12606
|
+
width: 100
|
|
12607
|
+
}, {
|
|
12608
|
+
dataIndex: 'specNo',
|
|
12609
|
+
title: "\u5546\u54C1SKU\u7F16\u7801",
|
|
12610
|
+
width: 180
|
|
12611
|
+
}, {
|
|
12612
|
+
dataIndex: 'specName',
|
|
12613
|
+
title: "\u5546\u54C1SKU\u540D\u79F0",
|
|
12614
|
+
width: 250
|
|
12615
|
+
}, {
|
|
12616
|
+
dataIndex: 'orderPrice',
|
|
12617
|
+
title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
|
|
12618
|
+
width: 100
|
|
12619
|
+
}, {
|
|
12620
|
+
dataIndex: 'num',
|
|
12621
|
+
title: "\u6570\u91CF",
|
|
12622
|
+
width: 100
|
|
12623
|
+
}, {
|
|
12624
|
+
dataIndex: 'sharePrice',
|
|
12625
|
+
title: "\u5206\u644A\u4EF7",
|
|
12626
|
+
width: 70
|
|
12627
|
+
}, {
|
|
12628
|
+
dataIndex: 'giftType',
|
|
12629
|
+
title: "\u8D60\u54C1\u65B9\u5F0F",
|
|
12630
|
+
width: 100
|
|
12631
|
+
}];
|
|
12632
|
+
var renderFieldMap$1 = {
|
|
12633
|
+
num: function num(_ref) {
|
|
12634
|
+
var disabled = _ref.disabled,
|
|
12635
|
+
updateHandle = _ref.updateHandle;
|
|
12636
|
+
return function (val, record, index) {
|
|
12637
|
+
return !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
12638
|
+
style: {
|
|
12639
|
+
width: 70
|
|
12640
|
+
},
|
|
12641
|
+
value: val,
|
|
12642
|
+
min: 1,
|
|
12643
|
+
precision: 0,
|
|
12644
|
+
onChange: function onChange(num) {
|
|
12645
|
+
return updateHandle(num, index, 'num');
|
|
12646
|
+
}
|
|
12647
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
12648
|
+
};
|
|
12649
|
+
},
|
|
12650
|
+
giftType: function giftType(_ref2) {
|
|
12651
|
+
var disabled = _ref2.disabled,
|
|
12652
|
+
updateHandle = _ref2.updateHandle;
|
|
12653
|
+
return function (val) {
|
|
12654
|
+
var giftTypeMap = {
|
|
12655
|
+
0: '非赠品',
|
|
12656
|
+
1: '自动赠送',
|
|
12657
|
+
2: '手工赠送',
|
|
12658
|
+
3: '回购自动送赠品',
|
|
12659
|
+
4: '前N有礼送赠品',
|
|
12660
|
+
6: '天猫优仓赠品',
|
|
12661
|
+
7: '淘宝CRM会员送赠'
|
|
12662
|
+
};
|
|
12663
|
+
return /*#__PURE__*/React__default['default'].createElement("span", null, giftTypeMap[val]);
|
|
12664
|
+
};
|
|
12665
|
+
}
|
|
12666
|
+
};
|
|
12667
|
+
var getWdtReissueGoodColumns = function getWdtReissueGoodColumns(_ref3) {
|
|
12668
|
+
var disabled = _ref3.disabled,
|
|
12669
|
+
updateHandle = _ref3.updateHandle,
|
|
12670
|
+
operate = _ref3.operate;
|
|
12671
|
+
return columns$4.map(function (item) {
|
|
12672
|
+
var newItem = _objectSpread2({
|
|
12673
|
+
align: 'center',
|
|
12674
|
+
ellipsis: true
|
|
12675
|
+
}, item);
|
|
12676
|
+
if (operate && (renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex])) {
|
|
12677
|
+
return _objectSpread2(_objectSpread2({}, newItem), {}, {
|
|
12678
|
+
render: renderFieldMap$1 === null || renderFieldMap$1 === void 0 ? void 0 : renderFieldMap$1[item.dataIndex]({
|
|
12679
|
+
disabled: disabled,
|
|
12680
|
+
updateHandle: updateHandle
|
|
12681
|
+
})
|
|
12682
|
+
});
|
|
12683
|
+
}
|
|
12684
|
+
return newItem;
|
|
12685
|
+
});
|
|
12686
|
+
};
|
|
12687
|
+
|
|
12688
|
+
var MAIN_FIELD = 'id';
|
|
12591
12689
|
var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
12592
12690
|
var columns = _ref.columns,
|
|
12593
12691
|
dataSource = _ref.dataSource,
|
|
@@ -12603,11 +12701,20 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
12603
12701
|
var closeModal = function closeModal() {
|
|
12604
12702
|
return setTradeGoodsVisible(false);
|
|
12605
12703
|
};
|
|
12704
|
+
var currentTradeOriginGoods = lodash.intersection(dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
12705
|
+
return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
|
|
12706
|
+
}), selectedRowKeys);
|
|
12707
|
+
var unCurrentTradeOriginGoods = lodash.difference(selectedRowKeys, dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
|
|
12708
|
+
return item === null || item === void 0 ? void 0 : item[MAIN_FIELD];
|
|
12709
|
+
}));
|
|
12710
|
+
var handleChangeSelectedKeys = function handleChangeSelectedKeys(keys) {
|
|
12711
|
+
console.log('handleChangeSelectedKeys', keys, unCurrentTradeOriginGoods);
|
|
12712
|
+
onChangeSelectedKeys(keys.concat(unCurrentTradeOriginGoods));
|
|
12713
|
+
};
|
|
12606
12714
|
var rowSelection = {
|
|
12607
12715
|
selectedRowKeys: selectedRowKeys,
|
|
12608
|
-
onChange:
|
|
12716
|
+
onChange: handleChangeSelectedKeys
|
|
12609
12717
|
};
|
|
12610
|
-
console.debug('选择订单商品-dataSource', dataSource, selectedRowKeys);
|
|
12611
12718
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
12612
12719
|
type: "link",
|
|
12613
12720
|
onClick: openModal
|
|
@@ -12617,7 +12724,7 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
12617
12724
|
footer: null,
|
|
12618
12725
|
onCancel: closeModal
|
|
12619
12726
|
}, /*#__PURE__*/React__default['default'].createElement(antd.Table, {
|
|
12620
|
-
rowKey:
|
|
12727
|
+
rowKey: MAIN_FIELD,
|
|
12621
12728
|
rowSelection: rowSelection,
|
|
12622
12729
|
columns: columns,
|
|
12623
12730
|
dataSource: dataSource,
|
|
@@ -12626,7 +12733,17 @@ var SelectTradeGoods = function SelectTradeGoods(_ref) {
|
|
|
12626
12733
|
x: 500,
|
|
12627
12734
|
y: 500
|
|
12628
12735
|
}
|
|
12629
|
-
}), /*#__PURE__*/React__default['default'].createElement("span", null, "\u5DF2\u9009\u62E9(",
|
|
12736
|
+
}), /*#__PURE__*/React__default['default'].createElement("span", null, "\u5DF2\u9009\u62E9(", currentTradeOriginGoods === null || currentTradeOriginGoods === void 0 ? void 0 : currentTradeOriginGoods.length, "/", dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, ")")));
|
|
12737
|
+
};
|
|
12738
|
+
var getButtonText = function getButtonText() {
|
|
12739
|
+
var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12740
|
+
if (['BS_E3_GOODS', 'BS_E3_REISSUE_GOODS', 'BS_E3_EXCHANGE_GOODS'].includes(type)) {
|
|
12741
|
+
return '选择百胜ERP商品';
|
|
12742
|
+
}
|
|
12743
|
+
if (['WDT_REISSUE_GOODS'].includes(type)) {
|
|
12744
|
+
return '选择旺店通商品';
|
|
12745
|
+
}
|
|
12746
|
+
return '选择商品';
|
|
12630
12747
|
};
|
|
12631
12748
|
var GoodItem$1 = function GoodItem(props) {
|
|
12632
12749
|
var _props$value = props.value,
|
|
@@ -12683,7 +12800,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12683
12800
|
// TODO: 商品订单中以选中商品
|
|
12684
12801
|
var selectedGoods = React.useMemo(function () {
|
|
12685
12802
|
return value === null || value === void 0 ? void 0 : value.map(function (v) {
|
|
12686
|
-
return v
|
|
12803
|
+
return v === null || v === void 0 ? void 0 : v[MAIN_FIELD];
|
|
12687
12804
|
});
|
|
12688
12805
|
}, [value]);
|
|
12689
12806
|
var updateHandle = function updateHandle(val, index, columnType) {
|
|
@@ -12724,6 +12841,14 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
12724
12841
|
var columns = [];
|
|
12725
12842
|
switch (type) {
|
|
12726
12843
|
case 'WDT_REISSUE_GOODS':
|
|
12844
|
+
{
|
|
12845
|
+
columns = getWdtReissueGoodColumns({
|
|
12846
|
+
disabled: disabled,
|
|
12847
|
+
updateHandle: updateHandle,
|
|
12848
|
+
operate: operate
|
|
12849
|
+
});
|
|
12850
|
+
}
|
|
12851
|
+
break;
|
|
12727
12852
|
case 'WDT_GOODS':
|
|
12728
12853
|
columns = [{
|
|
12729
12854
|
dataIndex: 'goodId',
|
|
@@ -13159,13 +13284,39 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13159
13284
|
title: "\u5546\u54C1\u6570\u91CF",
|
|
13160
13285
|
align: 'center',
|
|
13161
13286
|
ellipsis: true,
|
|
13162
|
-
width: 100
|
|
13287
|
+
width: 100,
|
|
13288
|
+
render: function render(val, record, index) {
|
|
13289
|
+
return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
13290
|
+
style: {
|
|
13291
|
+
width: 70
|
|
13292
|
+
},
|
|
13293
|
+
value: val,
|
|
13294
|
+
min: 1,
|
|
13295
|
+
precision: 0,
|
|
13296
|
+
onChange: function onChange(num) {
|
|
13297
|
+
return updateHandle(num, index, 'goodsNumber');
|
|
13298
|
+
}
|
|
13299
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
13300
|
+
}
|
|
13163
13301
|
}, {
|
|
13164
13302
|
dataIndex: 'goodsPrice',
|
|
13165
13303
|
title: "\u5546\u54C1\u5355\u4EF7",
|
|
13166
13304
|
align: 'center',
|
|
13167
13305
|
ellipsis: true,
|
|
13168
|
-
width: 120
|
|
13306
|
+
width: 120,
|
|
13307
|
+
render: function render(val, record, index) {
|
|
13308
|
+
return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
13309
|
+
style: {
|
|
13310
|
+
width: 70
|
|
13311
|
+
},
|
|
13312
|
+
value: val,
|
|
13313
|
+
min: 0,
|
|
13314
|
+
precision: 2,
|
|
13315
|
+
onChange: function onChange(num) {
|
|
13316
|
+
return updateHandle(num, index, 'goodsPrice');
|
|
13317
|
+
}
|
|
13318
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
13319
|
+
}
|
|
13169
13320
|
}, {
|
|
13170
13321
|
dataIndex: 'shopPrice',
|
|
13171
13322
|
title: "\u5546\u54C1\u7F51\u5E97\u552E\u4EF7",
|
|
@@ -13189,7 +13340,20 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13189
13340
|
title: "\u5B9E\u4ED8\u91D1\u989D",
|
|
13190
13341
|
align: 'center',
|
|
13191
13342
|
ellipsis: true,
|
|
13192
|
-
width: 120
|
|
13343
|
+
width: 120,
|
|
13344
|
+
render: function render(val, record, index) {
|
|
13345
|
+
return record.canEdit && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
13346
|
+
style: {
|
|
13347
|
+
width: 70
|
|
13348
|
+
},
|
|
13349
|
+
value: val,
|
|
13350
|
+
min: 0,
|
|
13351
|
+
precision: 2,
|
|
13352
|
+
onChange: function onChange(num) {
|
|
13353
|
+
return updateHandle(num, index, 'payment');
|
|
13354
|
+
}
|
|
13355
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
13356
|
+
}
|
|
13193
13357
|
}, {
|
|
13194
13358
|
dataIndex: 'tcSku',
|
|
13195
13359
|
title: "\u5957\u9910SKU",
|
|
@@ -13229,6 +13393,116 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13229
13393
|
});
|
|
13230
13394
|
}
|
|
13231
13395
|
break;
|
|
13396
|
+
case 'BS_GOODS':
|
|
13397
|
+
columns = [{
|
|
13398
|
+
dataIndex: 'mark',
|
|
13399
|
+
title: "\u5546\u54C1\u6807\u8BB0",
|
|
13400
|
+
align: 'center',
|
|
13401
|
+
ellipsis: true,
|
|
13402
|
+
width: 70,
|
|
13403
|
+
render: function render(val, record, index) {
|
|
13404
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
|
|
13405
|
+
options: [{
|
|
13406
|
+
label: '是',
|
|
13407
|
+
value: '是'
|
|
13408
|
+
}, {
|
|
13409
|
+
label: '否',
|
|
13410
|
+
value: '否'
|
|
13411
|
+
}],
|
|
13412
|
+
disabled: disabled,
|
|
13413
|
+
value: val,
|
|
13414
|
+
onChange: function onChange(val) {
|
|
13415
|
+
return updateHandle(val, index, 'mark');
|
|
13416
|
+
}
|
|
13417
|
+
});
|
|
13418
|
+
}
|
|
13419
|
+
}, {
|
|
13420
|
+
dataIndex: 'skuName',
|
|
13421
|
+
title: "".concat(text, "sku\u540D\u79F0"),
|
|
13422
|
+
align: 'center',
|
|
13423
|
+
ellipsis: true,
|
|
13424
|
+
width: 250
|
|
13425
|
+
}, {
|
|
13426
|
+
dataIndex: 'sku',
|
|
13427
|
+
title: "".concat(text, "sku\u7F16\u7801"),
|
|
13428
|
+
align: 'center',
|
|
13429
|
+
ellipsis: true,
|
|
13430
|
+
width: 100
|
|
13431
|
+
}, {
|
|
13432
|
+
dataIndex: 'name',
|
|
13433
|
+
title: "".concat(text, "\u540D\u79F0"),
|
|
13434
|
+
align: 'center',
|
|
13435
|
+
ellipsis: true,
|
|
13436
|
+
width: 250
|
|
13437
|
+
}, {
|
|
13438
|
+
dataIndex: 'pic',
|
|
13439
|
+
title: "\u56FE\u7247",
|
|
13440
|
+
align: 'center',
|
|
13441
|
+
ellipsis: true,
|
|
13442
|
+
width: 100,
|
|
13443
|
+
render: function render(val) {
|
|
13444
|
+
return /*#__PURE__*/React__default['default'].createElement(antd.Image, {
|
|
13445
|
+
width: 60,
|
|
13446
|
+
src: val
|
|
13447
|
+
});
|
|
13448
|
+
}
|
|
13449
|
+
}, {
|
|
13450
|
+
dataIndex: 'code',
|
|
13451
|
+
title: "".concat(text, "\u7F16\u7801"),
|
|
13452
|
+
align: 'center',
|
|
13453
|
+
ellipsis: true,
|
|
13454
|
+
width: 100
|
|
13455
|
+
}, {
|
|
13456
|
+
dataIndex: 'money',
|
|
13457
|
+
title: "\u5B9E\u4ED8\u91D1\u989D",
|
|
13458
|
+
align: 'center',
|
|
13459
|
+
ellipsis: true,
|
|
13460
|
+
width: 100
|
|
13461
|
+
}, {
|
|
13462
|
+
dataIndex: 'number',
|
|
13463
|
+
title: "".concat(text, "\u6570\u91CF"),
|
|
13464
|
+
align: 'center',
|
|
13465
|
+
ellipsis: true,
|
|
13466
|
+
width: 100,
|
|
13467
|
+
render: function render(val, record, index) {
|
|
13468
|
+
return record.canUpdateNumber && !disabled ? /*#__PURE__*/React__default['default'].createElement(antd.InputNumber, {
|
|
13469
|
+
style: {
|
|
13470
|
+
width: 70
|
|
13471
|
+
},
|
|
13472
|
+
value: val,
|
|
13473
|
+
min: 1,
|
|
13474
|
+
precision: 0,
|
|
13475
|
+
onChange: function onChange(num) {
|
|
13476
|
+
return updateHandle(num, index, 'number');
|
|
13477
|
+
}
|
|
13478
|
+
}) : /*#__PURE__*/React__default['default'].createElement("span", null, val);
|
|
13479
|
+
}
|
|
13480
|
+
}, {
|
|
13481
|
+
dataIndex: 'share',
|
|
13482
|
+
title: "\u5206\u644A\u4EF7",
|
|
13483
|
+
align: 'center',
|
|
13484
|
+
ellipsis: true,
|
|
13485
|
+
width: 70
|
|
13486
|
+
}, {
|
|
13487
|
+
dataIndex: 'type',
|
|
13488
|
+
title: "\u8D60\u54C1\u7C7B\u578B",
|
|
13489
|
+
align: 'center',
|
|
13490
|
+
ellipsis: true,
|
|
13491
|
+
width: 100
|
|
13492
|
+
}, {
|
|
13493
|
+
dataIndex: 'batch',
|
|
13494
|
+
title: "\u6279\u6B21\u53F7",
|
|
13495
|
+
align: 'center',
|
|
13496
|
+
ellipsis: true,
|
|
13497
|
+
width: 100
|
|
13498
|
+
}, {
|
|
13499
|
+
dataIndex: 'expireDate',
|
|
13500
|
+
title: "\u6709\u6548\u671F",
|
|
13501
|
+
align: 'center',
|
|
13502
|
+
ellipsis: true,
|
|
13503
|
+
width: 100
|
|
13504
|
+
}];
|
|
13505
|
+
break;
|
|
13232
13506
|
default:
|
|
13233
13507
|
columns = [{
|
|
13234
13508
|
dataIndex: 'mark',
|
|
@@ -13382,6 +13656,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13382
13656
|
}].concat(_toConsumableArray(columns));
|
|
13383
13657
|
}, []);
|
|
13384
13658
|
var onSubmit = function onSubmit(list) {
|
|
13659
|
+
console.log('🚀 ~ onSubmit ~ list:', list);
|
|
13385
13660
|
var newList = [];
|
|
13386
13661
|
if (['WDT_REISSUE_GOODS', 'WDT_GOODS', 'WDT_EXCHANGE_GOODS'].includes(type)) {
|
|
13387
13662
|
newList = list.map(function (item) {
|
|
@@ -13426,6 +13701,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13426
13701
|
isGift: '',
|
|
13427
13702
|
uuid: kmkfUtils.uuid(),
|
|
13428
13703
|
canDelete: true,
|
|
13704
|
+
canEdit: true,
|
|
13429
13705
|
goodsNumber: 1,
|
|
13430
13706
|
canUpdateNumber: canUpdateNumber
|
|
13431
13707
|
});
|
|
@@ -13497,7 +13773,7 @@ var GoodItem$1 = function GoodItem(props) {
|
|
|
13497
13773
|
}), /*#__PURE__*/React__default['default'].createElement(antd.Button, {
|
|
13498
13774
|
type: "link",
|
|
13499
13775
|
onClick: handleChangeGoods
|
|
13500
|
-
},
|
|
13776
|
+
}, getButtonText(type)), otherOperations), /*#__PURE__*/React__default['default'].createElement(antd.Table, _objectSpread2(_objectSpread2({}, tableConfig), {}, {
|
|
13501
13777
|
columns: newColumns,
|
|
13502
13778
|
dataSource: value,
|
|
13503
13779
|
rowKey: 'uuid',
|
|
@@ -15176,7 +15452,7 @@ var typeMap$1 = {
|
|
|
15176
15452
|
}
|
|
15177
15453
|
};
|
|
15178
15454
|
var wdtReissue = function wdtReissue(props) {
|
|
15179
|
-
var _value$wdtSystemOrder, _typeMap$
|
|
15455
|
+
var _value$wdtSystemOrder, _typeMap$type25, _typeMap$type27, _typeMap$type28, _value$typeMap$type$s5, _typeMap$type29, _typeMap$type30, _typeMap$type31;
|
|
15180
15456
|
var value = props.value,
|
|
15181
15457
|
onChange = props.onChange,
|
|
15182
15458
|
_props$reasonList = props.reasonList,
|
|
@@ -15336,11 +15612,20 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15336
15612
|
}
|
|
15337
15613
|
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
15338
15614
|
};
|
|
15615
|
+
var selectedGoodsChange = React.useCallback(function (skuList) {
|
|
15616
|
+
var _typeMap$type23, _value, _typeMap$type24;
|
|
15617
|
+
var newValue = _objectSpread2({}, value);
|
|
15618
|
+
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.key)] = value === null || value === void 0 ? void 0 : (_value = value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type24 = typeMap$1[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.key)]) === null || _value === void 0 ? void 0 : _value.filter(function (item) {
|
|
15619
|
+
return skuList.includes(item.id);
|
|
15620
|
+
});
|
|
15621
|
+
console.log('newValue', newValue);
|
|
15622
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
|
|
15623
|
+
}, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type25 = typeMap$1[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.key)]]);
|
|
15339
15624
|
//显示选择商品按钮 原单换不显示选择商品
|
|
15340
15625
|
var showChangeBtn = React.useMemo(function () {
|
|
15341
|
-
var _typeMap$
|
|
15342
|
-
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$
|
|
15343
|
-
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$
|
|
15626
|
+
var _typeMap$type26;
|
|
15627
|
+
return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type26 = typeMap$1[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.systemOrderNo]);
|
|
15628
|
+
}, [value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$1[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]]);
|
|
15344
15629
|
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(antd.Row, {
|
|
15345
15630
|
gutter: 8,
|
|
15346
15631
|
wrap: true
|
|
@@ -15358,12 +15643,12 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15358
15643
|
},
|
|
15359
15644
|
disabled: disabled,
|
|
15360
15645
|
allowClear: false,
|
|
15361
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15646
|
+
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.systemOrderNo)],
|
|
15362
15647
|
onChange: function onChange(val) {
|
|
15363
15648
|
return changeSystemOrderHandle(val);
|
|
15364
15649
|
},
|
|
15365
15650
|
placeholder: "\u9009\u62E9\u8865\u53D1\u7CFB\u7EDF\u5355"
|
|
15366
|
-
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$
|
|
15651
|
+
}, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type29 = typeMap$1[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
|
|
15367
15652
|
return /*#__PURE__*/React__default['default'].createElement(antd.Select.Option, {
|
|
15368
15653
|
key: item.billNo,
|
|
15369
15654
|
value: item.billNo,
|
|
@@ -15384,7 +15669,7 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15384
15669
|
disabled: disabled,
|
|
15385
15670
|
allowClear: false,
|
|
15386
15671
|
options: reasonList,
|
|
15387
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15672
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type30 = typeMap$1[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.typeName)],
|
|
15388
15673
|
onChange: function onChange(val) {
|
|
15389
15674
|
return changeTypeHandle(val);
|
|
15390
15675
|
}
|
|
@@ -15396,13 +15681,19 @@ var wdtReissue = function wdtReissue(props) {
|
|
|
15396
15681
|
canUpdateNumber: showChangeBtn,
|
|
15397
15682
|
showChangeBtn: showChangeBtn,
|
|
15398
15683
|
shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
|
|
15399
|
-
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$
|
|
15684
|
+
value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$1 === null || typeMap$1 === void 0 ? void 0 : (_typeMap$type31 = typeMap$1[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.key)],
|
|
15400
15685
|
onChange: function onChange(val) {
|
|
15401
15686
|
return changeGoodHandle(val);
|
|
15402
15687
|
},
|
|
15403
15688
|
onModeChange: handleModeChange,
|
|
15404
15689
|
showModeBtn: showModeBtn,
|
|
15405
|
-
isStrict: isStrict
|
|
15690
|
+
isStrict: isStrict,
|
|
15691
|
+
tradeGoods: {
|
|
15692
|
+
originDataSource: getGoodDetails({
|
|
15693
|
+
mode: isStrict
|
|
15694
|
+
}),
|
|
15695
|
+
selectedGoodsChange: selectedGoodsChange
|
|
15696
|
+
}
|
|
15406
15697
|
})));
|
|
15407
15698
|
};
|
|
15408
15699
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type P = {
|
|
3
|
+
disabled: boolean | undefined;
|
|
4
|
+
updateHandle: (v: any, index: number, key: string) => void;
|
|
5
|
+
operate?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const getWdtReissueGoodColumns: ({ disabled, updateHandle, operate }: P) => ({
|
|
8
|
+
dataIndex: string;
|
|
9
|
+
title: string;
|
|
10
|
+
width: number;
|
|
11
|
+
align: string;
|
|
12
|
+
ellipsis: boolean;
|
|
13
|
+
} | {
|
|
14
|
+
render: (val: any, record: any, index: number) => React.JSX.Element;
|
|
15
|
+
dataIndex: string;
|
|
16
|
+
title: string;
|
|
17
|
+
width: number;
|
|
18
|
+
align: string;
|
|
19
|
+
ellipsis: boolean;
|
|
20
|
+
})[];
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/basic-components",
|
|
3
|
-
"version": "1.22.1-beta.
|
|
3
|
+
"version": "1.22.1-beta.11",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "ISC",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"watch": "nodemon --ignore dist/ --ignore node_modules/ --watch src/ -C -e ts,tsx,less --debug -x 'yarn async'"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.
|
|
23
|
+
"@kmkf-fe-packages/kmkf-utils": "1.22.1-beta.10",
|
|
24
24
|
"ahooks": "^3.7.4",
|
|
25
25
|
"bignumber.js": "^9.1.2",
|
|
26
26
|
"kmkf-monitor": "^0.8.9",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "6b9f366cb76af0cd000e4308e8da01d789b38981"
|
|
69
69
|
}
|