@kmkf-fe-packages/basic-components 0.7.15-alpha.73 → 0.7.15-alpha.76

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 CHANGED
@@ -9980,6 +9980,27 @@ var GoodItem = function GoodItem(props) {
9980
9980
  var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
9981
9981
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
9982
9982
  return [{
9983
+ dataIndex: 'mark',
9984
+ title: "\u5546\u54C1\u6807\u8BB0",
9985
+ align: 'center',
9986
+ ellipsis: true,
9987
+ width: 100,
9988
+ render: function render(val, record, index) {
9989
+ return /*#__PURE__*/React.createElement(Select, {
9990
+ options: [{
9991
+ label: '是',
9992
+ value: '是'
9993
+ }, {
9994
+ label: '否',
9995
+ value: '否'
9996
+ }],
9997
+ value: val,
9998
+ onChange: function onChange(val) {
9999
+ return updateHandle(val, index, 'mark');
10000
+ }
10001
+ });
10002
+ }
10003
+ }, {
9983
10004
  dataIndex: 'pic',
9984
10005
  title: "\u56FE\u7247",
9985
10006
  align: 'center',
@@ -10086,6 +10107,7 @@ var GoodItem = function GoodItem(props) {
10086
10107
  marketPrice = item.marketPrice;
10087
10108
  return {
10088
10109
  id: goodsId,
10110
+ mark: '是',
10089
10111
  pic: '',
10090
10112
  name: name,
10091
10113
  code: code,
@@ -10165,6 +10187,8 @@ var BsGoods = function BsGoods(props) {
10165
10187
  var valueRef = useRef(null);
10166
10188
  useEffect(function () {
10167
10189
  valueRef.current = value;
10190
+ }, [value]);
10191
+ useEffect(function () {
10168
10192
  pubsub.subscribe('type', function (type, data) {
10169
10193
  if (disabled) return;
10170
10194
  withInfo.current = {
@@ -10196,12 +10220,13 @@ var BsGoods = function BsGoods(props) {
10196
10220
  });
10197
10221
  }
10198
10222
  });
10199
- }, [disabled, value]);
10223
+ }, [disabled]);
10200
10224
  var _onSelect = function onSelect(list) {
10201
10225
  var _withInfo$current, _withInfo$current2;
10202
10226
  if (disabled) return;
10203
10227
  var newList = cloneDeep(list);
10204
10228
  var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10229
+ console.log('onSelect', type, withInfo.current);
10205
10230
  pubsub.publish(type, {
10206
10231
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10207
10232
  list: newList.map(function (item) {
@@ -10275,6 +10300,7 @@ var BsExchange = function BsExchange(props) {
10275
10300
  }, [value]);
10276
10301
  useEffect(function () {
10277
10302
  pubsub.subscribe('selectList', function (_, data) {
10303
+ console.log('selectList', data, valueRef.current);
10278
10304
  if (disabled) return;
10279
10305
  if (valueRef.current) {
10280
10306
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
@@ -10286,10 +10312,12 @@ var BsExchange = function BsExchange(props) {
10286
10312
  }, []);
10287
10313
  useEffect(function () {
10288
10314
  pubsub.subscribe('selectListReturn', function (_, data) {
10315
+ console.log('selectListReturn', data);
10289
10316
  if (disabled) return;
10317
+ var newValue = _objectSpread2({}, data.newValue);
10290
10318
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10291
10319
  onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10292
- bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10320
+ bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10293
10321
  }));
10294
10322
  });
10295
10323
  }, []);
@@ -10365,17 +10393,19 @@ var BsExchange = function BsExchange(props) {
10365
10393
  }
10366
10394
  newValue[key] = val;
10367
10395
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10368
- if (key === 'bsExchangeType') {
10369
- pubsub.publish('type', val[0]);
10370
- }
10371
10396
  };
10372
10397
  var changeReturnHandle = function changeReturnHandle(val, index, key) {
10373
10398
  var newValue = _objectSpread2({}, value);
10374
- newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t) {
10399
+ newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t, i) {
10375
10400
  t.index = index;
10376
10401
  if (key === 'bsExchangeGiftGoods') {
10377
10402
  t.money = 0;
10378
10403
  }
10404
+ //换出的分摊价等于退回的分摊价
10405
+ if (key === 'bsExchangeSwapOutGoods') {
10406
+ var _newValue$bsExchangeR, _newValue$bsExchangeR2, _newValue$bsExchangeR3, _newValue$bsExchangeR4;
10407
+ t.share = (_newValue$bsExchangeR = newValue.bsExchangeReturnGoods) === null || _newValue$bsExchangeR === void 0 ? void 0 : (_newValue$bsExchangeR2 = _newValue$bsExchangeR[index]) === null || _newValue$bsExchangeR2 === void 0 ? void 0 : (_newValue$bsExchangeR3 = _newValue$bsExchangeR2['bsExchangeReturnGoods']) === null || _newValue$bsExchangeR3 === void 0 ? void 0 : (_newValue$bsExchangeR4 = _newValue$bsExchangeR3[i]) === null || _newValue$bsExchangeR4 === void 0 ? void 0 : _newValue$bsExchangeR4.share;
10408
+ }
10379
10409
  return t;
10380
10410
  });
10381
10411
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -10474,6 +10504,7 @@ var BsReissue = function BsReissue(props) {
10474
10504
  var valueRef = useRef({});
10475
10505
  useEffect(function () {
10476
10506
  pubsub.subscribe('reissueSelectList', function (_, data) {
10507
+ console.log('reissueSelectList', valueRef.current);
10477
10508
  if (disabled) return;
10478
10509
  if (valueRef.current) {
10479
10510
  var newValue = _objectSpread2({}, valueRef.current);
@@ -10489,6 +10520,7 @@ var BsReissue = function BsReissue(props) {
10489
10520
  }, []);
10490
10521
  useEffect(function () {
10491
10522
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10523
+ console.log('reissueSelectListReturn', data);
10492
10524
  if (disabled) return;
10493
10525
  var newValue = _objectSpread2({}, data.newValue);
10494
10526
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10513,19 +10545,10 @@ var BsReissue = function BsReissue(props) {
10513
10545
  }
10514
10546
  });
10515
10547
  }, [value, disabled]);
10516
- var changeHandle = function changeHandle(val, key) {
10548
+ var changeTypeHandle = function changeTypeHandle(val) {
10517
10549
  var newValue = _objectSpread2({}, value);
10518
- if (key === 'bsReissueGoods') {
10519
- val = (val || []).map(function (item) {
10520
- item.money = 0;
10521
- item.share = 0;
10522
- return item;
10523
- });
10524
- }
10525
- newValue[key] = val;
10526
- if (key === 'bsReissueType') {
10527
- newValue.bsReissueGoods = [];
10528
- }
10550
+ newValue['bsReissueType'] = val;
10551
+ newValue.bsReissueGoods = [];
10529
10552
  if (['2', '4'].includes(val[0])) {
10530
10553
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10531
10554
  }
@@ -10534,6 +10557,15 @@ var BsReissue = function BsReissue(props) {
10534
10557
  newValue: newValue
10535
10558
  });
10536
10559
  };
10560
+ var changeGoodHandle = function changeGoodHandle(val) {
10561
+ var newValue = _objectSpread2({}, value);
10562
+ newValue['bsReissueGoods'] = (val || []).map(function (item) {
10563
+ item.money = 0;
10564
+ item.share = 0;
10565
+ return item;
10566
+ });
10567
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10568
+ };
10537
10569
  //显示选择商品按钮 原单换不显示选择商品
10538
10570
  var showChangeBtn = useMemo(function () {
10539
10571
  var _value$bsReissueType;
@@ -10548,7 +10580,7 @@ var BsReissue = function BsReissue(props) {
10548
10580
  options: reasonList,
10549
10581
  value: value === null || value === void 0 ? void 0 : value.bsReissueType,
10550
10582
  onChange: function onChange(val) {
10551
- return changeHandle(val, 'bsReissueType');
10583
+ return changeTypeHandle(val);
10552
10584
  }
10553
10585
  }), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
10554
10586
  key: 'reissueGoods'
@@ -10559,7 +10591,7 @@ var BsReissue = function BsReissue(props) {
10559
10591
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10560
10592
  value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
10561
10593
  onChange: function onChange(val) {
10562
- return changeHandle(val, 'bsReissueGoods');
10594
+ return changeGoodHandle(val);
10563
10595
  }
10564
10596
  })));
10565
10597
  };
package/dist/index.js CHANGED
@@ -9991,6 +9991,27 @@ var GoodItem = function GoodItem(props) {
9991
9991
  var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
9992
9992
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
9993
9993
  return [{
9994
+ dataIndex: 'mark',
9995
+ title: "\u5546\u54C1\u6807\u8BB0",
9996
+ align: 'center',
9997
+ ellipsis: true,
9998
+ width: 100,
9999
+ render: function render(val, record, index) {
10000
+ return /*#__PURE__*/React__default['default'].createElement(antd.Select, {
10001
+ options: [{
10002
+ label: '是',
10003
+ value: '是'
10004
+ }, {
10005
+ label: '否',
10006
+ value: '否'
10007
+ }],
10008
+ value: val,
10009
+ onChange: function onChange(val) {
10010
+ return updateHandle(val, index, 'mark');
10011
+ }
10012
+ });
10013
+ }
10014
+ }, {
9994
10015
  dataIndex: 'pic',
9995
10016
  title: "\u56FE\u7247",
9996
10017
  align: 'center',
@@ -10097,6 +10118,7 @@ var GoodItem = function GoodItem(props) {
10097
10118
  marketPrice = item.marketPrice;
10098
10119
  return {
10099
10120
  id: goodsId,
10121
+ mark: '是',
10100
10122
  pic: '',
10101
10123
  name: name,
10102
10124
  code: code,
@@ -10176,6 +10198,8 @@ var BsGoods = function BsGoods(props) {
10176
10198
  var valueRef = React.useRef(null);
10177
10199
  React.useEffect(function () {
10178
10200
  valueRef.current = value;
10201
+ }, [value]);
10202
+ React.useEffect(function () {
10179
10203
  pubsub__default['default'].subscribe('type', function (type, data) {
10180
10204
  if (disabled) return;
10181
10205
  withInfo.current = {
@@ -10207,12 +10231,13 @@ var BsGoods = function BsGoods(props) {
10207
10231
  });
10208
10232
  }
10209
10233
  });
10210
- }, [disabled, value]);
10234
+ }, [disabled]);
10211
10235
  var _onSelect = function onSelect(list) {
10212
10236
  var _withInfo$current, _withInfo$current2;
10213
10237
  if (disabled) return;
10214
10238
  var newList = lodash.cloneDeep(list);
10215
10239
  var type = ((_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type) === 'reissueType' ? 'reissueSelectList' : 'selectList';
10240
+ console.log('onSelect', type, withInfo.current);
10216
10241
  pubsub__default['default'].publish(type, {
10217
10242
  type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
10218
10243
  list: newList.map(function (item) {
@@ -10286,6 +10311,7 @@ var BsExchange = function BsExchange(props) {
10286
10311
  }, [value]);
10287
10312
  React.useEffect(function () {
10288
10313
  pubsub__default['default'].subscribe('selectList', function (_, data) {
10314
+ console.log('selectList', data, valueRef.current);
10289
10315
  if (disabled) return;
10290
10316
  if (valueRef.current) {
10291
10317
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
@@ -10297,10 +10323,12 @@ var BsExchange = function BsExchange(props) {
10297
10323
  }, []);
10298
10324
  React.useEffect(function () {
10299
10325
  pubsub__default['default'].subscribe('selectListReturn', function (_, data) {
10326
+ console.log('selectListReturn', data);
10300
10327
  if (disabled) return;
10328
+ var newValue = _objectSpread2({}, data.newValue);
10301
10329
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10302
10330
  onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10303
- bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10331
+ bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10304
10332
  }));
10305
10333
  });
10306
10334
  }, []);
@@ -10376,17 +10404,19 @@ var BsExchange = function BsExchange(props) {
10376
10404
  }
10377
10405
  newValue[key] = val;
10378
10406
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10379
- if (key === 'bsExchangeType') {
10380
- pubsub__default['default'].publish('type', val[0]);
10381
- }
10382
10407
  };
10383
10408
  var changeReturnHandle = function changeReturnHandle(val, index, key) {
10384
10409
  var newValue = _objectSpread2({}, value);
10385
- newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t) {
10410
+ newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t, i) {
10386
10411
  t.index = index;
10387
10412
  if (key === 'bsExchangeGiftGoods') {
10388
10413
  t.money = 0;
10389
10414
  }
10415
+ //换出的分摊价等于退回的分摊价
10416
+ if (key === 'bsExchangeSwapOutGoods') {
10417
+ var _newValue$bsExchangeR, _newValue$bsExchangeR2, _newValue$bsExchangeR3, _newValue$bsExchangeR4;
10418
+ t.share = (_newValue$bsExchangeR = newValue.bsExchangeReturnGoods) === null || _newValue$bsExchangeR === void 0 ? void 0 : (_newValue$bsExchangeR2 = _newValue$bsExchangeR[index]) === null || _newValue$bsExchangeR2 === void 0 ? void 0 : (_newValue$bsExchangeR3 = _newValue$bsExchangeR2['bsExchangeReturnGoods']) === null || _newValue$bsExchangeR3 === void 0 ? void 0 : (_newValue$bsExchangeR4 = _newValue$bsExchangeR3[i]) === null || _newValue$bsExchangeR4 === void 0 ? void 0 : _newValue$bsExchangeR4.share;
10419
+ }
10390
10420
  return t;
10391
10421
  });
10392
10422
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -10485,6 +10515,7 @@ var BsReissue = function BsReissue(props) {
10485
10515
  var valueRef = React.useRef({});
10486
10516
  React.useEffect(function () {
10487
10517
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10518
+ console.log('reissueSelectList', valueRef.current);
10488
10519
  if (disabled) return;
10489
10520
  if (valueRef.current) {
10490
10521
  var newValue = _objectSpread2({}, valueRef.current);
@@ -10500,6 +10531,7 @@ var BsReissue = function BsReissue(props) {
10500
10531
  }, []);
10501
10532
  React.useEffect(function () {
10502
10533
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
10534
+ console.log('reissueSelectListReturn', data);
10503
10535
  if (disabled) return;
10504
10536
  var newValue = _objectSpread2({}, data.newValue);
10505
10537
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10524,19 +10556,10 @@ var BsReissue = function BsReissue(props) {
10524
10556
  }
10525
10557
  });
10526
10558
  }, [value, disabled]);
10527
- var changeHandle = function changeHandle(val, key) {
10559
+ var changeTypeHandle = function changeTypeHandle(val) {
10528
10560
  var newValue = _objectSpread2({}, value);
10529
- if (key === 'bsReissueGoods') {
10530
- val = (val || []).map(function (item) {
10531
- item.money = 0;
10532
- item.share = 0;
10533
- return item;
10534
- });
10535
- }
10536
- newValue[key] = val;
10537
- if (key === 'bsReissueType') {
10538
- newValue.bsReissueGoods = [];
10539
- }
10561
+ newValue['bsReissueType'] = val;
10562
+ newValue.bsReissueGoods = [];
10540
10563
  if (['2', '4'].includes(val[0])) {
10541
10564
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10542
10565
  }
@@ -10545,6 +10568,15 @@ var BsReissue = function BsReissue(props) {
10545
10568
  newValue: newValue
10546
10569
  });
10547
10570
  };
10571
+ var changeGoodHandle = function changeGoodHandle(val) {
10572
+ var newValue = _objectSpread2({}, value);
10573
+ newValue['bsReissueGoods'] = (val || []).map(function (item) {
10574
+ item.money = 0;
10575
+ item.share = 0;
10576
+ return item;
10577
+ });
10578
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10579
+ };
10548
10580
  //显示选择商品按钮 原单换不显示选择商品
10549
10581
  var showChangeBtn = React.useMemo(function () {
10550
10582
  var _value$bsReissueType;
@@ -10559,7 +10591,7 @@ var BsReissue = function BsReissue(props) {
10559
10591
  options: reasonList,
10560
10592
  value: value === null || value === void 0 ? void 0 : value.bsReissueType,
10561
10593
  onChange: function onChange(val) {
10562
- return changeHandle(val, 'bsReissueType');
10594
+ return changeTypeHandle(val);
10563
10595
  }
10564
10596
  }), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10565
10597
  key: 'reissueGoods'
@@ -10570,7 +10602,7 @@ var BsReissue = function BsReissue(props) {
10570
10602
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10571
10603
  value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
10572
10604
  onChange: function onChange(val) {
10573
- return changeHandle(val, 'bsReissueGoods');
10605
+ return changeGoodHandle(val);
10574
10606
  }
10575
10607
  })));
10576
10608
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/basic-components",
3
- "version": "0.7.15-alpha.73",
3
+ "version": "0.7.15-alpha.76",
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": "^0.7.15-alpha.71",
23
+ "@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.76",
24
24
  "lodash": "^4.17.21",
25
25
  "pubsub-js": "^1.9.4",
26
26
  "umi-request": "^1.4.0"
@@ -58,5 +58,5 @@
58
58
  "publishConfig": {
59
59
  "access": "public"
60
60
  },
61
- "gitHead": "a212416de89353bc5f4a45a00bb6670cc10e5feb"
61
+ "gitHead": "59a50bea3ca62d5010ccb7a81ae5a95d8d724fcc"
62
62
  }