@kmkf-fe-packages/basic-components 0.23.1-beta.1 → 0.23.1-beta.4

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,12 +1,13 @@
1
1
  import React, { useRef, useState, useEffect, forwardRef, useImperativeHandle, useMemo } from 'react';
2
2
  import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, message, Radio, Space, Spin, Modal, Button, Checkbox, Row, Col, Slider, Rate, Form, Tabs, ConfigProvider, Pagination, Popover, Table } from 'antd';
3
- import { EyeOutlined, DeleteOutlined } from '@ant-design/icons';
3
+ import { EyeOutlined, DeleteOutlined, 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';
6
- import { AddressData, BsAddressData, WdtAddressData, request as request$1, ExpressData, LogisticsAddressData, uuid, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, toTree, request as request$1, ExpressData, LogisticsAddressData, uuid, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
+ import { cloneDeep, difference, differenceWith } from 'lodash';
9
+ import { useDebounceEffect } from 'ahooks';
8
10
  import pubsub from 'pubsub-js';
9
- import { cloneDeep } from 'lodash';
10
11
 
11
12
  function _iterableToArrayLimit(arr, i) {
12
13
  var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
@@ -7357,12 +7358,13 @@ function ApaasRate(props) {
7357
7358
  }));
7358
7359
  }
7359
7360
 
7360
- AddressData.getInstance();
7361
- BsAddressData.getInstance();
7362
- WdtAddressData.getInstance();
7361
+ var addressData = AddressData.getInstance();
7362
+ var bsAddressData = BsAddressData.getInstance();
7363
+ var wdtAddressData = WdtAddressData.getInstance();
7363
7364
  var Province = function Province(props) {
7364
7365
  var _props$type = props.type,
7365
- type = _props$type === void 0 ? 'workOrder' : _props$type;
7366
+ type = _props$type === void 0 ? 'workOrder' : _props$type,
7367
+ value = props.value;
7366
7368
  var _useState = useState([]),
7367
7369
  _useState2 = _slicedToArray(_useState, 2),
7368
7370
  option = _useState2[0],
@@ -7378,10 +7380,10 @@ var Province = function Province(props) {
7378
7380
  case 0:
7379
7381
  num++;
7380
7382
  options = ({
7381
- bs: BsAddressData,
7382
- wdt: WdtAddressData,
7383
- workOrder: AddressData
7384
- }[type] || AddressData).getInstance().addressOptions || [];
7383
+ bs: bsAddressData,
7384
+ wdt: wdtAddressData,
7385
+ workOrder: addressData
7386
+ }[type] || addressData).addressOptions || [];
7385
7387
  if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
7386
7388
  time.current = setTimeout(function () {
7387
7389
  initPageSource();
@@ -7398,6 +7400,19 @@ var Province = function Province(props) {
7398
7400
  return _ref.apply(this, arguments);
7399
7401
  };
7400
7402
  }();
7403
+ var getBsAddress = function getBsAddress() {
7404
+ var data = JSON.parse(localStorage.getItem('bsAddressData') || '[]');
7405
+ if (data.length) {
7406
+ var options = toTree(data, 1);
7407
+ setOptions(options);
7408
+ }
7409
+ };
7410
+ //如果值改变地址不存在则再获取一遍
7411
+ useEffect(function () {
7412
+ if (value && type == 'bs' && !option.length) {
7413
+ getBsAddress();
7414
+ }
7415
+ }, [value, type, option]);
7401
7416
  useEffect(function () {
7402
7417
  if (!isFirst.current) {
7403
7418
  initPageSource();
@@ -9623,8 +9638,7 @@ var LogisticsInterception = function LogisticsInterception(props) {
9623
9638
  };
9624
9639
 
9625
9640
  var LogisticsTrajectory = function LogisticsTrajectory(props) {
9626
- var options = props.options,
9627
- showField = props.showField,
9641
+ var showField = props.showField,
9628
9642
  _props$value = props.value,
9629
9643
  value = _props$value === void 0 ? {} : _props$value,
9630
9644
  disabled = props.disabled,
@@ -9755,6 +9769,220 @@ var LogisticsTrajectory = function LogisticsTrajectory(props) {
9755
9769
  return /*#__PURE__*/React.createElement("div", null, LogisticsCompany(), LogisticsCode(), (value === null || value === void 0 ? void 0 : value.trajectoryCompany) === 'SF' ? LogisticsPhone() : null, showField && showField.includes('snapshot') ? /*#__PURE__*/React.createElement(LogisticsSnapshot, null) : null);
9756
9770
  };
9757
9771
 
9772
+ var LogisticsMoreTrajectory = function LogisticsMoreTrajectory(props) {
9773
+ var showField = props.showField,
9774
+ _props$value = props.value,
9775
+ value = _props$value === void 0 ? [] : _props$value,
9776
+ disabled = props.disabled,
9777
+ onChange = props.onChange;
9778
+ var _useState = useState([]),
9779
+ _useState2 = _slicedToArray(_useState, 2),
9780
+ newValue = _useState2[0],
9781
+ setNewValue = _useState2[1];
9782
+ var _useState3 = useState(0),
9783
+ _useState4 = _slicedToArray(_useState3, 2),
9784
+ changeIndex = _useState4[0],
9785
+ setChangeIndex = _useState4[1];
9786
+ var _useState5 = useState([]),
9787
+ _useState6 = _slicedToArray(_useState5, 2),
9788
+ initValue = _useState6[0],
9789
+ setInitValue = _useState6[1];
9790
+ var _useState7 = useState([]),
9791
+ _useState8 = _slicedToArray(_useState7, 2),
9792
+ changeValue = _useState8[0],
9793
+ setChangeValue = _useState8[1];
9794
+ var firstRef = useRef(true);
9795
+ var hasSave = useRef(false);
9796
+ useEffect(function () {
9797
+ if (value.length && firstRef.current) {
9798
+ setInitValue(value);
9799
+ firstRef.current = false;
9800
+ }
9801
+ }, [value]);
9802
+ useDebounceEffect(function () {
9803
+ initHandle({
9804
+ initValue: initValue,
9805
+ value: value
9806
+ });
9807
+ }, [initValue, value], {
9808
+ wait: 500
9809
+ });
9810
+ var initHandle = /*#__PURE__*/function () {
9811
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
9812
+ var initValue, value, hasSnapshot, initList, valueList, changeList, initSnapshotList, valueSnapshotList, hasValue, listValue, requestList, requestValues;
9813
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9814
+ while (1) switch (_context.prev = _context.next) {
9815
+ case 0:
9816
+ initValue = _ref.initValue, value = _ref.value;
9817
+ hasSnapshot = showField && showField.includes('snapshot');
9818
+ initList = initValue.map(function (item) {
9819
+ if (item.trajectoryCompany === 'SF') {
9820
+ return {
9821
+ trajectoryCompany: item.trajectoryCompany,
9822
+ trajectoryCode: item.trajectoryCode,
9823
+ trajectoryPhone: item.trajectoryPhone
9824
+ };
9825
+ } else {
9826
+ return {
9827
+ trajectoryCompany: item.trajectoryCompany,
9828
+ trajectoryCode: item.trajectoryCode
9829
+ };
9830
+ }
9831
+ });
9832
+ valueList = value.map(function (item) {
9833
+ if (item.trajectoryCompany === 'SF') {
9834
+ return {
9835
+ trajectoryCompany: item.trajectoryCompany,
9836
+ trajectoryCode: item.trajectoryCode,
9837
+ trajectoryPhone: item.trajectoryPhone
9838
+ };
9839
+ } else {
9840
+ return {
9841
+ trajectoryCompany: item.trajectoryCompany,
9842
+ trajectoryCode: item.trajectoryCode
9843
+ };
9844
+ }
9845
+ });
9846
+ changeList = changeValue.map(function (item) {
9847
+ if (item.trajectoryCompany === 'SF') {
9848
+ return {
9849
+ trajectoryCompany: item.trajectoryCompany,
9850
+ trajectoryCode: item.trajectoryCode,
9851
+ trajectoryPhone: item.trajectoryPhone
9852
+ };
9853
+ } else {
9854
+ return {
9855
+ trajectoryCompany: item.trajectoryCompany,
9856
+ trajectoryCode: item.trajectoryCode
9857
+ };
9858
+ }
9859
+ }); // 1、初始值没有 传入值有请求快照
9860
+ // 2、初始值有 传入值有 其中有不一样的请求快照
9861
+ // 3、初始值有 传入值有 都一样的返回初始值
9862
+ console.log('list', initList, valueList, changeList);
9863
+ // console.log('old', initValue, value, changeValue);
9864
+ // console.log('一样', JSON.stringify(initList) !== JSON.stringify(valueList));
9865
+ // console.log(
9866
+ // '一样2',
9867
+ // JSON.stringify(changeList) !== JSON.stringify(valueList),
9868
+ // );
9869
+ if (!(!initList.length && !valueList.length)) {
9870
+ _context.next = 8;
9871
+ break;
9872
+ }
9873
+ return _context.abrupt("return");
9874
+ case 8:
9875
+ if (!(JSON.stringify(initList) === JSON.stringify(valueList))) {
9876
+ _context.next = 14;
9877
+ break;
9878
+ }
9879
+ initSnapshotList = initValue.reduce(function (prv, next) {
9880
+ prv += next.trajectorySnapshot;
9881
+ return prv;
9882
+ }, '');
9883
+ valueSnapshotList = value.reduce(function (prv, next) {
9884
+ prv += next.trajectorySnapshot;
9885
+ return prv;
9886
+ }, '');
9887
+ if (initSnapshotList === valueSnapshotList) {
9888
+ hasSave.current = false;
9889
+ setNewValue(value);
9890
+ } else if (!hasSave.current) {
9891
+ hasSave.current = true;
9892
+ setNewValue(initValue);
9893
+ onChange(initValue);
9894
+ }
9895
+ _context.next = 30;
9896
+ break;
9897
+ case 14:
9898
+ if (!(
9899
+ //开启了物流快照才会获取快照信息
9900
+ hasSnapshot && JSON.stringify(initList) !== JSON.stringify(valueList) && JSON.stringify(changeList) !== JSON.stringify(valueList))) {
9901
+ _context.next = 29;
9902
+ break;
9903
+ }
9904
+ hasSave.current = false;
9905
+ hasValue = valueList.some(function (item) {
9906
+ return item.trajectoryCompany && item.trajectoryCode;
9907
+ });
9908
+ listValue = cloneDeep(value);
9909
+ if (!hasValue) {
9910
+ _context.next = 24;
9911
+ break;
9912
+ }
9913
+ requestList = valueList.map(function (item) {
9914
+ if (item.trajectoryCode && item.trajectoryCompany) {
9915
+ return extendRequest('/qy/logistics/logisticsTraceSearch', {
9916
+ method: 'post',
9917
+ data: {
9918
+ mailNo: item.trajectoryCode,
9919
+ cpCode: item.trajectoryCompany,
9920
+ mobile: item.trajectoryPhone
9921
+ }
9922
+ });
9923
+ } else {
9924
+ return new Promise(function (resolve) {
9925
+ resolve({});
9926
+ });
9927
+ }
9928
+ });
9929
+ _context.next = 22;
9930
+ return Promise.allSettled(requestList);
9931
+ case 22:
9932
+ requestValues = _context.sent;
9933
+ listValue = cloneDeep(value).map(function (item, index) {
9934
+ var _requestValues$index, _requestValues$index$, _requestValues$index$2;
9935
+ return _objectSpread2(_objectSpread2({}, item), {}, {
9936
+ trajectorySnapshot: (_requestValues$index = requestValues[index]) === null || _requestValues$index === void 0 ? void 0 : (_requestValues$index$ = _requestValues$index.value) === null || _requestValues$index$ === void 0 ? void 0 : (_requestValues$index$2 = _requestValues$index$.data) === null || _requestValues$index$2 === void 0 ? void 0 : _requestValues$index$2.logisticsStatusDesc
9937
+ });
9938
+ });
9939
+ case 24:
9940
+ setChangeValue(listValue);
9941
+ setNewValue(listValue);
9942
+ onChange(listValue);
9943
+ _context.next = 30;
9944
+ break;
9945
+ case 29:
9946
+ setNewValue(value);
9947
+ case 30:
9948
+ case "end":
9949
+ return _context.stop();
9950
+ }
9951
+ }, _callee);
9952
+ }));
9953
+ return function initHandle(_x) {
9954
+ return _ref2.apply(this, arguments);
9955
+ };
9956
+ }();
9957
+ var handleChange = function handleChange(val, index) {
9958
+ var newValue = cloneDeep(value);
9959
+ newValue.splice(index, 1, val);
9960
+ onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
9961
+ setChangeValue(newValue);
9962
+ setNewValue(newValue);
9963
+ };
9964
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, {
9965
+ wrap: true
9966
+ }, (newValue || []).map(function (item, index) {
9967
+ return /*#__PURE__*/React.createElement("span", {
9968
+ style: {
9969
+ color: changeIndex === index ? '#4569d4' : 'black',
9970
+ cursor: 'pointer'
9971
+ },
9972
+ onClick: function onClick() {
9973
+ return setChangeIndex(index);
9974
+ }
9975
+ }, "\u5305\u88F9".concat(index + 1));
9976
+ })), /*#__PURE__*/React.createElement(LogisticsTrajectory, {
9977
+ value: newValue[changeIndex],
9978
+ showField: showField,
9979
+ disabled: disabled,
9980
+ onChange: function onChange(val) {
9981
+ return handleChange(val, changeIndex);
9982
+ }
9983
+ }));
9984
+ };
9985
+
9758
9986
  //组件类型的默认值
