@kmkf-fe-packages/basic-components 0.7.15-alpha.74 → 0.7.15-alpha.77

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,7 +10220,7 @@ 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;
@@ -10276,7 +10300,7 @@ var BsExchange = function BsExchange(props) {
10276
10300
  }, [value]);
10277
10301
  useEffect(function () {
10278
10302
  pubsub.subscribe('selectList', function (_, data) {
10279
- // console.log('selectList', data, valueRef.current);
10303
+ console.log('selectList', data, valueRef.current);
10280
10304
  if (disabled) return;
10281
10305
  if (valueRef.current) {
10282
10306
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
@@ -10288,10 +10312,12 @@ var BsExchange = function BsExchange(props) {
10288
10312
  }, []);
10289
10313
  useEffect(function () {
10290
10314
  pubsub.subscribe('selectListReturn', function (_, data) {
10315
+ console.log('selectListReturn', data);
10291
10316
  if (disabled) return;
10317
+ var newValue = _objectSpread2({}, data.newValue);
10292
10318
  var newDataList = cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10293
10319
  onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10294
- bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10320
+ bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10295
10321
  }));
10296
10322
  });
10297
10323
  }, []);
@@ -10367,17 +10393,19 @@ var BsExchange = function BsExchange(props) {
10367
10393
  }
10368
10394
  newValue[key] = val;
10369
10395
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10370
- if (key === 'bsExchangeType') {
10371
- pubsub.publish('type', val[0]);
10372
- }
10373
10396
  };
10374
10397
  var changeReturnHandle = function changeReturnHandle(val, index, key) {
10375
10398
  var newValue = _objectSpread2({}, value);
10376
- newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t) {
10399
+ newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t, i) {
10377
10400
  t.index = index;
10378
10401
  if (key === 'bsExchangeGiftGoods') {
10379
10402
  t.money = 0;
10380
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
+ }
10381
10409
  return t;
10382
10410
  });
