@kmkf-fe-packages/basic-components 2.0.19-beta.0 → 2.0.20

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
@@ -1,5 +1,5 @@
1
1
  import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo, useCallback } from 'react';
2
- import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Popover, Table, Tabs, ConfigProvider, Pagination, Typography } from 'antd';
2
+ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Popover, Table, Tabs, ConfigProvider, Pagination } from 'antd';
3
3
  import { EyeOutlined, DeleteOutlined, CloseCircleOutlined, CaretUpOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
@@ -10235,7 +10235,6 @@ var Item = Form.Item;
10235
10235
  var LogisticsInterception = function LogisticsInterception(props) {
10236
10236
  var _value$interceptLogis2, _value$interceptLogis3, _value$interceptLogis4;
10237
10237
  var LogisticsAddress = LogisticsAddressData.getInstance();
10238
- var LogisticsAddressOptions = (LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || [];
10239
10238
  var address = AddressData.getInstance();
10240
10239
  var _props$value = props.value,
10241
10240
  value = _props$value === void 0 ? {} : _props$value,
@@ -10247,10 +10246,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
10247
10246
  _props$disabled = props.disabled,
10248
10247
  disabled = _props$disabled === void 0 ? false : _props$disabled,
10249
10248
  _props$isEditing = props.isEditing,
10250
- isEditing = _props$isEditing === void 0 ? false : _props$isEditing,
10251
- _props$platform = props.platform,
10252
- platform = _props$platform === void 0 ? '' : _props$platform,
10253
- onJumpPage = props.onJumpPage;
10249
+ isEditing = _props$isEditing === void 0 ? false : _props$isEditing;
10254
10250
  var _useState = useState(''),
10255
10251
  _useState2 = _slicedToArray(_useState, 2),
10256
10252
  initCompany = _useState2[0],
@@ -10338,14 +10334,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
10338
10334
  return item.value === (value === null || value === void 0 ? void 0 : value.interceptType);
10339
10335
  })) === null || _find3 === void 0 ? void 0 : (_find3$config = _find3.config) === null || _find3$config === void 0 ? void 0 : _find3$config.showSenderMobile;
10340
10336
  }, [value === null || value === void 0 ? void 0 : value.interceptType, typeOptions, value === null || value === void 0 ? void 0 : value.interceptCompany]);