9759
9987
  var typeInitValueMap = {
9760
9988
  1: [{
@@ -10156,9 +10384,42 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10156
10384
  var rowSelection = {
10157
10385
  selectedRowKeys: selectIds,
10158
10386
  fixed: true,
10159
- onChange: function onChange(selectedRowKeys, selectedRows, info) {
10160
- setSelectIds(selectedRowKeys);
10161
- setSelect(_toConsumableArray(selectedRows));
10387
+ // onChange: (
10388
+ // selectedRowKeys: React.SetStateAction<string[]>,
10389
+ // selectedRows: any[],
10390
+ // info: any,
10391
+ // ) => {
10392
+ // setSelectIds(selectedRowKeys);
10393
+ // setSelect([...selectedRows]);
10394
+ // },
10395
+ onSelect: function onSelect(record, selected) {
10396
+ if (selected) {
10397
+ setSelectIds([].concat(_toConsumableArray(selectIds), [record.skuCode]));
10398
+ setSelect([].concat(_toConsumableArray(selectList), [record]));
10399
+ } else {
10400
+ setSelectIds(selectIds.filter(function (t) {
10401
+ return t !== record.skuCode;
10402
+ }));
10403
+ setSelect(selectList.filter(function (t) {
10404
+ return t.skuCode !== record.skuCode;
10405
+ }));
10406
+ }
10407
+ },
10408
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
10409
+ if (selected) {
10410
+ setSelectIds([].concat(_toConsumableArray(selectIds), _toConsumableArray(changeRows.map(function (t) {
10411
+ return t.skuCode;
10412
+ }))));
10413
+ setSelect([].concat(_toConsumableArray(selectList), _toConsumableArray(changeRows)));
10414
+ } else {
10415
+ setSelectIds(difference(selectIds, changeRows.map(function (t) {
10416
+ return t.skuCode;
10417
+ })));
10418
+ var list = differenceWith(selectList, changeRows, function (arrVal, othVal) {
10419
+ return arrVal.skuCode !== othVal.skuCode;
10420
+ });
10421
+ setSelect(list);
10422
+ }
10162
10423
  }
10163
10424
  };
10164
10425
  var initData = function initData(list) {
@@ -10246,6 +10507,86 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10246
10507
  });
10247
10508
  }
10248
10509
  };
10510
+ var showTable = function showTable() {
10511
+ var handleDelete = function handleDelete(record, index) {
10512
+ setSelectIds(selectIds.filter(function (t) {
10513
+ return t !== record.skuCode;
10514
+ }));
10515
+ setSelect(selectList.filter(function (t) {
10516
+ return t.skuCode !== record.skuCode;
10517
+ }));
10518
+ };
10519
+ var showColumns = [{
10520
+ dataIndex: '',
10521
+ title: "\u64CD\u4F5C",
10522
+ ellipsis: true,
10523
+ width: 100,
10524
+ render: function render(val, record, index) {
10525
+ return /*#__PURE__*/React.createElement(Button, {
10526
+ type: "link",
10527
+ onClick: function onClick() {
10528
+ return handleDelete(record);
10529
+ }
10530
+ }, "\u5220\u9664");
10531
+ }
10532
+ }, {
10533
+ dataIndex: 'skuName',
10534
+ title: '商品sku名称',
10535
+ with: 200,
10536
+ ellipsis: true
10537
+ }, {
10538
+ dataIndex: 'skuCode',
10539
+ title: '商品sku编码',
10540
+ with: 200,
10541
+ ellipsis: true
10542
+ }, {
10543
+ dataIndex: 'name',
10544
+ title: '商品名称',
10545
+ with: 200,
10546
+ ellipsis: true
10547
+ }, {
10548
+ dataIndex: 'goodsId',
10549
+ title: '商品id',
10550
+ with: 200,
10551
+ ellipsis: true
10552
+ }, {
10553
+ dataIndex: 'code',
10554
+ title: '商品编码',
10555
+ with: 200,
10556
+ render: function render(val) {
10557
+ return /*#__PURE__*/React.createElement("div", {
10558
+ style: {
10559
+ width: '100px'
10560
+ }
10561
+ }, val);
10562
+ }
10563
+ }, {
10564
+ dataIndex: 'marketPrice',
10565
+ title: '市场价',
10566
+ render: function render(val) {
10567
+ return /*#__PURE__*/React.createElement("div", {
10568
+ style: {
10569
+ width: '70px'
10570
+ }
10571
+ }, val);
10572
+ }
10573
+ }];
10574
+ return selectList.length ? /*#__PURE__*/React.createElement(Table, {
10575
+ columns: showColumns,
10576
+ rowKey: 'skuCode',
10577
+ dataSource: selectList,
10578
+ scroll: {
10579
+ x: true,
10580
+ y: 250
10581
+ },
10582
+ pagination: {
10583
+ size: 'small',
10584
+ total: selectIds.length,
10585
+ pageSize: pageSize,
10586
+ showSizeChanger: false
10587
+ }
10588
+ }) : null;
10589
+ };
10249
10590
  return /*#__PURE__*/React.createElement(Modal, {
10250
10591
  title: '选择商品',
10251
10592
  okText: '确认',
@@ -10327,60 +10668,466 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10327
10668
  total: total,
10328
10669
  current: pageNo,
10329
10670
  pageSize: pageSize,
10330
- pageSizeOptions: [],
10671
+ showSizeChanger: false,
10672
+ showQuickJumper: true,
10331
10673
  onChange: pageChange
10332
10674
  }
10333
- })));
10675
+ }), /*#__PURE__*/React.createElement(Popover, {
10676
+ content: showTable(),
10677
+ title: "\u5DF2\u9009\u62E9".concat(selectIds.length, "\u4E2A\u5546\u54C1")
10678
+ }, /*#__PURE__*/React.createElement(Button, {
10679
+ danger: true,
10680
+ type: "text"
10681
+ }, "\u5DF2\u9009\u62E9\u5546\u54C1(".concat(selectIds.length > 99 ? '99+' : selectIds.length, ")"), /*#__PURE__*/React.createElement(CaretUpOutlined, null)))));
10334
10682
  };
