@kmkf-fe-packages/basic-components 0.23.1-beta.3 → 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
@@ -10682,6 +10682,405 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
10682
10682
  };
10683
10683
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
10684
10684
 
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,
10774
+ width = props.width,
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;
10819
+ });
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();
10828
+ };
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
+
10685
11084
  // interface GoodsItem {
10686
11085
  // title: string;
10687
11086
  // pic: string;
@@ -10742,184 +11141,198 @@ var GoodItem = function GoodItem(props) {
10742
11141
  };
10743
11142
  var COLUMNS_MAP = function COLUMNS_MAP() {
10744
11143
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10745
- return {
10746
- DEFAULT: [{
10747
- dataIndex: 'mark',
10748
- title: "\u5546\u54C1\u6807\u8BB0",
10749
- align: 'center',
10750
- ellipsis: true,
10751
- width: 70,
10752
- render: function render(val, record, index) {
10753
- return /*#__PURE__*/React.createElement(Select, {
10754
- options: [{
10755
- label: '是',
10756
- value: '是'
10757
- }, {
10758
- label: '否',
10759
- value: ''
10760
- }],
10761
- disabled: disabled,
10762
- value: val,
10763
- onChange: function onChange(val) {
10764
- 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);
10765
11209
  }
10766
- });
10767
- }
10768
- }, {
10769
- dataIndex: 'skuName',
10770
- title: "".concat(text, "sku\u540D\u79F0"),
10771
- align: 'center',
10772
- ellipsis: true,
10773
- width: 250
10774
- }, {
10775
- dataIndex: 'sku',
10776
- title: "".concat(text, "sku\u7F16\u7801"),
10777
- align: 'center',
10778
- ellipsis: true,
10779
- width: 100
10780
- }, {
10781
- dataIndex: 'name',
10782
- title: "".concat(text, "\u540D\u79F0"),
10783
- align: 'center',
10784
- ellipsis: true,
10785
- width: 250
10786
- }, {
10787
- dataIndex: 'pic',
10788
- title: "\u56FE\u7247",
10789
- align: 'center',
10790
- ellipsis: true,
10791
- width: 100,
10792
- render: function render(val) {
10793
- return /*#__PURE__*/React.createElement(Image, {
10794
- width: 60,
10795
- src: val
10796
- });
10797
- }
10798
- }, {
10799
- dataIndex: 'code',
10800
- title: "".concat(text, "\u7F16\u7801"),
10801
- align: 'center',
10802
- ellipsis: true,
10803
- width: 100
10804
- }, {
10805
- dataIndex: 'money',
10806
- title: "\u5B9E\u4ED8\u91D1\u989D",
10807
- align: 'center',
10808
- ellipsis: true,
10809
- width: 100
10810
- }, {
10811
- dataIndex: 'number',
10812
- title: "".concat(text, "\u6570\u91CF"),
10813
- align: 'center',
10814
- ellipsis: true,
10815
- width: 100,
10816
- render: function render(val, record, index) {
10817
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
10818
- style: {
10819
- width: 70
10820
- },
10821
- value: val,
10822
- min: 0,
10823
- precision: 0,
10824
- onChange: function onChange(num) {
10825
- 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
+ });
10826
11252
  }
10827
- }) : /*#__PURE__*/React.createElement("span", null, val);
10828
- }
10829
- }, {
10830
- dataIndex: 'share',
10831
- title: "\u5206\u644A\u4EF7",
10832
- align: 'center',
10833
- ellipsis: true,
10834
- width: 70
10835
- }, {
10836
- dataIndex: 'type',
10837
- title: "\u8D60\u54C1\u7C7B\u578B",
10838
- align: 'center',
10839
- ellipsis: true,
10840
- width: 100
10841
- }],
10842
- WDT_REISSUE_GOODS: [{
10843
- dataIndex: 'spuId',
10844
- title: "SPUID",
10845
- align: 'center',
10846
- ellipsis: true,
10847
- width: 70
10848
- }, {
10849
- dataIndex: 'spuSku',
10850
- title: "SPU\u5546\u54C1\u7F16\u7801",
10851
- align: 'center',
10852
- ellipsis: true,
10853
- width: 100
10854
- }, {
10855
- dataIndex: 'skuId',
10856
- title: "".concat(text, "SKUID"),
10857
- align: 'center',
10858
- ellipsis: true,
10859
- width: 100
10860
- }, {
10861
- dataIndex: 'name',
10862
- title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
10863
- align: 'center',
10864
- ellipsis: true,
10865
- width: 250
10866
- }, {
10867
- dataIndex: 'sku',
10868
- title: "".concat(text, "sku\u7F16\u7801"),
10869
- align: 'center',
10870
- ellipsis: true,
10871
- width: 100
10872
- }, {
10873
- dataIndex: 'skuName',
10874
- title: "".concat(text, "sku\u540D\u79F0"),
10875
- align: 'center',
10876
- ellipsis: true,
10877
- width: 250
10878
- }, {
10879
- dataIndex: 'money',
10880
- title: "\u5B9E\u4ED8\u91D1\u989D",
10881
- align: 'center',
10882
- ellipsis: true,
10883
- width: 100
10884
- }, {
10885
- dataIndex: 'number',
10886
- title: "".concat(text, "\u6570\u91CF"),
10887
- align: 'center',
10888
- ellipsis: true,
10889
- width: 100,
10890
- render: function render(val, record, index) {
10891
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
10892
- style: {
10893
- width: 70
10894
- },
10895
- value: val,
10896
- min: 0,
10897
- precision: 0,
10898
- onChange: function onChange(num) {
10899
- 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
+ });
10900
11282
  }
10901
- }) : /*#__PURE__*/React.createElement("span", null, val);
10902
- }
10903
- }, {
10904
- dataIndex: 'share',
10905
- title: "\u5206\u644A\u4EF7",
10906
- align: 'center',
10907
- ellipsis: true,
10908
- width: 70
10909
- }, {
10910
- dataIndex: 'type',
10911
- title: "\u8D60\u54C1\u7C7B\u578B",
10912
- align: 'center',
10913
- ellipsis: true,
10914
- width: 100
10915
- }]
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;
10916
11329
  };