10341
- var showKcode = useMemo(function () {
10342
- var isShow = false;
10343
- if (value === null || value === void 0 ? void 0 : value.interceptCompany) {
10344
- var _value$interceptCompa, _value$interceptCompa2;
10345
- isShow = (value === null || value === void 0 ? void 0 : (_value$interceptCompa = value.interceptCompany) === null || _value$interceptCompa === void 0 ? void 0 : _value$interceptCompa.indexOf('YT')) > -1 || (value === null || value === void 0 ? void 0 : (_value$interceptCompa2 = value.interceptCompany) === null || _value$interceptCompa2 === void 0 ? void 0 : _value$interceptCompa2.indexOf('CP468398')) > -1;
10346
- }
10347
- return isShow;
10348
- }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
10349
10337
  //判断是否能修改物流信息
10350
10338
  var isEdit = useMemo(function () {
10351
10339
  var company = expressInterceptData.find(function (item) {
@@ -10355,21 +10343,10 @@ var LogisticsInterception = function LogisticsInterception(props) {
10355
10343
  }, [isEditing, initCompany]);
10356
10344
  //退回地址列表
10357
10345
  var logisticsAddressOptions = useMemo(function () {
10358
- return LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
10346
+ return ((LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getAddressData()) || []).filter(function (item) {
10359
10347
  return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany);
10360
10348
  });
10361
10349
  }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
10362
- // K码列表
10363
- var kCodeList = useMemo(function () {
10364
- return LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
10365
- return item.cpCode === (value === null || value === void 0 ? void 0 : value.interceptCompany) && item.userKCode;
10366
- }).map(function (item) {
10367
- return _objectSpread2(_objectSpread2({}, item), {}, {
10368
- value: item === null || item === void 0 ? void 0 : item.userKCode,
10369
- label: item === null || item === void 0 ? void 0 : item.userKCode
10370
- });
10371
- });
10372
- }, [value === null || value === void 0 ? void 0 : value.interceptCompany]);
10373
10350
  var returnValue = useMemo(function () {
10374
10351
  var _value$interceptAddre, _value$interceptAddre2, _value$interceptAddre3;
10375
10352
  var uk = LogisticsAddress === null || LogisticsAddress === void 0 ? void 0 : LogisticsAddress.getUkByInfo({
@@ -10387,7 +10364,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
10387
10364
  var changeHandle = function changeHandle(val, type) {
10388
10365
  var newValue = _objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, type, val));
10389
10366
  if (type === 'interceptCompany') {
10390
- var _matchKCodeList$;
10391
10367
  var interceptCompany = expressInterceptData.find(function (item) {
10392
10368
  return item.value === val;
10393
10369
  });
@@ -10395,28 +10371,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
10395
10371
  var _item$config4;
10396
10372
  return item === null || item === void 0 ? void 0 : (_item$config4 = item.config) === null || _item$config4 === void 0 ? void 0 : _item$config4.isDefault;
10397
10373
  });
10398
- // const demoList = [
10399
- // {
10400
- // city: 330100,
10401
- // cpCode: 'YTO',
10402
- // detail: '光云大厦',
10403
- // district: 330108,
10404
- // mobile: '18858820420',
10405
- // province: 330000,
10406
- // sendGoodName: '测试编码仓',
10407
- // senderMobile: '',
10408
- // senderMobilePhoneList: [],
10409
- // uk: '8Y2FjwQHdw',
10410
- // update: 1735887721299,
10411
- // userName: '南月 光云大厦',
10412
- // userKCode: 'K12345678',
10413
- // userSecretKey: '12345678',
10414
- // },
10415
- // ];
10416
- var matchKCodeList = LogisticsAddressOptions === null || LogisticsAddressOptions === void 0 ? void 0 : LogisticsAddressOptions.filter(function (item) {
10417
- return item.cpCode === val && item.userKCode;
10418
- });
10419
- newValue = _objectSpread2(_objectSpread2({}, newValue), {}, {
10374
+ newValue = _objectSpread2(_objectSpread2({}, value), {}, {
10420
10375
  interceptCompany: val,
10421
10376
  interceptType: _returnValue === null || _returnValue === void 0 ? void 0 : _returnValue.value,
10422
10377
  interceptSenderMobile: undefined,
@@ -10431,31 +10386,18 @@ var LogisticsInterception = function LogisticsInterception(props) {
10431
10386
  interceptLogisticsApiStatus: {
10432
10387
  status: '',
10433
10388
  reason: ''
10434
- },
10435
- interceptLogisticsUserKCode: (matchKCodeList === null || matchKCodeList === void 0 ? void 0 : matchKCodeList.length) === 1 ? matchKCodeList[0].userKCode : undefined,
10436
- interceptLogisticsUserSecretKey: (matchKCodeList === null || matchKCodeList === void 0 ? void 0 : matchKCodeList.length) === 1 ? (_matchKCodeList$ = matchKCodeList[0]) === null || _matchKCodeList$ === void 0 ? void 0 : _matchKCodeList$.userSecretKey : undefined
10389
+ }
10437
10390
  });
10438
10391
  }
10439
10392
  if (type === 'interceptLogisticsApiStatus') {
10440
10393
  var _value$interceptLogis;
10441
- newValue = _objectSpread2(_objectSpread2({}, newValue), {}, {
10394
+ newValue = _objectSpread2(_objectSpread2({}, value), {}, {
10442
10395
  interceptLogisticsApiStatus: {
10443
10396
  status: val,
10444
10397
  reason: (value === null || value === void 0 ? void 0 : (_value$interceptLogis = value.interceptLogisticsApiStatus) === null || _value$interceptLogis === void 0 ? void 0 : _value$interceptLogis.reason) || ''
10445
10398
  }
10446
10399
  });
10447
10400
  }
10448
- if (type === 'interceptLogisticsUserKCode') {
10449
- var kCodeItem = kCodeList === null || kCodeList === void 0 ? void 0 : kCodeList.find(function (item) {
10450
- return item.value === val;
10451
- });
10452
- if (kCodeItem) {
10453
- newValue = _objectSpread2(_objectSpread2({}, newValue), {}, {
10454
- interceptLogisticsUserSecretKey: kCodeItem === null || kCodeItem === void 0 ? void 0 : kCodeItem.userSecretKey
10455
- });
10456
- }
10457
- }
10458
- console.log('newValue', newValue);
10459
10401
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
10460
10402
  };
10461
10403
  //智能识别回调
@@ -10508,47 +10450,6 @@ var LogisticsInterception = function LogisticsInterception(props) {
10508
10450
  return changeHandle(e.target.value, 'interceptCode');
10509
10451
  },
10510
10452
  value: value === null || value === void 0 ? void 0 : value.interceptCode
10511
- }))), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Item, {
10512
- label: /*#__PURE__*/React.createElement("span", null, "\u5BA2\u6237\u7F16\u7801\uFF08K\u7801\uFF09\uFF1A", platform === 'pc' ? /*#__PURE__*/React.createElement(Typography.Link, {
10513
- style: {
10514
- cursor: 'pointer'
10515
- },
10516
- onClick: function onClick() {
10517
- return onJumpPage && (onJumpPage === null || onJumpPage === void 0 ? void 0 : onJumpPage({
10518
- type: 'interceptConfig'
10519
- }));
10520
- }
10521
- }, 'k码配置>>') : null),
10522
- required: true,
10523
- key: 'interceptLogisticsUserKCode',
10524
- hidden: !showKcode
10525
- }, /*#__PURE__*/React.createElement(Select, {
10526
- disabled: disabled || isEdit,
10527
- placeholder: "\u9009\u62E9K\u7801",
10528
- showSearch: true,
10529
- style: {
10530
- width: '200px'
10531
- },
10532
- onChange: function onChange(val) {
10533
- return changeHandle(val, 'interceptLogisticsUserKCode');
10534
- },
10535
- options: kCodeList,
10536
- value: value === null || value === void 0 ? void 0 : value.interceptLogisticsUserKCode,
10537
- filterOption: function filterOption(input, option) {
10538
- return option.label.includes(input);
10539
- }
10540
- })), /*#__PURE__*/React.createElement(Item, {
10541
- key: 'interceptLogisticsUserSecretKey',
10542
- hidden: !showKcode,
10543
- noStyle: true
10544
- }, /*#__PURE__*/React.createElement(Input, {
10545
- style: {
10546
- width: '200px',
10547
- marginTop: '6px'
10548
- },
10549
- placeholder: "\u5BA2\u6237\u5BC6\u94A5",
10550
- disabled: true,
10551
- value: value === null || value === void 0 ? void 0 : value.interceptLogisticsUserSecretKey
10552
10453
  }))), /*#__PURE__*/React.createElement(Item, {
10553
10454
  label: '拦截类型',
10554
10455
  required: required,
@@ -10693,8 +10594,7 @@ var LogisticsMoreInterception = function LogisticsMoreInterception(props) {
10693
10594
  value = _props$value === void 0 ? [] : _props$value,
10694
10595
  disabled = props.disabled,
10695
10596
  onChange = props.onChange,
10696
- isEditing = props.isEditing,
10697
- effects = props.effects;
10597
+ isEditing = props.isEditing;
10698
10598
  var _useState = useState(0),
10699
10599
  _useState2 = _slicedToArray(_useState, 2),
10700
10600
  changeIndex = _useState2[0],
@@ -10736,8 +10636,6 @@ var LogisticsMoreInterception = function LogisticsMoreInterception(props) {
10736
10636
  value: item,
10737
10637
  disabled: disabled,
10738
10638
  isEditing: false,
10739
- platform: effects === null || effects === void 0 ? void 0 : effects.env,
10740
- onJumpPage: effects === null || effects === void 0 ? void 0 : effects.onJumpPage,
10741
10639
  onChange: function onChange(val) {
10742
10640
  return handleChange(val, index);
10743
10641
  }
@@ -12618,7 +12516,6 @@ var getTableData$2 = function getTableData(_ref, formData) {
12618
12516
  var current = _ref.current,
12619
12517
  pageSize = _ref.pageSize;
12620
12518
  var data = {
12621
- goodShortName: formData.goodShortName || null,
12622
12519
  goodNo: formData.goodNo || null,
12623
12520
  goodName: formData.goodName || null,
12624
12521
  skuCode: formData.skuCode || null,
@@ -12776,17 +12673,6 @@ var GoodList$2 = function GoodList(props, ref) {
12776
12673
  layout: "inline",
12777
12674
  form: form
12778
12675
  }, /*#__PURE__*/React.createElement(Form.Item, {
12779
- name: "goodShortName",
12780
- style: {
12781
- marginBottom: '12px'
12782
- }
12783
- }, /*#__PURE__*/React.createElement(Input, {
12784
- placeholder: "\u5546\u54C1\u7B80\u79F0",
12785
- allowClear: true,
12786
- style: {
12787
- width: 150
12788
- }
12789
- })), /*#__PURE__*/React.createElement(Form.Item, {
12790
12676
  name: "goodNo",
12791
12677
  style: {
12792
12678
  marginBottom: '12px'
@@ -14474,117 +14360,6 @@ var getColumns$4 = function getColumns(_ref) {
14474
14360
  align: 'center',
14475
14361
  ellipsis: true
14476
14362
  });
14477
- }),
14478
- //管易退货商品信息
14479
- GY_RETURN_GOODS: [{
14480
- dataIndex: 'goodName',
14481
- title: "\u5546\u54C1\u540D\u79F0",
14482
- width: 150
14483
- }, {
14484
- dataIndex: 'goodShortName',
14485
- title: "\u5546\u54C1\u7B80\u79F0",
14486
- width: 150
14487
- }, {
14488
- dataIndex: 'goodNo',
14489
- title: "\u5546\u54C1\u7F16\u7801",
14490
- width: 200
14491
- }, {
14492
- dataIndex: 'specName',
14493
- title: "SKU\u540D\u79F0",
14494
- align: 'center',
14495
- ellipsis: true,
14496
- width: 250
14497
- }, {
14498
- dataIndex: 'specNo',
14499
- title: "SKU\u7F16\u7801",
14500
- align: 'center',
14501
- ellipsis: true,
14502
- width: 150
14503
- }, {
14504
- dataIndex: 'qty',
14505
- title: "\u6570\u91CF",
14506
- width: 100,
14507
- render: function render(val, record, index) {
14508
- return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14509
- style: {
14510
- width: 70
14511
- },
14512
- value: val,
14513
- min: 1,
14514
- precision: 0,
14515
- onChange: function onChange(num) {
14516
- updateDataHandle({
14517
- qty: num,
14518
- amount: num && isNumberOrNumberString(record.price) ? num * record.price : null,
14519
- originAmount: num && isNumberOrNumberString(record.originPrice) ? num * record.originPrice : null
14520
- }, index);
14521
- }
14522
- }) : /*#__PURE__*/React.createElement("span", null, val);
14523
- }
14524
- }, {
14525
- dataIndex: 'price',
14526
- title: "\u5B9E\u9645\u5355\u4EF7",
14527
- width: 150,
14528
- render: function render(val, record, index) {
14529
- return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
14530
- style: {
14531
- width: 130
14532
- },
14533
- value: val,
14534
- min: 0,
14535
- precision: 2,
14536
- onChange: function onChange(num) {
14537
- updateDataHandle({
14538
- price: num,
14539
- amount: num && isNumberOrNumberString(record.qty) ? num * record.qty : null
14540
- }, index);
14541
- }
14542
- }) : /*#__PURE__*/React.createElement("span", null, val);
14543
- }
14544
- }, {
14545
- dataIndex: 'amount',
14546
- title: "\u5B9E\u9645\u91D1\u989D",
14547
- width: 150
14548
- }, {
14549
- dataIndex: 'originPrice',
14550
- title: "\u6807\u51C6\u5355\u4EF7",
14551
- width: 150
14552
- }, {
14553
- dataIndex: 'originAmount',
14554
- title: "\u6807\u51C6\u91D1\u989D",
14555
- width: 150
14556
- }, {
14557
- dataIndex: 'discountFee',
14558
- title: "\u8BA9\u5229\u91D1\u989D",
14559
- width: 150
14560
- }, {
14561
- dataIndex: 'amountAfter',
14562
- title: "\u8BA9\u5229\u540E\u91D1\u989D",
14563
- width: 150
14564
- }, {
14565
- dataIndex: 'isGift',
14566
- title: "\u662F\u5426\u8D60\u54C1",
14567
- width: 150,
14568
- render: function render(val, record, index) {
14569
- return record.canEdit && !disabled ? /*#__PURE__*/React.createElement(Select, {
14570
- value: val,
14571
- onChange: function onChange(value) {
14572
- updateHandle(value, index, 'isGift');
14573
- },
14574
- options: [{
14575
- label: '是',
14576
- value: 1
14577
- }, {
14578
- label: '否',
14579
- value: 0
14580
- }]
14581
- }) : /*#__PURE__*/React.createElement("span", null, getYesOrNo(val));
14582
- }
14583
- }].map(function (item) {
14584
- return _objectSpread2(_objectSpread2({}, item), {}, {
14585
- align: 'center',
14586
- ellipsis: true
14587
- });
14588
14363
  })
14589
14364
  };
14590
14365
  };