10335
10683
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
10336
10684
 
10337
- // interface GoodsItem {
10338
- // title: string;
10339
- // pic: string;
10340
- // platform: string;
10341
- // skuId: string;
10342
- // styleId: string;
10343
- // }
10344
- var GoodItem = function GoodItem(props) {
10345
- var _props$value = props.value,
10346
- value = _props$value === void 0 ? [] : _props$value,
10347
- type = props.type,
10348
- onChange = props.onChange,
10349
- disabled = props.disabled,
10350
- _props$showHeader = props.showHeader,
10351
- showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
10685
+ var RangePicker = DatePicker.RangePicker;
10686
+ var columns$1 = [{
10687
+ dataIndex: 'index',
10688
+ title: 'NO',
10689
+ render: function render(val, record, index) {
10690
+ return /*#__PURE__*/React.createElement("div", {
10691
+ style: {
10692
+ width: 25
10693
+ }
10694
+ }, index + 1);
10695
+ }
10696
+ }, {
10697
+ dataIndex: 'goodName',
10698
+ title: '商品名称',
10699
+ with: 200,
10700
+ ellipsis: true
10701
+ }, {
10702
+ dataIndex: 'goodNo',
10703
+ title: '商品spu编码',
10704
+ with: 200,
10705
+ ellipsis: true
10706
+ }, {
10707
+ dataIndex: 'goodId',
10708
+ title: 'SPUID',
10709
+ with: 200,
10710
+ ellipsis: true
10711
+ }, {
10712
+ dataIndex: 'specCount',
10713
+ title: '规格数',
10714
+ with: 200,
10715
+ ellipsis: true
10716
+ }];
10717
+ var expandedColumns = [{
10718
+ dataIndex: 'specName',
10719
+ title: '商品sku名称',
10720
+ with: 200,
10721
+ ellipsis: true
10722
+ }, {
10723
+ dataIndex: 'specNo',
10724
+ title: '商品sku编码',
10725
+ with: 200,
10726
+ ellipsis: true
10727
+ }, {
10728
+ dataIndex: 'specId',
10729
+ title: 'SKUID',
10730
+ with: 200,
10731
+ ellipsis: true
10732
+ }, {
10733
+ dataIndex: 'imgUrl',
10734
+ title: '商品图片',
10735
+ with: 200,
10736
+ render: function render(picUrl) {
10737
+ return /*#__PURE__*/React.createElement("img", {
10738
+ style: {
10739
+ width: '40px',
10740
+ height: '40px',
10741
+ objectFit: 'contain'
10742
+ },
10743
+ src: picUrl
10744
+ });
10745
+ }
10746
+ }, {
10747
+ dataIndex: 'marketPrice',
10748
+ title: '市场价'
10749
+ }, {
10750
+ dataIndex: 'retailPrice',
10751
+ title: '零售价'
10752
+ }, {
10753
+ dataIndex: 'memberPrice',
10754
+ title: '会员价'
10755
+ }];
10756
+ var dateFormat = 'YYYY-MM-DD HH:mm:ss';
10757
+ var GoodsModal$3 = function GoodsModal(props, ref) {
10758
+ useImperativeHandle(ref, function () {
10759
+ return {
10760
+ open: function open(shopCode) {
10761
+ setVisible(true);
10762
+ setPageNo(1);
10763
+ setSelect([]);
10764
+ setSelectIds([]);
10765
+ queryItems(shopCode);
10766
+ // getShopList();
10767
+ }
10768
+ };
10769
+ });
10770
+
10771
+ var onSubmit = props.onSubmit,
10772
+ shopId = props.shopId,
10773
+ shopList = props.shopList,
10352
10774
  width = props.width,
10353
- _props$shopList = props.shopList,
10354
- shopList = _props$shopList === void 0 ? [] : _props$shopList,
10355
- _props$shopId = props.shopId,
10356
- shopId = _props$shopId === void 0 ? '' : _props$shopId,
10357
- _props$maxLength = props.maxLength,
10358
- maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
10359
- _props$showChangeBtn = props.showChangeBtn,
10360
- showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
10361
- _props$tableSelect = props.tableSelect,
10362
- tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
10363
- _props$selectType = props.selectType,
10364
- selectType = _props$selectType === void 0 ? '' : _props$selectType,
10365
- _props$otherOperation = props.otherOperations,
10366
- otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
10367
- _props$canUpdateNumbe = props.canUpdateNumber,
10368
- canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
10369
- shopCode = props.shopCode,
10370
- _props$companyKey = props.companyKey,
10371
- companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
10372
- onSelect = props.onSelect,
10373
- onDelete = props.onDelete;
10374
- var refModal = useRef();
10375
- var handleDelete = function handleDelete(record, index) {
10376
- onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
10377
- var newList = _toConsumableArray(value).filter(function (item, i) {
10378
- return index !== i;
10775
+ companyKey = props.companyKey;
10776
+ var _useState = useState(false),
10777
+ _useState2 = _slicedToArray(_useState, 2),
10778
+ visible = _useState2[0],
10779
+ setVisible = _useState2[1];
10780
+ var _useState3 = useState([]),
10781
+ _useState4 = _slicedToArray(_useState3, 2),
10782
+ selectList = _useState4[0],
10783
+ setSelect = _useState4[1];
10784
+ var _useState5 = useState([]),
10785
+ _useState6 = _slicedToArray(_useState5, 2),
10786
+ selectIds = _useState6[0],
10787
+ setSelectIds = _useState6[1];
10788
+ var _useState7 = useState(1),
10789
+ _useState8 = _slicedToArray(_useState7, 2),
10790
+ pageNo = _useState8[0],
10791
+ setPageNo = _useState8[1];
10792
+ var _useState9 = useState(20),
10793
+ _useState10 = _slicedToArray(_useState9, 1),
10794
+ pageSize = _useState10[0];
10795
+ var _useState11 = useState([]),
10796
+ _useState12 = _slicedToArray(_useState11, 2),
10797
+ goodList = _useState12[0],
10798
+ setGoodList = _useState12[1];
10799
+ var _useState13 = useState(false),
10800
+ _useState14 = _slicedToArray(_useState13, 2),
10801
+ loading = _useState14[0],
10802
+ setLoading = _useState14[1];
10803
+ var _useState15 = useState(0),
10804
+ _useState16 = _slicedToArray(_useState15, 2),
10805
+ total = _useState16[0],
10806
+ setTotal = _useState16[1];
10807
+ var _useState17 = useState(hooks().subtract(1, 'M').format(dateFormat)),
10808
+ _useState18 = _slicedToArray(_useState17, 2),
10809
+ startTime = _useState18[0],
10810
+ setStartTime = _useState18[1];
10811
+ var _useState19 = useState(hooks().format(dateFormat)),
10812
+ _useState20 = _slicedToArray(_useState19, 2),
10813
+ endTime = _useState20[0],
10814
+ setEndTime = _useState20[1];
10815
+ var displaySelectList = useMemo(function () {
10816
+ return selectList.map(function (item, i) {
10817
+ item.index = i + 1;
10818
+ return item;
10379
10819
  });
10380
- onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
10820
+ }, [selectList]);
10821
+ var _Form$useForm = Form.useForm(),
10822
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
10823
+ form = _Form$useForm2[0];
10824
+ //选择页码
10825
+ var pageChange = function pageChange(page) {
10826
+ setPageNo(page);
10827
+ queryItems();
10381
10828
  };
10382
- var _useState = useState([]),
10383
- _useState2 = _slicedToArray(_useState, 2),
10829
+ /**
10830
+ * 查询商品
10831
+ */
10832
+ var queryItems = /*#__PURE__*/function () {
10833
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
10834
+ var search,
10835
+ params,
10836
+ res,
10837
+ _res$data$productList,
10838
+ productList,
10839
+ newProducts,
10840
+ _args = arguments;
10841
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
10842
+ while (1) switch (_context.prev = _context.next) {
10843
+ case 0:
10844
+ search = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
10845
+ _context.prev = 1;
10846
+ setLoading(true);
10847
+ params = {
10848
+ // shopCode: shopCode,
10849
+ pageSize: pageSize,
10850
+ pageNo: pageNo - 1,
10851
+ specNo: search.code,
10852
+ startTime: startTime,
10853
+ endTime: endTime
10854
+ };
10855
+ _context.next = 6;
10856
+ return extendRequest('/qy/gdfw/product/wdtListProduct', {
10857
+ method: 'post',
10858
+ data: params
10859
+ });
10860
+ case 6:
10861
+ res = _context.sent;
10862
+ if (res.success) {
10863
+ _res$data$productList = res.data.productList, productList = _res$data$productList === void 0 ? [] : _res$data$productList;
10864
+ newProducts = productList.map(function (item, index) {
10865
+ return _objectSpread2(_objectSpread2({}, item), {}, {
10866
+ index: index + 1
10867
+ });
10868
+ });
10869
+ initData(_toConsumableArray(newProducts));
10870
+ }
10871
+ case 8:
10872
+ _context.prev = 8;
10873
+ setLoading(false);
10874
+ return _context.finish(8);
10875
+ case 11:
10876
+ case "end":
10877
+ return _context.stop();
10878
+ }
10879
+ }, _callee, null, [[1,, 8, 11]]);
10880
+ }));
10881
+ return function queryItems() {
10882
+ return _ref.apply(this, arguments);
10883
+ };
10884
+ }();
10885
+ var initData = function initData(list) {
10886
+ setGoodList(_toConsumableArray(list));
10887
+ setTotal(list.length);
10888
+ setPageNo(1);
10889
+ };
10890
+ var _onCancel = function onCancel() {
10891
+ onReset();
10892
+ setVisible(false);
10893
+ };
10894
+ var onOk = function onOk() {
10895
+ onSubmit(selectList);
10896
+ _onCancel();
10897
+ };
10898
+ var onFinish = function onFinish(fieldsValue) {
10899
+ var searchValue = {
10900
+ code: fieldsValue.code
10901
+ };
10902
+ queryItems(searchValue);
10903
+ };
10904
+ var onReset = function onReset() {
10905
+ form.resetFields();
10906
+ initData([]);
10907
+ };
10908
+ // const getShopList = async () => {
10909
+ // const { success, data } = await request('/qy/diamond/getConfigInfo', {
10910
+ // method: 'get',
10911
+ // params: {
10912
+ // key: 'company-third-shop-info',
10913
+ // },
10914
+ // });
10915
+ // const obj: any = JSON.parse(data || '{}');
10916
+ // if (success) {
10917
+ // const list = (obj?.[companyKey] || []).map((item: any) => {
10918
+ // return {
10919
+ // label: item.shopName,
10920
+ // value: item.shopCode,
10921
+ // };
10922
+ // });
10923
+ // setShopList(list);
10924
+ // }
10925
+ // };
10926
+ var onValuesChange = function onValuesChange(changedValues) {
10927
+ if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
10928
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
10929
+ pubsub.publish('changeShopCode', {
10930
+ shopCode: changedValues.shopId
10931
+ });
10932
+ }
10933
+ if (Array.isArray(changedValues.dateTimePicker)) {
10934
+ setStartTime(changedValues.dateTimePicker[0].format(dateFormat));
10935
+ setEndTime(changedValues.dateTimePicker[1].format(dateFormat));
10936
+ }
10937
+ };
10938
+ var handleDelete = function handleDelete(record, index) {
10939
+ var newSelectList = selectList.filter(function (item) {
10940
+ return item.specId !== record.specId;
10941
+ });
10942
+ setSelect(_toConsumableArray(newSelectList));
10943
+ setSelectIds(_toConsumableArray(newSelectList.map(function (item) {
10944
+ return item.specId;
10945
+ })));
10946
+ };
10947
+ var displaySelectedColumns = [{
10948
+ dataIndex: 'operation',
10949
+ title: '',
10950
+ render: function render(_, record, index) {
10951
+ return /*#__PURE__*/React.createElement(DeleteOutlined, {
10952
+ onClick: function onClick() {
10953
+ return handleDelete(record);
10954
+ }
10955
+ });
10956
+ }
10957
+ }, {
10958
+ dataIndex: 'index',
10959
+ title: 'NO',
10960
+ render: function render(val, record, index) {
10961
+ return /*#__PURE__*/React.createElement("div", {
10962
+ style: {
10963
+ width: 25
10964
+ }
10965
+ }, index + 1);
10966
+ }
10967
+ }];
10968
+ var expandedRowSelection = {
10969
+ fixed: true,
10970
+ selectedRowKeys: selectIds,
10971
+ onSelect: function onSelect(record, selected, selectedRows, nativeEvent) {
10972
+ var tempList = [];
10973
+ if (selected) {
10974
+ tempList = [].concat(_toConsumableArray(selectList), [record]);
10975
+ } else {
10976
+ tempList = selectList.filter(function (item) {
10977
+ return item.specId !== record.specId;
10978
+ });
10979
+ }
10980
+ setSelect(_toConsumableArray(tempList));
10981
+ setSelectIds(_toConsumableArray(tempList.map(function (item) {
10982
+ return item.specId;
10983
+ })));
10984
+ },
10985
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
10986
+ var tempAllList = [];
10987
+ if (selected) {
10988
+ tempAllList = [].concat(_toConsumableArray(selectList), _toConsumableArray(selectedRows.filter(Boolean)));
10989
+ } else {
10990
+ tempAllList = selectList.filter(function (list) {
10991
+ return changeRows.filter(Boolean).every(function (item) {
10992
+ return list.specId !== item.specId;
10993
+ });
10994
+ });
10995
+ }
10996
+ setSelect(_toConsumableArray(tempAllList));
10997
+ setSelectIds(_toConsumableArray(tempAllList.map(function (item) {
10998
+ return item.specId;
10999
+ })));
11000
+ }
11001
+ };
11002
+ var expandedRowRender = function expandedRowRender(record, index, indent, expanded) {
11003
+ return /*#__PURE__*/React.createElement(Table, {
11004
+ rowKey: 'specId',
11005
+ size: 'small',
11006
+ columns: expandedColumns,
11007
+ dataSource: record.itemDetailList || [],
11008
+ pagination: false,
11009
+ rowSelection: expandedRowSelection
11010
+ });
11011
+ };
11012
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
11013
+ title: '选择商品',
11014
+ okText: '确认',
11015
+ cancelText: '取消',
11016
+ visible: visible,
11017
+ width: width || 850,
11018
+ onCancel: function onCancel() {
11019
+ _onCancel();
11020
+ },
11021
+ onOk: onOk,
11022
+ wrapClassName: "goodModal"
11023
+ }, /*#__PURE__*/React.createElement(Form, {
11024
+ layout: "inline",
11025
+ form: form,
11026
+ onFinish: onFinish,
11027
+ onValuesChange: onValuesChange
11028
+ }, /*#__PURE__*/React.createElement(Form.Item, {
11029
+ name: "dateTimePicker"
11030
+ }, /*#__PURE__*/React.createElement(RangePicker, {
11031
+ placeholder: ['开始日期', '结束日期'],
11032
+ showTime: true,
11033
+ defaultValue: [hooks(startTime, dateFormat), hooks(endTime, dateFormat)]
11034
+ })), /*#__PURE__*/React.createElement(Form.Item, {
11035
+ name: "code"
11036
+ }, /*#__PURE__*/React.createElement(Input, {
11037
+ placeholder: "\u5546\u54C1\u7F16\u7801",
11038
+ allowClear: true,
11039
+ style: {
11040
+ width: 150
11041
+ }
11042
+ })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
11043
+ type: "primary",
11044
+ htmlType: "submit"
11045
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
11046
+ onClick: onReset
11047
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement(Spin, {
11048
+ spinning: loading
11049
+ }, /*#__PURE__*/React.createElement(Table, {
11050
+ rowKey: 'goodNo',
11051
+ columns: columns$1,
11052
+ dataSource: goodList,
11053
+ scroll: {
11054
+ x: true,
11055
+ y: 250
11056
+ },
11057
+ expandable: {
11058
+ expandedRowRender: expandedRowRender
11059
+ },
11060
+ pagination: {
11061
+ size: 'small',
11062
+ total: total,
11063
+ current: pageNo,
11064
+ pageSize: pageSize,
11065
+ pageSizeOptions: [],
11066
+ onChange: pageChange
11067
+ }
11068
+ })), !!selectList.length && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Space, null, "\u5DF2\u7ECF\u9009\u62E9\u5546\u54C1\uFF08", selectList.length, "\uFF09"), /*#__PURE__*/React.createElement(Space, null, /*#__PURE__*/React.createElement(Table, {
11069
+ rowKey: 'specId',
11070
+ columns: [].concat(displaySelectedColumns, expandedColumns),
11071
+ dataSource: displaySelectList,
11072
+ pagination: false,
11073
+ scroll: {
11074
+ x: true,
11075
+ y: 250
11076
+ },
11077
+ style: {
11078
+ width: '100%'
11079
+ }
11080
+ })))));
11081
+ };
11082
+ var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
11083
+
11084
+ // interface GoodsItem {
11085
+ // title: string;
11086
+ // pic: string;
11087
+ // platform: string;
11088
+ // skuId: string;
11089
+ // styleId: string;
11090
+ // }
11091
+ var GoodItem = function GoodItem(props) {
11092
+ var _props$value = props.value,
11093
+ value = _props$value === void 0 ? [] : _props$value,
11094
+ type = props.type,
11095
+ onChange = props.onChange,
11096
+ disabled = props.disabled,
11097
+ _props$showHeader = props.showHeader,
11098
+ showHeader = _props$showHeader === void 0 ? [] : _props$showHeader,
11099
+ width = props.width,
11100
+ _props$shopList = props.shopList,
11101
+ shopList = _props$shopList === void 0 ? [] : _props$shopList,
11102
+ _props$shopId = props.shopId,
11103
+ shopId = _props$shopId === void 0 ? '' : _props$shopId,
11104
+ _props$maxLength = props.maxLength,
11105
+ maxLength = _props$maxLength === void 0 ? 20 : _props$maxLength,
11106
+ _props$showChangeBtn = props.showChangeBtn,
11107
+ showChangeBtn = _props$showChangeBtn === void 0 ? true : _props$showChangeBtn,
11108
+ _props$tableSelect = props.tableSelect,
11109
+ tableSelect = _props$tableSelect === void 0 ? false : _props$tableSelect,
11110
+ _props$selectType = props.selectType,
11111
+ selectType = _props$selectType === void 0 ? '' : _props$selectType,
11112
+ _props$otherOperation = props.otherOperations,
11113
+ otherOperations = _props$otherOperation === void 0 ? null : _props$otherOperation,
11114
+ _props$canUpdateNumbe = props.canUpdateNumber,
11115
+ canUpdateNumber = _props$canUpdateNumbe === void 0 ? false : _props$canUpdateNumbe,
11116
+ shopCode = props.shopCode,
11117
+ _props$companyKey = props.companyKey,
11118
+ companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
11119
+ onSelect = props.onSelect,
11120
+ onDelete = props.onDelete;
11121
+ var refModal = useRef();
11122
+ var handleDelete = function handleDelete(record, index) {
11123
+ onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
11124
+ var newList = _toConsumableArray(value).filter(function (item, i) {
11125
+ return index !== i;
11126
+ });
11127
+ onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(newList));
11128
+ };
11129
+ var _useState = useState([]),
11130
+ _useState2 = _slicedToArray(_useState, 2),
10384
11131
  selectedRowKeys = _useState2[0],