10383
10411
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -10476,6 +10504,7 @@ var BsReissue = function BsReissue(props) {
10476
10504
  var valueRef = useRef({});
10477
10505
  useEffect(function () {
10478
10506
  pubsub.subscribe('reissueSelectList', function (_, data) {
10507
+ console.log('reissueSelectList', valueRef.current);
10479
10508
  if (disabled) return;
10480
10509
  if (valueRef.current) {
10481
10510
  var newValue = _objectSpread2({}, valueRef.current);
@@ -10491,6 +10520,7 @@ var BsReissue = function BsReissue(props) {
10491
10520
  }, []);
10492
10521
  useEffect(function () {
10493
10522
  pubsub.subscribe('reissueSelectListReturn', function (_, data) {
10523
+ console.log('reissueSelectListReturn', data);
10494
10524
  if (disabled) return;
10495
10525
  var newValue = _objectSpread2({}, data.newValue);
10496
10526
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10515,19 +10545,10 @@ var BsReissue = function BsReissue(props) {
10515
10545
  }
10516
10546
  });
10517
10547
  }, [value, disabled]);
10518
- var changeHandle = function changeHandle(val, key) {
10548
+ var changeTypeHandle = function changeTypeHandle(val) {
10519
10549
  var newValue = _objectSpread2({}, value);
10520
- if (key === 'bsReissueGoods') {
10521
- val = (val || []).map(function (item) {
10522
- item.money = 0;
10523
- item.share = 0;
10524
- return item;
10525
- });
10526
- }
10527
- newValue[key] = val;
10528
- if (key === 'bsReissueType') {
10529
- newValue.bsReissueGoods = [];
10530
- }
10550
+ newValue['bsReissueType'] = val;
10551
+ newValue.bsReissueGoods = [];
10531
10552
  if (['2', '4'].includes(val[0])) {
10532
10553
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10533
10554
  }
@@ -10536,6 +10557,15 @@ var BsReissue = function BsReissue(props) {
10536
10557
  newValue: newValue
10537
10558
  });
10538
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
+ };
10539
10569
  //显示选择商品按钮 原单换不显示选择商品
10540
10570
  var showChangeBtn = useMemo(function () {
10541
10571
  var _value$bsReissueType;
@@ -10550,7 +10580,7 @@ var BsReissue = function BsReissue(props) {
10550
10580
  options: reasonList,
10551
10581
  value: value === null || value === void 0 ? void 0 : value.bsReissueType,
10552
10582
  onChange: function onChange(val) {
10553
- return changeHandle(val, 'bsReissueType');
10583
+ return changeTypeHandle(val);
10554
10584
  }
10555
10585
  }), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
10556
10586
  key: 'reissueGoods'
@@ -10561,7 +10591,7 @@ var BsReissue = function BsReissue(props) {
10561
10591
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10562
10592
  value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
10563
10593
  onChange: function onChange(val) {
10564
- return changeHandle(val, 'bsReissueGoods');
10594
+ return changeGoodHandle(val);
10565
10595
  }
10566
10596
  })));
10567
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,7 +10231,7 @@ 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;
@@ -10287,7 +10311,7 @@ var BsExchange = function BsExchange(props) {
10287
10311
  }, [value]);
10288
10312
  React.useEffect(function () {
10289
10313
  pubsub__default['default'].subscribe('selectList', function (_, data) {
10290
- // console.log('selectList', data, valueRef.current);
10314
+ console.log('selectList', data, valueRef.current);
10291
10315
  if (disabled) return;
10292
10316
  if (valueRef.current) {
10293
10317
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
@@ -10299,10 +10323,12 @@ var BsExchange = function BsExchange(props) {
10299
10323
  }, []);
10300
10324
  React.useEffect(function () {
10301
10325
  pubsub__default['default'].subscribe('selectListReturn', function (_, data) {
10326
+ console.log('selectListReturn', data);
10302
10327
  if (disabled) return;
10328
+ var newValue = _objectSpread2({}, data.newValue);
10303
10329
  var newDataList = lodash.cloneDeep((data === null || data === void 0 ? void 0 : data.list) || []);
10304
10330
  onChange(_objectSpread2(_objectSpread2({}, data.newValue), {}, {
10305
- bsExchangeReturnGoods: getListHandle(newDataList, valueRef.current)
10331
+ bsExchangeReturnGoods: getListHandle(newDataList, newValue)
10306
10332
  }));
10307
10333
  });
10308
10334
  }, []);
@@ -10378,17 +10404,19 @@ var BsExchange = function BsExchange(props) {
10378
10404
  }
10379
10405
  newValue[key] = val;
10380
10406
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10381
- if (key === 'bsExchangeType') {
10382
- pubsub__default['default'].publish('type', val[0]);
10383
- }
10384
10407
  };
10385
10408
  var changeReturnHandle = function changeReturnHandle(val, index, key) {
10386
10409
  var newValue = _objectSpread2({}, value);
10387
- newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t) {
10410
+ newValue.bsExchangeReturnGoods[index][key] = (val || []).map(function (t, i) {
10388
10411
  t.index = index;
10389
10412
  if (key === 'bsExchangeGiftGoods') {
10390
10413
  t.money = 0;
10391
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
+ }
10392
10420
  return t;
10393
10421
  });
10394
10422
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
@@ -10487,6 +10515,7 @@ var BsReissue = function BsReissue(props) {
10487
10515
  var valueRef = React.useRef({});
10488
10516
  React.useEffect(function () {
10489
10517
  pubsub__default['default'].subscribe('reissueSelectList', function (_, data) {
10518
+ console.log('reissueSelectList', valueRef.current);
10490
10519
  if (disabled) return;
10491
10520
  if (valueRef.current) {
10492
10521
  var newValue = _objectSpread2({}, valueRef.current);
@@ -10502,6 +10531,7 @@ var BsReissue = function BsReissue(props) {
10502
10531
  }, []);
10503
10532
  React.useEffect(function () {
10504
10533
  pubsub__default['default'].subscribe('reissueSelectListReturn', function (_, data) {
10534
+ console.log('reissueSelectListReturn', data);
10505
10535
  if (disabled) return;
10506
10536
  var newValue = _objectSpread2({}, data.newValue);
10507
10537
  newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
@@ -10526,19 +10556,10 @@ var BsReissue = function BsReissue(props) {
10526
10556
  }
10527
10557
  });
10528
10558
  }, [value, disabled]);
10529
- var changeHandle = function changeHandle(val, key) {
10559
+ var changeTypeHandle = function changeTypeHandle(val) {
10530
10560
  var newValue = _objectSpread2({}, value);
10531
- if (key === 'bsReissueGoods') {
10532
- val = (val || []).map(function (item) {
10533
- item.money = 0;
10534
- item.share = 0;
10535
- return item;
10536
- });
10537
- }
10538
- newValue[key] = val;
10539
- if (key === 'bsReissueType') {
10540
- newValue.bsReissueGoods = [];
10541
- }
10561
+ newValue['bsReissueType'] = val;
10562
+ newValue.bsReissueGoods = [];
10542
10563
  if (['2', '4'].includes(val[0])) {
10543
10564
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10544
10565
  }
@@ -10547,6 +10568,15 @@ var BsReissue = function BsReissue(props) {
10547
10568
  newValue: newValue
10548
10569
  });
10549
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
+ };
10550
10580
  //显示选择商品按钮 原单换不显示选择商品
10551
10581
  var showChangeBtn = React.useMemo(function () {
10552
10582
  var _value$bsReissueType;
@@ -10561,7 +10591,7 @@ var BsReissue = function BsReissue(props) {
10561
10591
  options: reasonList,
10562
10592
  value: value === null || value === void 0 ? void 0 : value.bsReissueType,
10563
10593
  onChange: function onChange(val) {
10564
- return changeHandle(val, 'bsReissueType');
10594
+ return changeTypeHandle(val);
10565
10595
  }
10566
10596
  }), /*#__PURE__*/React__default['default'].createElement(GoodItem, _objectSpread2(_objectSpread2({
10567
10597
  key: 'reissueGoods'
@@ -10572,7 +10602,7 @@ var BsReissue = function BsReissue(props) {
10572
10602
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
10573
10603
  value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
10574
10604
  onChange: function onChange(val) {
10575
- return changeHandle(val, 'bsReissueGoods');
10605
+ return changeGoodHandle(val);
10576
10606
  }
10577
10607
  })));
10578
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.74",
3
+ "version": "0.7.15-alpha.77",
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.77",
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": "aa4a53b173174e0d3b5c0fc90abfc54def9a4642"
61
+ "gitHead": "0e83bab9b7b18f2a73aa3803a05fa6ef4c15b570"
62
62
  }