@@ -15515,7 +15290,6 @@ var GoodItem$1 = function GoodItem(props) {
15515
15290
  case 'JST_EXCHANGE_GOODS':
15516
15291
  case 'JST_RETURN_GOODS':
15517
15292
  case 'GY_REISSUE_GOODS':
15518
- case 'GY_RETURN_GOODS':
15519
15293
  {
15520
15294
  columns = getColumnsMap({
15521
15295
  text: text,
@@ -17282,13 +17056,12 @@ var CommonGoods = function CommonGoods(props) {
17282
17056
  };
17283
17057
 
17284
17058
  var componentMap$2 = {
17285
- WDT_RETURN_GOODS: {
17059
+ 'WDT_RETURN_GOODS': {
17286
17060
  type: 'wdt',
17287
17061
  valueKey: 'wdtReturnGoods',
17288
17062
  returnTypeKey: 'wdtReturnType',
17289
17063
  name: '旺店通',
17290
17064
  eventNameMap: {
17291
- // pubsub 事件
17292
17065
  changeShopCode: 'wdtChangeShopCode',
17293
17066
  returnType: 'wdtReturnType',
17294
17067
  returnSelectListReturn: 'wdtReturnSelectListReturn',
@@ -18907,7 +18680,7 @@ var MsgStatus = function MsgStatus(props) {
18907
18680
  onClick: function onClick() {
18908
18681
  return setChangeIndex(index);
18909
18682
  }
18910
- }, msgTypeCh[key] || key, item.ruleName);
18683
+ }, msgTypeCh[key], item.ruleName);
18911
18684
  }))) : null, type === 1 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Select, _objectSpread2(_objectSpread2({}, other), {}, {
18912
18685
  showSearch: true,
18913
18686
  value: (_value$changeIndex = value[changeIndex]) === null || _value$changeIndex === void 0 ? void 0 : _value$changeIndex.status,
@@ -19356,7 +19129,7 @@ var GyReissue = function GyReissue(props) {
19356
19129
  console.log('商品发生变化', newValue["".concat(typeMap$4 === null || typeMap$4 === void 0 ? void 0 : (_typeMap$type25 = typeMap$4[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.key)]);
19357
19130
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19358
19131
  }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$4 === null || typeMap$4 === void 0 ? void 0 : (_typeMap$type26 = typeMap$4[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.key)], isStrict]);
19359
- //系统单选择后展示选择商品按钮,系统单未选择的时候不展示
19132
+ //显示选择商品按钮 原单换不显示选择商品
19360
19133
  var showChangeBtn = useMemo(function () {
19361
19134
  var _typeMap$type27;
19362
19135
  return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$4[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]);
@@ -19432,295 +19205,4 @@ var GyReissue = function GyReissue(props) {
19432
19205
  })));
19433
19206
  };