10385
11132
  setSelectedRowKeys = _useState2[1];
10386
11133
  useEffect(function () {
@@ -10394,184 +11141,198 @@ var GoodItem = function GoodItem(props) {
10394
11141
  };
10395
11142
  var COLUMNS_MAP = function COLUMNS_MAP() {
10396
11143
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10397
- return {
10398
- DEFAULT: [{
10399
- dataIndex: 'mark',
10400
- title: "\u5546\u54C1\u6807\u8BB0",
10401
- align: 'center',
10402
- ellipsis: true,
10403
- width: 70,
10404
- render: function render(val, record, index) {
10405
- return /*#__PURE__*/React.createElement(Select, {
10406
- options: [{
10407
- label: '是',
10408
- value: '是'
10409
- }, {
10410
- label: '否',
10411
- value: ''
10412
- }],
10413
- disabled: disabled,
10414
- value: val,
10415
- onChange: function onChange(val) {
10416
- return updateHandle(val, index, 'mark');
11144
+ return function (type) {
11145
+ var columns = [];
11146
+ switch (type) {
11147
+ case 'WDT_REISSUE_GOODS':
11148
+ case 'WDT_GOODS':
11149
+ columns = [{
11150
+ dataIndex: 'goodId',
11151
+ title: "SPUID",
11152
+ align: 'center',
11153
+ ellipsis: true,
11154
+ width: 70
11155
+ }, {
11156
+ dataIndex: 'goodNo',
11157
+ title: "SPU\u5546\u54C1\u7F16\u7801",
11158
+ align: 'center',
11159
+ ellipsis: true,
11160
+ width: 100
11161
+ }, {
11162
+ dataIndex: 'specId',
11163
+ title: "".concat(text, "SKUID"),
11164
+ align: 'center',
11165
+ ellipsis: true,
11166
+ width: 100
11167
+ }, {
11168
+ dataIndex: 'goodName',
11169
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11170
+ align: 'center',
11171
+ ellipsis: true,
11172
+ width: 250
11173
+ }, {
11174
+ dataIndex: 'specNo',
11175
+ title: "".concat(text, "sku\u7F16\u7801"),
11176
+ align: 'center',
11177
+ ellipsis: true,
11178
+ width: 100
11179
+ }, {
11180
+ dataIndex: 'specName',
11181
+ title: "".concat(text, "sku\u540D\u79F0"),
11182
+ align: 'center',
11183
+ ellipsis: true,
11184
+ width: 250
11185
+ }, {
11186
+ dataIndex: 'orderPrice',
11187
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11188
+ align: 'center',
11189
+ ellipsis: true,
11190
+ width: 100
11191
+ }, {
11192
+ dataIndex: 'num',
11193
+ title: "".concat(text, "\u4E0B\u5355\u6570\u91CF"),
11194
+ align: 'center',
11195
+ ellipsis: true,
11196
+ width: 100,
11197
+ render: function render(val, record, index) {
11198
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11199
+ style: {
11200
+ width: 70
11201
+ },
11202
+ value: val,
11203
+ min: 0,
11204
+ precision: 0,
11205
+ onChange: function onChange(num) {
11206
+ return updateHandle(num, index, 'number');
11207
+ }
11208
+ }) : /*#__PURE__*/React.createElement("span", null, val);
10417
11209
  }
10418
- });
10419
- }
10420
- }, {
10421
- dataIndex: 'skuName',
10422
- title: "".concat(text, "sku\u540D\u79F0"),
10423
- align: 'center',
10424
- ellipsis: true,
10425
- width: 250
10426
- }, {
10427
- dataIndex: 'sku',
10428
- title: "".concat(text, "sku\u7F16\u7801"),
10429
- align: 'center',
10430
- ellipsis: true,
10431
- width: 100
10432
- }, {
10433
- dataIndex: 'name',
10434
- title: "".concat(text, "\u540D\u79F0"),
10435
- align: 'center',
10436
- ellipsis: true,
10437
- width: 250
10438
- }, {
10439
- dataIndex: 'pic',
10440
- title: "\u56FE\u7247",
10441
- align: 'center',
10442
- ellipsis: true,
10443
- width: 100,
10444
- render: function render(val) {
10445
- return /*#__PURE__*/React.createElement(Image, {
10446
- width: 60,
10447
- src: val
10448
- });
10449
- }
10450
- }, {
10451
- dataIndex: 'code',
10452
- title: "".concat(text, "\u7F16\u7801"),
10453
- align: 'center',
10454
- ellipsis: true,
10455
- width: 100
10456
- }, {
10457
- dataIndex: 'money',
10458
- title: "\u5B9E\u4ED8\u91D1\u989D",
10459
- align: 'center',
10460
- ellipsis: true,
10461
- width: 100
10462
- }, {
10463
- dataIndex: 'number',
10464
- title: "".concat(text, "\u6570\u91CF"),
10465
- align: 'center',
10466
- ellipsis: true,
10467
- width: 100,
10468
- render: function render(val, record, index) {
10469
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
10470
- style: {
10471
- width: 70
10472
- },
10473
- value: val,
10474
- min: 0,
10475
- precision: 0,
10476
- onChange: function onChange(num) {
10477
- return updateHandle(num, index, 'number');
11210
+ }, {
11211
+ dataIndex: 'actualNum',
11212
+ title: "".concat(text, "\u5B9E\u53D1\u6570\u91CF"),
11213
+ align: 'center',
11214
+ ellipsis: true,
11215
+ width: 100
11216
+ }, {
11217
+ dataIndex: 'sharePrice',
11218
+ title: "\u5206\u644A\u4EF7",
11219
+ align: 'center',
11220
+ ellipsis: true,
11221
+ width: 70
11222
+ }, {
11223
+ dataIndex: 'giftType',
11224
+ title: "\u8D60\u54C1\u7C7B\u578B",
11225
+ align: 'center',
11226
+ ellipsis: true,
11227
+ width: 100
11228
+ }];
11229
+ break;
11230
+ default:
11231
+ columns = [{
11232
+ dataIndex: 'mark',
11233
+ title: "\u5546\u54C1\u6807\u8BB0",
11234
+ align: 'center',
11235
+ ellipsis: true,
11236
+ width: 70,
11237
+ render: function render(val, record, index) {
11238
+ return /*#__PURE__*/React.createElement(Select, {
11239
+ options: [{
11240
+ label: '是',
11241
+ value: '是'
11242
+ }, {
11243
+ label: '',
11244
+ value: '否'
11245
+ }],
11246
+ disabled: disabled,
11247
+ value: val,
11248
+ onChange: function onChange(val) {
11249
+ return updateHandle(val, index, 'mark');
11250
+ }
11251
+ });
10478
11252
  }
10479
- }) : /*#__PURE__*/React.createElement("span", null, val);
10480
- }
10481
- }, {
10482
- dataIndex: 'share',
10483
- title: "\u5206\u644A\u4EF7",
10484
- align: 'center',
10485
- ellipsis: true,
10486
- width: 70
10487
- }, {
10488
- dataIndex: 'type',
10489
- title: "\u8D60\u54C1\u7C7B\u578B",
10490
- align: 'center',
10491
- ellipsis: true,
10492
- width: 100
10493
- }],
10494
- WDT_REISSUE_GOODS: [{
10495
- dataIndex: 'spuId',
10496
- title: "SPUID",
10497
- align: 'center',
10498
- ellipsis: true,
10499
- width: 70
10500
- }, {
10501
- dataIndex: 'spuSku',
10502
- title: "SPU\u5546\u54C1\u7F16\u7801",
10503
- align: 'center',
10504
- ellipsis: true,
10505
- width: 100
10506
- }, {
10507
- dataIndex: 'skuId',
10508
- title: "".concat(text, "SKUID"),
10509
- align: 'center',
10510
- ellipsis: true,
10511
- width: 100
10512
- }, {
10513
- dataIndex: 'name',
10514
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
10515
- align: 'center',
10516
- ellipsis: true,
10517
- width: 250
10518
- }, {
10519
- dataIndex: 'sku',
10520
- title: "".concat(text, "sku\u7F16\u7801"),
10521
- align: 'center',
10522
- ellipsis: true,
10523
- width: 100
10524
- }, {
10525
- dataIndex: 'skuName',
10526
- title: "".concat(text, "sku\u540D\u79F0"),
10527
- align: 'center',
10528
- ellipsis: true,
10529
- width: 250
10530
- }, {
10531
- dataIndex: 'money',
10532
- title: "\u5B9E\u4ED8\u91D1\u989D",
10533
- align: 'center',
10534
- ellipsis: true,
10535
- width: 100
10536
- }, {
10537
- dataIndex: 'number',
10538
- title: "".concat(text, "\u6570\u91CF"),
10539
- align: 'center',
10540
- ellipsis: true,
10541
- width: 100,
10542
- render: function render(val, record, index) {
10543
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
10544
- style: {
10545
- width: 70
10546
- },
10547
- value: val,
10548
- min: 0,
10549
- precision: 0,
10550
- onChange: function onChange(num) {
10551
- return updateHandle(num, index, 'number');
11253
+ }, {
11254
+ dataIndex: 'skuName',
11255
+ title: "".concat(text, "sku\u540D\u79F0"),
11256
+ align: 'center',
11257
+ ellipsis: true,
11258
+ width: 250
11259
+ }, {
11260
+ dataIndex: 'sku',
11261
+ title: "".concat(text, "sku\u7F16\u7801"),
11262
+ align: 'center',
11263
+ ellipsis: true,
11264
+ width: 100
11265
+ }, {
11266
+ dataIndex: 'name',
11267
+ title: "".concat(text, "\u540D\u79F0"),
11268
+ align: 'center',
11269
+ ellipsis: true,
11270
+ width: 250
11271
+ }, {
11272
+ dataIndex: 'pic',
11273
+ title: "\u56FE\u7247",
11274
+ align: 'center',
11275
+ ellipsis: true,
11276
+ width: 100,
11277
+ render: function render(val) {
11278
+ return /*#__PURE__*/React.createElement(Image, {
11279
+ width: 60,
11280
+ src: val
11281
+ });
10552
11282
  }
10553
- }) : /*#__PURE__*/React.createElement("span", null, val);
10554
- }
10555
- }, {
10556
- dataIndex: 'share',
10557
- title: "\u5206\u644A\u4EF7",
10558
- align: 'center',
10559
- ellipsis: true,
10560
- width: 70
10561
- }, {
10562
- dataIndex: 'type',
10563
- title: "\u8D60\u54C1\u7C7B\u578B",
10564
- align: 'center',
10565
- ellipsis: true,
10566
- width: 100
10567
- }]
11283
+ }, {
11284
+ dataIndex: 'code',
11285
+ title: "".concat(text, "\u7F16\u7801"),
11286
+ align: 'center',
11287
+ ellipsis: true,
11288
+ width: 100
11289
+ }, {
11290
+ dataIndex: 'money',
11291
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11292
+ align: 'center',
11293
+ ellipsis: true,
11294
+ width: 100
11295
+ }, {
11296
+ dataIndex: 'number',
11297
+ title: "".concat(text, "\u6570\u91CF"),
11298
+ align: 'center',
11299
+ ellipsis: true,
11300
+ width: 100,
11301
+ render: function render(val, record, index) {
11302
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11303
+ style: {
11304
+ width: 70
11305
+ },
11306
+ value: val,
11307
+ min: 0,
11308
+ precision: 0,
11309
+ onChange: function onChange(num) {
11310
+ return updateHandle(num, index, 'number');
11311
+ }
11312
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11313
+ }
11314
+ }, {
11315
+ dataIndex: 'share',
11316
+ title: "\u5206\u644A\u4EF7",
11317
+ align: 'center',
11318
+ ellipsis: true,
11319
+ width: 70
11320
+ }, {
11321
+ dataIndex: 'type',
11322
+ title: "\u8D60\u54C1\u7C7B\u578B",
11323
+ align: 'center',
11324
+ ellipsis: true,
11325
+ width: 100
11326
+ }];
11327
+ }
11328
+ return columns;
10568
11329
  };
10569
11330
  };