10917
11330
  };
10918
11331
  //商品信息
10919
11332
  var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
10920
11333
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10921
11334
  var COLUMNS_INFO = COLUMNS_MAP(text);
10922
- return (COLUMNS_INFO === null || COLUMNS_INFO === void 0 ? void 0 : COLUMNS_INFO["".concat(type)]) || COLUMNS_INFO['DEFAULT'];
11335
+ return COLUMNS_INFO(type);
10923
11336
  };
10924
11337
  var newColumns = useMemo(function () {
10925
11338
  var columnList = [{
@@ -10954,30 +11367,38 @@ var GoodItem = function GoodItem(props) {
10954
11367
  return columnList;
10955
11368
  }, [showHeader, value, disabled]);
10956
11369
  var onSubmit = function onSubmit(list) {
10957
- var newList = list.map(function (item) {
10958
- var goodsId = item.goodsId,
10959
- name = item.name,
10960
- code = item.code,
10961
- skuCode = item.skuCode,
10962
- marketPrice = item.marketPrice,
10963
- skuName = item.skuName;
10964
- return {
10965
- id: goodsId,
10966
- mark: '是',
10967
- pic: '',
10968
- skuName: skuName,
10969
- name: name,
10970
- code: code,
10971
- sku: skuCode,
10972
- money: marketPrice || 0,
10973
- share: marketPrice || 0,
10974
- number: 1,
10975
- type: '',
10976
- uuid: uuid(),
10977
- canDelete: true,
10978
- canUpdateNumber: canUpdateNumber
10979
- };
10980
- });
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
+ }
10981
11402
  onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
10982
11403
  };
10983
11404
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
@@ -11020,7 +11441,15 @@ var GoodItem = function GoodItem(props) {
11020
11441
  locale: {
11021
11442
  emptyText: '暂无数据'
11022
11443
  }
11023
- })), /*#__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, {
11024
11453
  ref: refModal,
11025
11454
  onSubmit: onSubmit,
11026
11455
  width: width,
@@ -11401,23 +11830,51 @@ var BsExchange = function BsExchange(props) {
11401
11830
  }))) : null);
11402
11831
  };
11403
11832
 
11404
- 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
+
11405
11858
  var BsReissue = function BsReissue(props) {
11859
+ var _typeMap$type14, _typeMap$type15, _typeMap$type16;
11406
11860
  var value = props.value,
11407
11861
  onChange = props.onChange,
11408
11862
  _props$reasonList = props.reasonList,
11409
11863
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
11410
11864
  disabled = props.disabled,
11865
+ type = props.type,
11411
11866
  other = _objectWithoutProperties(props, _excluded$e);
11412
11867
  var valueRef = useRef({});
11413
11868
  useEffect(function () {
11414
- 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;
11415
11872
  // console.log('reissueSelectList', data);
11416
11873
  if (disabled) return;
11417
11874
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11418
11875
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11419
11876
  });
11420
- 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) {
11421
11878
  item.money = 0;
11422
11879
  item.share = 0;
11423
11880
  item.canUpdateNumber = true;
@@ -11427,13 +11884,15 @@ var BsReissue = function BsReissue(props) {
11427
11884
  });
11428
11885
  }, []);
11429
11886
  useEffect(function () {
11430
- 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;
11431
11890
  // console.log('reissueSelectListReturn', data);
11432
11891
  if (disabled) return;
11433
11892
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11434
11893
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11435
11894
  });
11436
- 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) {
11437
11896
  item.money = 0;
11438
11897
  item.share = 0;
11439
11898
  item.canUpdateNumber = true;
@@ -11443,39 +11902,43 @@ var BsReissue = function BsReissue(props) {
11443
11902
  });
11444
11903
  }, []);
11445
11904
  useEffect(function () {
11905
+ var _typeMap$type5, _typeMap$type8;
11446
11906
  valueRef.current = value;
11447
- 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) {
11448
11908
  if (disabled) return;
11449
11909
  if (value) {
11910
+ var _typeMap$type6, _typeMap$type7;
11450
11911
  var newValue = _objectSpread2({}, value);
11451
- 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) {
11452
11913
  return item.sku !== data;
11453
11914
  });
11454
11915
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11455
11916
  }
11456
11917
  });
11457
- 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) {
11458
11919
  onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11459
11920
  shopCode: data.shopCode
11460
11921
  }));
11461
11922
  });
11462
11923
  }, [value, disabled]);
11463
11924
  var changeTypeHandle = function changeTypeHandle(val) {
11925
+ var _typeMap$type9, _typeMap$type10, _typeMap$type11;
11464
11926
  var newValue = _objectSpread2({}, value);
11465
- newValue['bsReissueType'] = val;
11466
- 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)] = [];
11467
11929
  if (['2', '4'].includes(val[0])) {
11468
11930
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11469
11931
  valueRef.current = newValue;
11470
11932
  }
11471
- 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), {
11472
11934
  val: val[0],
11473
11935
  goodValue: newValue
11474
11936
  });
11475
11937
  };
11476
11938
  var changeGoodHandle = function changeGoodHandle(val) {
11939
+ var _typeMap$type12;
11477
11940
  var newValue = _objectSpread2({}, value);
11478
- 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) {
11479
11942
  item.money = 0;
11480
11943
  item.share = 0;
11481
11944
  return item;
@@ -11484,9 +11947,9 @@ var BsReissue = function BsReissue(props) {
11484
11947
  };
11485
11948
  //显示选择商品按钮 原单换不显示选择商品
11486
11949
  var showChangeBtn = useMemo(function () {
11487
- var _value$bsReissueType;
11488
- 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]);
11489
- }, [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]]);
11490
11953
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
11491
11954
  style: {
11492
11955
  marginBottom: '8px'
@@ -11494,7 +11957,7 @@ var BsReissue = function BsReissue(props) {
11494
11957
  disabled: disabled,
11495
11958
  allowClear: false,
11496
11959
  options: reasonList,
11497
- 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)],
11498
11961
  onChange: function onChange(val) {
11499
11962
  return changeTypeHandle(val);
11500
11963
  }
@@ -11505,7 +11968,7 @@ var BsReissue = function BsReissue(props) {
11505
11968
  canUpdateNumber: showChangeBtn,
11506
11969
  showChangeBtn: showChangeBtn,
11507
11970
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11508
- 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)],
11509
11972
  onChange: function onChange(val) {
11510
11973
  return changeGoodHandle(val);
11511
11974
  }
@@ -11760,14 +12223,14 @@ var index$1 = (function (props) {
11760
12223
  return _objectSpread2(_objectSpread2({}, item), {}, {
11761
12224
  billNo: item.tradeNo,
11762
12225
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
11763
- billTag: item.tradeTag
12226
+ billTag: item.tagName
11764
12227
  });
11765
12228
  }),
11766
12229
  showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
11767
12230
  return {
11768
12231
  billNo: item.tradeNo,
11769
12232
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
11770
- billTag: item.tradeTag || '后期补上'
12233
+ billTag: item.tagName
11771
12234
  };
11772
12235
  })
11773
12236
  }));
@@ -11836,13 +12299,164 @@ var WlnGoods = function WlnGoods(props) {
11836
12299
  }));
11837
12300
  };
11838
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
+
11839
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";
11840
12454
  styleInject(css_248z$9);
11841
12455
 
11842
12456
  var TabPane$1 = Tabs.TabPane;
11843
12457
  var Option$2 = Select.Option;
11844
12458
  var Search$1 = Input.Search;
11845
- var GoodsModal$3 = function GoodsModal(props) {
12459
+ var GoodsModal$4 = function GoodsModal(props) {
11846
12460
  var onSubmit = props.onSubmit,
11847
12461
  _onCancel = props.onCancel,
11848
12462
  visible = props.visible,
@@ -12293,7 +12907,7 @@ var Goods$1 = function Goods(props, ref) {
12293
12907
  };
12294
12908
  return /*#__PURE__*/React.createElement("div", {
12295
12909
  className: "goodsBox"
12296
- }, /*#__PURE__*/React.createElement(GoodsModal$3, {
12910
+ }, /*#__PURE__*/React.createElement(GoodsModal$4, {
12297
12911
  visible: visible,
12298
12912
  onSubmit: onSubmit,
12299
12913
  type: type,
@@ -12598,4 +13212,4 @@ var CalculationInput = function CalculationInput(props) {
12598
13212
  }, config === null || config === void 0 ? void 0 : config.unit));
12599
13213
  };
12600
13214
 
12601
- 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, LogisticsMoreTrajectory, 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 };