19434
19207
 
19435
- var _excluded$o = ["value", "onChange", "reasonList", "disabled", "type"],
19436
- _excluded2$1 = ["billNo", "billType", "billTag", "tradeTagName", "deliveryState", "vipCode", "shopCode"];
19437
- var typeMap$5 = {
19438
- GY_RETURN_GOODS: {
19439
- key: 'gyReturnGoods',
19440
- name: '管易',
19441
- typeName: 'gyReturnType',
19442
- systemOrder: 'gySystemOrder',
19443
- systemOrderNo: 'gySystemOrderNo',
19444
- returnSelectList: 'gyReturnSelectList',
19445
- returnSelectListReturn: 'gyReturnSelectListReturn',
19446
- returnDeleteGood: 'gyReturnDeleteGood',
19447
- changeShopCode: 'gyChangeShopCode',
19448
- returnType: 'gyReturnType',
19449
- formatDefaultField: {
19450
- money: 'orderPrice',
19451
- share: 'sharePrice'
19452
- },
19453
- getOrderList: gyUtils.getGyOrderListSingleton
19454
- }
19455
- };
19456
- var GyReturnGoods = function GyReturnGoods(props) {
19457
- var _value$gySystemOrder, _typeMap$type10, _typeMap$type28, _typeMap$type29, _value$typeMap$type$s5, _typeMap$type30, _typeMap$type31, _typeMap$type32;
19458
- var value = props.value,
19459
- onChange = props.onChange,
19460
- _props$reasonList = props.reasonList,
19461
- reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
19462
- disabled = props.disabled,
19463
- type = props.type,
19464
- other = _objectWithoutProperties(props, _excluded$o);
19465
- var valueRef = useRef({});
19466
- var getOrderFlag = useRef(false);
19467
- var _useState = useState(false),
19468
- _useState2 = _slicedToArray(_useState, 2),
19469
- isStrict = _useState2[0],
19470
- setIsStrict = _useState2[1];
19471
- var showModeBtn = ((value === null || value === void 0 ? void 0 : (_value$gySystemOrder = value.gySystemOrder) === null || _value$gySystemOrder === void 0 ? void 0 : _value$gySystemOrder.orders) || []).some(function (order) {
19472
- var _order$platformCode;
19473
- return order === null || order === void 0 ? void 0 : (_order$platformCode = order.platformCode) === null || _order$platformCode === void 0 ? void 0 : _order$platformCode.includes(';');
19474
- });
19475
- useEffect(function () {
19476
- var _value$typeMap$type$s, _value$typeMap$type$s2, _typeMap$type, _value$typeMap$type$s3, _typeMap$type2;
19477
- if (!getOrderFlag.current && !(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s = value[(_typeMap$type = typeMap$5[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.systemOrder]) === null || _value$typeMap$type$s === void 0 ? void 0 : (_value$typeMap$type$s2 = _value$typeMap$type$s.orders) === null || _value$typeMap$type$s2 === void 0 ? void 0 : _value$typeMap$type$s2.length) && (value === null || value === void 0 ? void 0 : (_value$typeMap$type$s3 = value[(_typeMap$type2 = typeMap$5[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.systemOrder]) === null || _value$typeMap$type$s3 === void 0 ? void 0 : _value$typeMap$type$s3.orderNo)) {
19478
- var _value$typeMap$type$s4, _typeMap$type3;
19479
- getOrderFlag.current = true;
19480
- getOrderList(value === null || value === void 0 ? void 0 : (_value$typeMap$type$s4 = value[(_typeMap$type3 = typeMap$5[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.systemOrder]) === null || _value$typeMap$type$s4 === void 0 ? void 0 : _value$typeMap$type$s4.orderNo);
19481
- }
19482
- return;
19483
- }, [value]);
19484
- // useEffect(() => {
19485
- // pubsub.subscribe('returnSelectList', (_: any, data: any) => {
19486
- // if (disabled) return;
19487
- // const newValue = { ...data.goodValue, shopCode: data?.shopCode };
19488
- // newValue.gyReturnGoods = data?.list || [];
19489
- // onChange?.(newValue);
19490
- // });
19491
- // }, []);
19492
- // useEffect(() => {
19493
- // pubsub.subscribe('returnSelectListReturn', (_: any, data: any) => {
19494
- // // console.log('returnSelectListReturn', data);
19495
- // if (disabled) return;
19496
- // const newValue = { ...data.goodValue, shopCode: data?.shopCode };
19497
- // newValue.gyReturnGoods = data?.list || [];
19498
- // onChange?.(newValue);
19499
- // });
19500
- // }, []);
19501
- // useEffect(() => {
19502
- // valueRef.current = value;
19503
- // pubsub.subscribeOnce('returnDeleteGood', (_: any, data: any) => {
19504
- // if (disabled) return;
19505
- // if (value) {
19506
- // const newValue = { ...value };
19507
- // newValue.gyReturnGoods = newValue.gyReturnGoods.filter(
19508
- // (item: any) => item.sku !== data,
19509
- // );
19510
- // onChange?.(newValue);
19511
- // }
19512
- // });
19513
- // pubsub.subscribeOnce('changeShopCode', (type: any, data: any) => {
19514
- // onChange({
19515
- // ...value,
19516
- // shopCode: data.shopCode,
19517
- // });
19518
- // });
19519
- // }, [value, disabled]);
19520
- var getOrderList = /*#__PURE__*/function () {
19521
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(orderNo) {
19522
- var _typeMap$type4;
19523
- return _regeneratorRuntime().wrap(function _callee$(_context) {
19524
- while (1) switch (_context.prev = _context.next) {
19525
- case 0:
19526
- (_typeMap$type4 = typeMap$5[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.getOrderList(orderNo).then(function (data) {
19527
- var _typeMap$type5, _typeMap$type6;
19528
- var orders = (data === null || data === void 0 ? void 0 : data.trades) || [];
19529
- var showOrderInfo = orders.map(function (_ref2) {
19530
- var billNo = _ref2.billNo,
19531
- billType = _ref2.billType,
19532
- billTag = _ref2.billTag,
19533
- tradeTagName = _ref2.tradeTagName,
19534
- deliveryState = _ref2.deliveryState,
19535
- vipCode = _ref2.vipCode,
19536
- shopCode = _ref2.shopCode,
19537
- rest = _objectWithoutProperties(_ref2, _excluded2$1);
19538
- return _objectSpread2(_objectSpread2({}, rest), {}, {
19539
- billNo: billNo,
19540
- billType: billType,
19541
- billTag: billTag,
19542
- tradeTagName: tradeTagName,
19543
- deliveryState: deliveryState,
19544
- deliveryStateName: GY_DELIVERY_STATE_MAPPING[deliveryState],
19545
- vipCode: vipCode,
19546
- shopCode: shopCode
19547
- });
19548
- });
19549
- onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type5 = typeMap$5[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.systemOrder, _objectSpread2(_objectSpread2({}, value[(_typeMap$type6 = typeMap$5[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.systemOrder]), {}, {
19550
- showOrderInfo: showOrderInfo,
19551
- orders: orders
19552
- }))));
19553
- });
19554
- case 1:
19555
- case "end":
19556
- return _context.stop();
19557
- }
19558
- }, _callee);
19559
- }));
19560
- return function getOrderList(_x) {
19561
- return _ref.apply(this, arguments);
19562
- };
19563
- }();
19564
- var selectedGoodsChange = useCallback(function (skuList) {
19565
- var _typeMap$type7, _typeMap$type8, _uniqBy, _typeMap$type9;
19566
- var newValue = _objectSpread2({}, value);
19567
- // 原订单商品
19568
- var originTradeGoodList = getGoodDetails({
19569
- mode: isStrict
19570
- }) || [];
19571
- // 当前选中的所有商品【包含了原订单+商品库】
19572
- var currentSelectGoodList = (value === null || value === void 0 ? void 0 : value["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type7 = typeMap$5[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.key)]) || [];
19573
- newValue["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type8 = typeMap$5[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.key)] = (_uniqBy = uniqBy(originTradeGoodList.concat(currentSelectGoodList), 'uuid')) === null || _uniqBy === void 0 ? void 0 : _uniqBy.filter(function (item) {
19574
- return skuList.includes(item.uuid);
19575
- });
19576
- console.log('商品发生变化', newValue["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type9 = typeMap$5[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.key)]);
19577
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19578
- }, [value === null || value === void 0 ? void 0 : value["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type10 = typeMap$5[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)], isStrict]);
19579
- var changeTypeHandle = function changeTypeHandle(val) {
19580
- var _value$typeMap$type$t, _typeMap$type11, _typeMap$type12;
19581
- var typeName = val === null || val === void 0 ? void 0 : val[0];
19582
- if (typeName === (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t = value[(_typeMap$type11 = typeMap$5[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.typeName]) === null || _value$typeMap$type$t === void 0 ? void 0 : _value$typeMap$type$t[0])) return;
19583
- // const systemOrderNo = value?.[typeMap[type]?.systemOrderNo];
19584
- var newValue = _objectSpread2({}, value);
19585
- newValue[(_typeMap$type12 = typeMap$5[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.typeName] = val;
19586
- if (typeName === '1') {
19587
- var _typeMap$type13;
19588
- newValue[(_typeMap$type13 = typeMap$5[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.key] = getGoodDetails({
19589
- mode: isStrict
19590
- });
19591
- } else if (typeName === '2') {
19592
- var _typeMap$type14;
19593
- // 切换到非原单,清空列表
19594
- newValue[(_typeMap$type14 = typeMap$5[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key] = [];
19595
- }
19596
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19597
- };
19598
- var changeGoodHandle = function changeGoodHandle(val) {
19599
- var _typeMap$type15;
19600
- var newValue = _objectSpread2({}, value);
19601
- newValue["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type15 = typeMap$5[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.key)] = (val || []).map(function (item) {
19602
- var _typeMap$type16, _typeMap$type17;
19603
- item["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type16 = typeMap$5[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.formatDefaultField.money)] = 0;
19604
- item["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type17 = typeMap$5[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.share)] = 0;
19605
- return item;
19606
- });
19607
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19608
- };
19609
- var changeSystemOrderHandle = function changeSystemOrderHandle(val) {
19610
- var _typeMap$type18, _value$typeMap$type$t2, _typeMap$type19, _value$typeMap$type$t3, _typeMap$type21;
19611
- var newValue = _objectSpread2({}, value);
19612
- newValue["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type18 = typeMap$5[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.systemOrderNo)] = val;
19613
- if (['2'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t2 = value[(_typeMap$type19 = typeMap$5[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.typeName]) === null || _value$typeMap$type$t2 === void 0 ? void 0 : _value$typeMap$type$t2[0])) {
19614
- var _typeMap$type20;
19615
- newValue["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type20 = typeMap$5[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.key)] = [];
19616
- } else if (['1'].includes(value === null || value === void 0 ? void 0 : (_value$typeMap$type$t3 = value[(_typeMap$type21 = typeMap$5[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.typeName]) === null || _value$typeMap$type$t3 === void 0 ? void 0 : _value$typeMap$type$t3[0])) {
19617
- var _typeMap$type22;
19618
- newValue["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type22 = typeMap$5[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)] = getGoodDetails({
19619
- mode: isStrict,
19620
- sysOrderNo: val
19621
- });
19622
- }
19623
- onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
19624
- };
19625
- var getGoodDetails = function getGoodDetails(_ref3) {
19626
- var _typeMap$type23, _typeMap$type24, _order$details;
19627
- var mode = _ref3.mode,
19628
- sysOrderNo = _ref3.sysOrderNo;
19629
- var systemOrder = value === null || value === void 0 ? void 0 : value[(_typeMap$type23 = typeMap$5[type]) === null || _typeMap$type23 === void 0 ? void 0 : _typeMap$type23.systemOrder];
19630
- var systemOrderNo = sysOrderNo !== null && sysOrderNo !== void 0 ? sysOrderNo : value === null || value === void 0 ? void 0 : value[(_typeMap$type24 = typeMap$5[type]) === null || _typeMap$type24 === void 0 ? void 0 : _typeMap$type24.systemOrderNo];
19631
- var order = systemOrderNo && ((systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orders) || []).find(function (order) {
19632
- return order.code === systemOrderNo;
19633
- });
19634
- var goodDetails = (order === null || order === void 0 ? void 0 : (_order$details = order.details) === null || _order$details === void 0 ? void 0 : _order$details.length) ? updateGyGoodsHandle([order]) : [];
19635
- var orderNo = systemOrder === null || systemOrder === void 0 ? void 0 : systemOrder.orderNo;
19636
- return mode ? goodDetails.filter(function (goodItem) {
19637
- return !orderNo || (orderNo || '').includes(goodItem.oid);
19638
- }) : goodDetails;
19639
- };
19640
- var handleModeChange = function handleModeChange(mode) {
19641
- var _value$typeMap$type$t4, _typeMap$type25, _typeMap$type26;
19642
- var isOriginalOrder = (value === null || value === void 0 ? void 0 : (_value$typeMap$type$t4 = value[(_typeMap$type25 = typeMap$5[type]) === null || _typeMap$type25 === void 0 ? void 0 : _typeMap$type25.typeName]) === null || _value$typeMap$type$t4 === void 0 ? void 0 : _value$typeMap$type$t4[0]) === '1';
19643
- setIsStrict(mode);
19644
- if (!isOriginalOrder) return;
19645
- onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, (_typeMap$type26 = typeMap$5[type]) === null || _typeMap$type26 === void 0 ? void 0 : _typeMap$type26.key, getGoodDetails({
19646
- mode: mode
19647
- }))));
19648
- };
19649
- //系统单选择后展示选择商品按钮,系统单未选择的时候不展示
19650
- var showChangeBtn = useMemo(function () {
19651
- var _typeMap$type27;
19652
- return !!(value === null || value === void 0 ? void 0 : value[(_typeMap$type27 = typeMap$5[type]) === null || _typeMap$type27 === void 0 ? void 0 : _typeMap$type27.systemOrderNo]);
19653
- }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type28 = typeMap$5[type]) === null || _typeMap$type28 === void 0 ? void 0 : _typeMap$type28.systemOrderNo]]);
19654
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Row, {
19655
- gutter: 8,
19656
- wrap: true
19657
- }, /*#__PURE__*/React.createElement(Col, {
19658
- className: "gutter-row",
19659
- xs: {
19660
- span: 11
19661
- },
19662
- sm: {
19663
- span: 6
19664
- }
19665
- }, /*#__PURE__*/React.createElement(Select, {
19666
- style: {
19667
- marginBottom: '8px'
19668
- },
19669
- disabled: disabled,
19670
- allowClear: false,
19671
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type29 = typeMap$5[type]) === null || _typeMap$type29 === void 0 ? void 0 : _typeMap$type29.systemOrderNo)],
19672
- onChange: function onChange(val) {
19673
- return changeSystemOrderHandle(val);
19674
- },
19675
- placeholder: "\u9009\u62E9\u9000\u8D27\u7684\u7CFB\u7EDF\u5355"
19676
- }, ((value === null || value === void 0 ? void 0 : (_value$typeMap$type$s5 = value[(_typeMap$type30 = typeMap$5[type]) === null || _typeMap$type30 === void 0 ? void 0 : _typeMap$type30.systemOrder]) === null || _value$typeMap$type$s5 === void 0 ? void 0 : _value$typeMap$type$s5.showOrderInfo) || []).map(function (item) {
19677
- return /*#__PURE__*/React.createElement(Select.Option, {
19678
- key: item.billNo,
19679
- value: item.billNo,
19680
- label: item.billNo
19681
- }, item.billNo);
19682
- }))), /*#__PURE__*/React.createElement(Col, {
19683
- className: "gutter-row",
19684
- xs: {
19685
- span: 11
19686
- },
19687
- sm: {
19688
- span: 6
19689
- }
19690
- }, /*#__PURE__*/React.createElement(Cascader, {
19691
- style: {
19692
- marginBottom: '8px'
19693
- },
19694
- disabled: disabled,
19695
- allowClear: false,
19696
- options: reasonList,
19697
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type31 = typeMap$5[type]) === null || _typeMap$type31 === void 0 ? void 0 : _typeMap$type31.typeName)],
19698
- onChange: function onChange(val) {
19699
- return changeTypeHandle(val);
19700
- }
19701
- }))), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
19702
- key: 'returnGoods'
19703
- }, other), {}, {
19704
- type: type,
19705
- disabled: disabled,
19706
- canUpdateNumber: showChangeBtn,
19707
- showChangeBtn: showChangeBtn,
19708
- shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
19709
- value: value === null || value === void 0 ? void 0 : value["".concat(typeMap$5 === null || typeMap$5 === void 0 ? void 0 : (_typeMap$type32 = typeMap$5[type]) === null || _typeMap$type32 === void 0 ? void 0 : _typeMap$type32.key)],
19710
- onChange: function onChange(val) {
19711
- return changeGoodHandle(val);
19712
- },
19713
- onModeChange: handleModeChange,
19714
- showModeBtn: showModeBtn,
19715
- isStrict: isStrict,
19716
- showErpGoodsBtn: false,
19717
- tradeGoods: {
19718
- originDataSource: getGoodDetails({
19719
- mode: isStrict
19720
- }),
19721
- selectedGoodsChange: selectedGoodsChange
19722
- }
19723
- })));
19724
- };
19725
-
19726
- export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, GyReissue, GyReturnGoods as GyReturn, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, getColumns$5 as getJstColumns };
19208
+ export { ApaasAddress as Address, AliPay, Province as ApaasAddress, ApaasCascader, ApaasCheckbox, ApaasDate, withFormItem as ApaasHoc, ApaasInput, ApaasInputNumber, ApaasLogistics, ApaasMultipleSelect, ApaasPosting, ApaasRadio, ApaasRate, ApaasSelect, ApaasSlider, ApaasTextArea, ApaasUpload, index as ApaasUploadAsync, ApaasUploadFile, bsE3Reissue as BsE3Reissue, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonExchangeGoods, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonReturnGoods, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, GyReissue, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, PublicReissue, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, SubForm, Supplier, TBGoodId, TBGoodSerial, TradeId, WdtGoodList, wdtReissue as WdtReissue, WlnGoods, columnsBaseInfoMap, getColumns$5 as getJstColumns };