10570
11331
  //商品信息
10571
11332
  var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
10572
11333
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10573
11334
  var COLUMNS_INFO = COLUMNS_MAP(text);
10574
- return (COLUMNS_INFO === null || COLUMNS_INFO === void 0 ? void 0 : COLUMNS_INFO["".concat(type)]) || COLUMNS_INFO['DEFAULT'];
11335
+ return COLUMNS_INFO(type);
10575
11336
  };
10576
11337
  var newColumns = useMemo(function () {
10577
11338
  var columnList = [{
@@ -10606,30 +11367,38 @@ var GoodItem = function GoodItem(props) {
10606
11367
  return columnList;
10607
11368
  }, [showHeader, value, disabled]);
10608
11369
  var onSubmit = function onSubmit(list) {
10609
- var newList = list.map(function (item) {
10610
- var goodsId = item.goodsId,
10611
- name = item.name,
10612
- code = item.code,
10613
- skuCode = item.skuCode,
10614
- marketPrice = item.marketPrice,
10615
- skuName = item.skuName;
10616
- return {
10617
- id: goodsId,
10618
- mark: '是',
10619
- pic: '',
10620
- skuName: skuName,
10621
- name: name,
10622
- code: code,
10623
- sku: skuCode,
10624
- money: marketPrice || 0,
10625
- share: marketPrice || 0,
10626
- number: 1,
10627
- type: '',
10628
- uuid: uuid(),
10629
- canDelete: true,
10630
- canUpdateNumber: canUpdateNumber
10631
- };
10632
- });
11370
+ var newList = [];
11371
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
11372
+ newList = list.map(function (item) {
11373
+ item.uuid = uuid();
11374
+ return item;
11375
+ });
11376
+ } else {
11377
+ newList = list.map(function (item) {
11378
+ var goodsId = item.goodsId,
11379
+ name = item.name,
11380
+ code = item.code,
11381
+ skuCode = item.skuCode,
11382
+ marketPrice = item.marketPrice,
11383
+ skuName = item.skuName;
11384
+ return {
11385
+ id: goodsId,
11386
+ mark: '是',
11387
+ pic: '',
11388
+ skuName: skuName,
11389
+ name: name,
11390
+ code: code,
11391
+ sku: skuCode,
11392
+ money: marketPrice || 0,
11393
+ share: marketPrice || 0,
11394
+ number: 1,
11395
+ type: '',
11396
+ uuid: uuid(),
11397
+ canDelete: true,
11398
+ canUpdateNumber: canUpdateNumber
11399
+ };
11400
+ });
11401
+ }
10633
11402
  onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
10634
11403
  };
10635
11404
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
@@ -10672,7 +11441,15 @@ var GoodItem = function GoodItem(props) {
10672
11441
  locale: {
10673
11442
  emptyText: '暂无数据'
10674
11443
  }
10675
- })), /*#__PURE__*/React.createElement(GoodsModal$2, {
11444
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11445
+ ref: refModal,
11446
+ onSubmit: onSubmit,
11447
+ width: width,
11448
+ shopList: shopList,
11449
+ shopId: shopId,
11450
+ maxLength: maxLength,
11451
+ companyKey: companyKey
11452
+ }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
10676
11453
  ref: refModal,
10677
11454
  onSubmit: onSubmit,
10678
11455
  width: width,
@@ -11053,23 +11830,51 @@ var BsExchange = function BsExchange(props) {
11053
11830
  }))) : null);
11054
11831
  };
11055
11832
 
11056
- var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
11833
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled", "type"];
11834
+ var typeMap = {
11835
+ BS_REISSUE_GOODS: {
11836
+ key: 'bsReissueGoods',
11837
+ name: 'bs',
11838
+ typeName: 'bsReissueType',
11839
+ reissueSelectList: 'reissueSelectList',
11840
+ reissueSelectListReturn: 'reissueSelectListReturn',
11841
+ reissueDeleteGood: 'reissueDeleteGood',
11842
+ changeShopCode: 'changeShopCode',
11843
+ reissueType: 'reissueType' // pubsub 事件
11844
+ },
11845
+
11846
+ WDT_REISSUE_GOODS: {
11847
+ key: 'wdtReissueGoods',
11848
+ name: '旺店通',
11849
+ typeName: 'wdtReissueType',
11850
+ reissueSelectList: 'wdtReissueSelectList',
11851
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
11852
+ reissueDeleteGood: 'wdtReissueDeleteGood',
11853
+ changeShopCode: 'wdtChangeShopCode',
11854
+ reissueType: 'wdtReissueType' // pubsub 事件
11855
+ }
11856
+ };
11857
+
11057
11858
  var BsReissue = function BsReissue(props) {
11859
+ var _typeMap$type14, _typeMap$type15, _typeMap$type16;
11058
11860
  var value = props.value,
11059
11861
  onChange = props.onChange,
11060
11862
  _props$reasonList = props.reasonList,
11061
11863
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
11062
11864
  disabled = props.disabled,
11865
+ type = props.type,
11063
11866
  other = _objectWithoutProperties(props, _excluded$e);
11064
11867
  var valueRef = useRef({});
11065
11868
  useEffect(function () {
11066
- pubsub.subscribe('reissueSelectList', function (_, data) {
11869
+ var _typeMap$type;
11870
+ pubsub.subscribe("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type = typeMap[type]) === null || _typeMap$type === void 0 ? void 0 : _typeMap$type.reissueSelectList), function (_, data) {
11871
+ var _typeMap$type2;
11067
11872
  // console.log('reissueSelectList', data);
11068
11873
  if (disabled) return;
11069
11874
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11070
11875
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11071
11876
  });
11072
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11877
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type2 = typeMap[type]) === null || _typeMap$type2 === void 0 ? void 0 : _typeMap$type2.key)] = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11073
11878
  item.money = 0;
11074
11879
  item.share = 0;
11075
11880
  item.canUpdateNumber = true;
@@ -11079,13 +11884,15 @@ var BsReissue = function BsReissue(props) {
11079
11884
  });
11080
11885
  }, []);
11081
11886
  useEffect(function () {
11082
- pubsub.subscribe('reissueSelectListReturn', function (_, data) {
11887
+ var _typeMap$type3;
11888
+ pubsub.subscribe("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type3 = typeMap[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.reissueSelectListReturn), function (_, data) {
11889
+ var _typeMap$type4;
11083
11890
  // console.log('reissueSelectListReturn', data);
11084
11891
  if (disabled) return;
11085
11892
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11086
11893
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11087
11894
  });
11088
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11895
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type4 = typeMap[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.key)] = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11089
11896
  item.money = 0;
11090
11897
  item.share = 0;
11091
11898
  item.canUpdateNumber = true;
@@ -11095,39 +11902,43 @@ var BsReissue = function BsReissue(props) {
11095
11902
  });
11096
11903
  }, []);
11097
11904
  useEffect(function () {
11905
+ var _typeMap$type5, _typeMap$type8;
11098
11906
  valueRef.current = value;
11099
- pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
11907
+ pubsub.subscribeOnce("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type5 = typeMap[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.reissueDeleteGood), function (_, data) {
11100
11908
  if (disabled) return;
11101
11909
  if (value) {
11910
+ var _typeMap$type6, _typeMap$type7;
11102
11911
  var newValue = _objectSpread2({}, value);
11103
- newValue.bsReissueGoods = newValue.bsReissueGoods.filter(function (item) {
11912
+ newValue["".concat((_typeMap$type6 = typeMap[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type7 = typeMap[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.key)].filter(function (item) {
11104
11913
  return item.sku !== data;
11105
11914
  });
11106
11915
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11107
11916
  }
11108
11917
  });
11109
- pubsub.subscribeOnce('changeShopCode', function (type, data) {
11918
+ pubsub.subscribeOnce("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type8 = typeMap[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.changeShopCode), function (type, data) {
11110
11919
  onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11111
11920
  shopCode: data.shopCode
11112
11921
  }));
11113
11922
  });
11114
11923
  }, [value, disabled]);
11115
11924
  var changeTypeHandle = function changeTypeHandle(val) {
11925
+ var _typeMap$type9, _typeMap$type10, _typeMap$type11;
11116
11926
  var newValue = _objectSpread2({}, value);
11117
- newValue['bsReissueType'] = val;
11118
- newValue.bsReissueGoods = [];
11927
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type9 = typeMap[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.typeName)] = val;
11928
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type10 = typeMap[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = [];
11119
11929
  if (['2', '4'].includes(val[0])) {
11120
11930
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11121
11931
  valueRef.current = newValue;
11122
11932
  }
11123
- pubsub.publish('reissueType', {
11933
+ pubsub.publish("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type11 = typeMap[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.reissueType), {
11124
11934
  val: val[0],
11125
11935
  goodValue: newValue
11126
11936
  });
11127
11937
  };
11128
11938
  var changeGoodHandle = function changeGoodHandle(val) {
11939
+ var _typeMap$type12;
11129
11940
  var newValue = _objectSpread2({}, value);
11130
- newValue['bsReissueGoods'] = (val || []).map(function (item) {
11941
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type12 = typeMap[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.key)] = (val || []).map(function (item) {
11131
11942
  item.money = 0;
11132
11943
  item.share = 0;
11133
11944
  return item;
@@ -11136,9 +11947,9 @@ var BsReissue = function BsReissue(props) {
11136
11947
  };
11137
11948
  //显示选择商品按钮 原单换不显示选择商品
11138
11949
  var showChangeBtn = useMemo(function () {
11139
- var _value$bsReissueType;
11140
- return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value$bsReissueType = value.bsReissueType) === null || _value$bsReissueType === void 0 ? void 0 : _value$bsReissueType[0]);
11141
- }, [value === null || value === void 0 ? void 0 : value.bsReissueType]);
11950
+ var _value, _typeMap$type13;
11951
+ return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value = value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type13 = typeMap[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.typeName)]) === null || _value === void 0 ? void 0 : _value[0]);
11952
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type14 = typeMap[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.typeName]]);
11142
11953
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
11143
11954
  style: {
11144
11955
  marginBottom: '8px'
@@ -11146,7 +11957,7 @@ var BsReissue = function BsReissue(props) {
11146
11957
  disabled: disabled,
11147
11958
  allowClear: false,
11148
11959
  options: reasonList,
11149
- value: value === null || value === void 0 ? void 0 : value.bsReissueType,
11960
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type15 = typeMap[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.typeName)],
11150
11961
  onChange: function onChange(val) {
11151
11962
  return changeTypeHandle(val);
11152
11963
  }
@@ -11157,7 +11968,7 @@ var BsReissue = function BsReissue(props) {
11157
11968
  canUpdateNumber: showChangeBtn,
11158
11969
  showChangeBtn: showChangeBtn,
11159
11970
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11160
- value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
11971
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type16 = typeMap[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.key)],
11161
11972
  onChange: function onChange(val) {
11162
11973
  return changeGoodHandle(val);
11163
11974
  }
@@ -11412,14 +12223,14 @@ var index$1 = (function (props) {
11412
12223
  return _objectSpread2(_objectSpread2({}, item), {}, {
11413
12224
  billNo: item.tradeNo,
11414
12225
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
11415
- billTag: item.tradeTag
12226
+ billTag: item.tagName
11416
12227
  });
11417
12228
  }),
11418
12229
  showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
11419
12230
  return {
11420
12231
  billNo: item.tradeNo,
11421
12232
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
11422
- billTag: item.tradeTag || '后期补上'
12233
+ billTag: item.tagName
11423
12234
  };
11424
12235
  })
11425
12236
  }));
@@ -11488,13 +12299,164 @@ var WlnGoods = function WlnGoods(props) {
11488
12299
  }));
11489
12300
  };
11490
12301
 
12302
+ var componentMap$1 = {
12303
+ 'WDT_GOODS': {
12304
+ type: 'wdt',
12305
+ key: 'wdtGoods',
12306
+ name: '旺店通',
12307
+ eventNameMap: {
12308
+ type: 'wdtType',
12309
+ selectListReturn: 'wdtSelectListReturn',
12310
+ selectList: 'wdtSelectList',
12311
+ reissueSelectList: 'wdtReissueSelectList',
12312
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12313
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12314
+ changeShopCode: 'wdtChangeShopCode',
12315
+ reissueType: 'wdtReissueType',
12316
+ returnType: 'wdtReturnType',
12317
+ returnSelectListReturn: 'wdtReturnSelectListReturn',
12318
+ deleteGood: 'wdtDeleteGood',
12319
+ returnDeleteGood: 'wdtReturnDeleteGood'
12320
+ }
12321
+ }
12322
+ };
12323
+ var CommonGoods = function CommonGoods(props) {
12324
+ var _withInfo$current3, _withInfo$current4;
12325
+ var value = props.value,
12326
+ disabled = props.disabled,
12327
+ onChange = props.onChange,
12328
+ compType = props.type;
12329
+ var _useState = useState(false),
12330
+ _useState2 = _slicedToArray(_useState, 2),
12331
+ tableSelect = _useState2[0],
12332
+ setTableSelect = _useState2[1];
12333
+ var withInfo = useRef(null);
12334
+ var valueRef = useRef(null);
12335
+ useEffect(function () {
12336
+ valueRef.current = value;
12337
+ }, [value]);
12338
+ useEffect(function () {
12339
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
12340
+ if (disabled) return;
12341
+ // console.log(type, data);
12342
+ withInfo.current = {
12343
+ type: type,
12344
+ val: data.val,
12345
+ goodValue: data.goodValue
12346
+ };
12347
+ setTableSelect(['2', '4'].includes(data.val));
12348
+ if (['1', '3'].includes(data.val)) {
12349
+ var _valueRef$current, _valueRef$current2;
12350
+ pubsub.publish(componentMap$1[compType].eventNameMap.selectListReturn, {
12351
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current[componentMap$1[compType].key]) || []),
12352
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
12353
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12354
+ });
12355
+ }
12356
+ });
12357
+ //补发
12358
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
12359
+ if (disabled) return;
12360
+ withInfo.current = {
12361
+ type: type,
12362
+ val: data.val,
12363
+ goodValue: data.goodValue
12364
+ };
12365
+ setTableSelect(['2', '4'].includes(data.val));
12366
+ if (['1', '3'].includes(data.val)) {
12367
+ var _valueRef$current3, _valueRef$current4;
12368
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueSelectListReturn, {
12369
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current3 = valueRef.current) === null || _valueRef$current3 === void 0 ? void 0 : _valueRef$current3[componentMap$1[compType].key]) || []),
12370
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
12371
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12372
+ });
12373
+ }
12374
+ });
12375
+ //退货
12376
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
12377
+ if (disabled) return;
12378
+ withInfo.current = {
12379
+ type: type,
12380
+ val: data.val,
12381
+ goodValue: data.goodValue
12382
+ };
12383
+ setTableSelect(['2', '4'].includes(data.val));
12384
+ if (['1', '3'].includes(data.val)) {
12385
+ var _valueRef$current5, _valueRef$current6;
12386
+ pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
12387
+ list: cloneDeep((valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current5 = valueRef.current) === null || _valueRef$current5 === void 0 ? void 0 : _valueRef$current5[componentMap$1[compType].key]) || []),
12388
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
12389
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12390
+ });
12391
+ }
12392
+ });
12393
+ pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
12394
+ // console.log(data);
12395
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
12396
+ shopCode: data.shopCode
12397
+ }));
12398
+ });
12399
+ return function () {
12400
+ pubsub.clearAllSubscriptions();
12401
+ };
12402
+ }, [disabled]);
12403
+ var _onSelect = function onSelect(list) {
12404
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
12405
+ if (disabled) return;
12406
+ var newList = cloneDeep(list);
12407
+ var typeMap = {
12408
+ type: componentMap$1[compType].eventNameMap.selectList,
12409
+ reissueType: componentMap$1[compType].eventNameMap.reissueSelectList,
12410
+ returnType: componentMap$1[compType].eventNameMap.returnSelectList
12411
+ };
12412
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
12413
+ // console.log('onSelect', type, withInfo.current, newList);
12414
+ pubsub.publish(type, {
12415
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
12416
+ list: newList.map(function (item) {
12417
+ item.canDelete = true;
12418
+ return item;
12419
+ }),
12420
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
12421
+ goodValue: withInfo.current.goodValue
12422
+ });
12423
+ };
12424
+ var _onDelete = function onDelete(item) {
12425
+ var deleteId = item === null || item === void 0 ? void 0 : item.sku;
12426
+ pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
12427
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
12428
+ pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
12429
+ };
12430
+ var changeHandle = function changeHandle(list) {
12431
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
12432
+ };
12433
+ return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
12434
+ key: componentMap$1[compType].key
12435
+ }, props), {}, {
12436
+ disabled: disabled,
12437
+ value: value === null || value === void 0 ? void 0 : value[componentMap$1[compType].key],
12438
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
12439
+ tableSelect: ['2', '4'].includes(withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current3 = withInfo.current) === null || _withInfo$current3 === void 0 ? void 0 : _withInfo$current3.val),
12440
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
12441
+ onSelect: function onSelect(list) {
12442
+ return _onSelect(list);
12443
+ },
12444
+ onDelete: function onDelete(item) {
12445
+ return _onDelete(item);
12446
+ },
12447
+ onChange: function onChange(val) {
12448
+ return changeHandle(val);
12449
+ }
12450
+ }));
12451
+ };
12452
+
11491
12453
  var css_248z$9 = ".goodsBox {\n display: flex;\n flex-wrap: wrap;\n}\n.goods-imgBox {\n position: relative;\n width: 80px;\n height: 80px;\n border: 1px solid #F2F3F5;\n margin: 0 10px 10px 0;\n text-align: center;\n}\n.icon-close {\n position: absolute;\n top: -5px;\n right: -5px;\n width: 13px;\n height: 13px;\n display: flex;\n justify-content: center;\n align-items: center;\n border-radius: 50%;\n z-index: 3;\n background-color: #fff;\n cursor: pointer;\n}\n.img {\n width: 100%;\n height: 100%;\n -o-object-fit: contain;\n object-fit: contain;\n}\n.goods-title {\n margin: 0 0 10px 5px;\n color: #4E5969;\n}\n.deg90 {\n transform: rotate(90deg);\n}\n.goodMain {\n display: flex;\n flex-wrap: wrap;\n height: 265px;\n overflow-y: auto;\n margin-bottom: 10px;\n}\n.goodMain .goodItem {\n width: 140px;\n height: 175px;\n padding: 11px 10px 0;\n text-align: center;\n display: inline-block;\n vertical-align: top;\n margin-bottom: 10px;\n margin-right: 30px;\n border: 1px solid #e6e6e6;\n cursor: pointer;\n transition: border 0.3s;\n}\n.goodMain .goodItem .goodImg {\n width: 120px;\n height: 120px;\n}\n.goodMain .goodItem .goodText {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.goodMain .goodItem.active {\n border: 1px solid #3089dc;\n}\n.right-context {\n display: flex;\n flex-direction: column;\n}\n";
11492
12454
  styleInject(css_248z$9);
11493
12455
 
11494
12456
  var TabPane$1 = Tabs.TabPane;
11495
12457
  var Option$2 = Select.Option;
11496
12458
  var Search$1 = Input.Search;
11497
- var GoodsModal$3 = function GoodsModal(props) {
12459
+ var GoodsModal$4 = function GoodsModal(props) {
11498
12460
  var onSubmit = props.onSubmit,
11499
12461
  _onCancel = props.onCancel,
11500
12462
  visible = props.visible,
@@ -11945,7 +12907,7 @@ var Goods$1 = function Goods(props, ref) {
11945
12907
  };
11946
12908
  return /*#__PURE__*/React.createElement("div", {
11947
12909
  className: "goodsBox"
11948
- }, /*#__PURE__*/React.createElement(GoodsModal$3, {
12910
+ }, /*#__PURE__*/React.createElement(GoodsModal$4, {
11949
12911
  visible: visible,
11950
12912
  onSubmit: onSubmit,
11951
12913
  type: type,
@@ -12250,4 +13212,4 @@ var CalculationInput = function CalculationInput(props) {
12250
13212
  }, config === null || config === void 0 ? void 0 : config.unit));
12251
13213
  };
12252
13214
 
12253
- 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, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };
13215
+ 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, BsExchange, BsGoods, BsReissue, BsReturnGoods as BsReturn, index$1 as BsSystemOrder, BuyerNick, CalculationInput, ChooseBaby, CommonGoods, CommonSystemOrder$1 as CommonMultiStatus, CommonStatus, CommonSystemOrder, ExpressLogistics, Goods, index$2 as GoodsTable, IdentifyAddress, Invoice, jstGoods as JstGoods, ItemList as JstItemList, LogisticsInterception, LogisticsMoreTrajectory, LogisticsTrajectory, MsgStatus, ParseLogistics, Payment, RemarkInput as Remark, ExpressLogistics as ReturnLogistics, ShopNameSelect as ShopName, Status, Supplier, TBGoodId, TBGoodSerial, TradeId, WlnGoods };