@kmkf-fe-packages/basic-components 0.23.1-beta.3 → 0.23.1-beta.5

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;
@@ -10719,6 +11118,7 @@ var GoodItem = function GoodItem(props) {
10719
11118
  companyKey = _props$companyKey === void 0 ? '' : _props$companyKey,
10720
11119
  onSelect = props.onSelect,
10721
11120
  onDelete = props.onDelete;
11121
+ console.log('gooditem', type);
10722
11122
  var refModal = useRef();
10723
11123
  var handleDelete = function handleDelete(record, index) {
10724
11124
  onDelete === null || onDelete === void 0 ? void 0 : onDelete(value[index]);
@@ -10742,184 +11142,198 @@ var GoodItem = function GoodItem(props) {
10742
11142
  };
10743
11143
  var COLUMNS_MAP = function COLUMNS_MAP() {
10744
11144
  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');
11145
+ return function (type) {
11146
+ var columns = [];
11147
+ switch (type) {
11148
+ case 'WDT_REISSUE_GOODS':
11149
+ case 'WDT_GOODS':
11150
+ columns = [{
11151
+ dataIndex: 'goodId',
11152
+ title: "SPUID",
11153
+ align: 'center',
11154
+ ellipsis: true,
11155
+ width: 70
11156
+ }, {
11157
+ dataIndex: 'goodNo',
11158
+ title: "SPU\u5546\u54C1\u7F16\u7801",
11159
+ align: 'center',
11160
+ ellipsis: true,
11161
+ width: 100
11162
+ }, {
11163
+ dataIndex: 'specId',
11164
+ title: "".concat(text, "SKUID"),
11165
+ align: 'center',
11166
+ ellipsis: true,
11167
+ width: 100
11168
+ }, {
11169
+ dataIndex: 'goodName',
11170
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11171
+ align: 'center',
11172
+ ellipsis: true,
11173
+ width: 250
11174
+ }, {
11175
+ dataIndex: 'specNo',
11176
+ title: "".concat(text, "sku\u7F16\u7801"),
11177
+ align: 'center',
11178
+ ellipsis: true,
11179
+ width: 100
11180
+ }, {
11181
+ dataIndex: 'specName',
11182
+ title: "".concat(text, "sku\u540D\u79F0"),
11183
+ align: 'center',
11184
+ ellipsis: true,
11185
+ width: 250
11186
+ }, {
11187
+ dataIndex: 'orderPrice',
11188
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11189
+ align: 'center',
11190
+ ellipsis: true,
11191
+ width: 100
11192
+ }, {
11193
+ dataIndex: 'num',
11194
+ title: "".concat(text, "\u4E0B\u5355\u6570\u91CF"),
11195
+ align: 'center',
11196
+ ellipsis: true,
11197
+ width: 100,
11198
+ render: function render(val, record, index) {
11199
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11200
+ style: {
11201
+ width: 70
11202
+ },
11203
+ value: val,
11204
+ min: 0,
11205
+ precision: 0,
11206
+ onChange: function onChange(num) {
11207
+ return updateHandle(num, index, 'number');
11208
+ }
11209
+ }) : /*#__PURE__*/React.createElement("span", null, val);
10765
11210
  }
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');
11211
+ }, {
11212
+ dataIndex: 'actualNum',
11213
+ title: "".concat(text, "\u5B9E\u53D1\u6570\u91CF"),
11214
+ align: 'center',
11215
+ ellipsis: true,
11216
+ width: 100
11217
+ }, {
11218
+ dataIndex: 'sharePrice',
11219
+ title: "\u5206\u644A\u4EF7",
11220
+ align: 'center',
11221
+ ellipsis: true,
11222
+ width: 70
11223
+ }, {
11224
+ dataIndex: 'giftType',
11225
+ title: "\u8D60\u54C1\u7C7B\u578B",
11226
+ align: 'center',
11227
+ ellipsis: true,
11228
+ width: 100
11229
+ }];
11230
+ break;
11231
+ default:
11232
+ columns = [{
11233
+ dataIndex: 'mark',
11234
+ title: "\u5546\u54C1\u6807\u8BB0",
11235
+ align: 'center',
11236
+ ellipsis: true,
11237
+ width: 70,
11238
+ render: function render(val, record, index) {
11239
+ return /*#__PURE__*/React.createElement(Select, {
11240
+ options: [{
11241
+ label: '是',
11242
+ value: '是'
11243
+ }, {
11244
+ label: '',
11245
+ value: '否'
11246
+ }],
11247
+ disabled: disabled,
11248
+ value: val,
11249
+ onChange: function onChange(val) {
11250
+ return updateHandle(val, index, 'mark');
11251
+ }
11252
+ });
10826
11253
  }
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');
11254
+ }, {
11255
+ dataIndex: 'skuName',
11256
+ title: "".concat(text, "sku\u540D\u79F0"),
11257
+ align: 'center',
11258
+ ellipsis: true,
11259
+ width: 250
11260
+ }, {
11261
+ dataIndex: 'sku',
11262
+ title: "".concat(text, "sku\u7F16\u7801"),
11263
+ align: 'center',
11264
+ ellipsis: true,
11265
+ width: 100
11266
+ }, {
11267
+ dataIndex: 'name',
11268
+ title: "".concat(text, "\u540D\u79F0"),
11269
+ align: 'center',
11270
+ ellipsis: true,
11271
+ width: 250
11272
+ }, {
11273
+ dataIndex: 'pic',
11274
+ title: "\u56FE\u7247",
11275
+ align: 'center',
11276
+ ellipsis: true,
11277
+ width: 100,
11278
+ render: function render(val) {
11279
+ return /*#__PURE__*/React.createElement(Image, {
11280
+ width: 60,
11281
+ src: val
11282
+ });
10900
11283
  }
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
- }]
11284
+ }, {
11285
+ dataIndex: 'code',
11286
+ title: "".concat(text, "\u7F16\u7801"),
11287
+ align: 'center',
11288
+ ellipsis: true,
11289
+ width: 100
11290
+ }, {
11291
+ dataIndex: 'money',
11292
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11293
+ align: 'center',
11294
+ ellipsis: true,
11295
+ width: 100
11296
+ }, {
11297
+ dataIndex: 'number',
11298
+ title: "".concat(text, "\u6570\u91CF"),
11299
+ align: 'center',
11300
+ ellipsis: true,
11301
+ width: 100,
11302
+ render: function render(val, record, index) {
11303
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11304
+ style: {
11305
+ width: 70
11306
+ },
11307
+ value: val,
11308
+ min: 0,
11309
+ precision: 0,
11310
+ onChange: function onChange(num) {
11311
+ return updateHandle(num, index, 'number');
11312
+ }
11313
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11314
+ }
11315
+ }, {
11316
+ dataIndex: 'share',
11317
+ title: "\u5206\u644A\u4EF7",
11318
+ align: 'center',
11319
+ ellipsis: true,
11320
+ width: 70
11321
+ }, {
11322
+ dataIndex: 'type',
11323
+ title: "\u8D60\u54C1\u7C7B\u578B",
11324
+ align: 'center',
11325
+ ellipsis: true,
11326
+ width: 100
11327
+ }];
11328
+ }
11329
+ return columns;
10916
11330
  };
10917
11331
  };
10918
11332
  //商品信息
10919
11333
  var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
10920
11334
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
10921
11335
  var COLUMNS_INFO = COLUMNS_MAP(text);
10922
- return (COLUMNS_INFO === null || COLUMNS_INFO === void 0 ? void 0 : COLUMNS_INFO["".concat(type)]) || COLUMNS_INFO['DEFAULT'];
11336
+ return COLUMNS_INFO(type);
10923
11337
  };
10924
11338
  var newColumns = useMemo(function () {
10925
11339
  var columnList = [{
@@ -10954,30 +11368,38 @@ var GoodItem = function GoodItem(props) {
10954
11368
  return columnList;
10955
11369
  }, [showHeader, value, disabled]);
10956
11370
  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
- });
11371
+ var newList = [];
11372
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
11373
+ newList = list.map(function (item) {
11374
+ item.uuid = uuid();
11375
+ return item;
11376
+ });
11377
+ } else {
11378
+ newList = list.map(function (item) {
11379
+ var goodsId = item.goodsId,
11380
+ name = item.name,
11381
+ code = item.code,
11382
+ skuCode = item.skuCode,
11383
+ marketPrice = item.marketPrice,
11384
+ skuName = item.skuName;
11385
+ return {
11386
+ id: goodsId,
11387
+ mark: '是',
11388
+ pic: '',
11389
+ skuName: skuName,
11390
+ name: name,
11391
+ code: code,
11392
+ sku: skuCode,
11393
+ money: marketPrice || 0,
11394
+ share: marketPrice || 0,
11395
+ number: 1,
11396
+ type: '',
11397
+ uuid: uuid(),
11398
+ canDelete: true,
11399
+ canUpdateNumber: canUpdateNumber
11400
+ };
11401
+ });
11402
+ }
10981
11403
  onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
10982
11404
  };
10983
11405
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
@@ -11020,7 +11442,15 @@ var GoodItem = function GoodItem(props) {
11020
11442
  locale: {
11021
11443
  emptyText: '暂无数据'
11022
11444
  }
11023
- })), /*#__PURE__*/React.createElement(GoodsModal$2, {
11445
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11446
+ ref: refModal,
11447
+ onSubmit: onSubmit,
11448
+ width: width,
11449
+ shopList: shopList,
11450
+ shopId: shopId,
11451
+ maxLength: maxLength,
11452
+ companyKey: companyKey
11453
+ }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
11024
11454
  ref: refModal,
11025
11455
  onSubmit: onSubmit,
11026
11456
  width: width,
@@ -11401,23 +11831,51 @@ var BsExchange = function BsExchange(props) {
11401
11831
  }))) : null);
11402
11832
  };
11403
11833
 
11404
- var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
11834
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled", "type"];
11835
+ var typeMap = {
11836
+ BS_REISSUE_GOODS: {
11837
+ key: 'bsReissueGoods',
11838
+ name: 'bs',
11839
+ typeName: 'bsReissueType',
11840
+ reissueSelectList: 'reissueSelectList',
11841
+ reissueSelectListReturn: 'reissueSelectListReturn',
11842
+ reissueDeleteGood: 'reissueDeleteGood',
11843
+ changeShopCode: 'changeShopCode',
11844
+ reissueType: 'reissueType' // pubsub 事件
11845
+ },
11846
+
11847
+ WDT_REISSUE_GOODS: {
11848
+ key: 'wdtReissueGoods',
11849
+ name: '旺店通',
11850
+ typeName: 'wdtReissueType',
11851
+ reissueSelectList: 'wdtReissueSelectList',
11852
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
11853
+ reissueDeleteGood: 'wdtReissueDeleteGood',
11854
+ changeShopCode: 'wdtChangeShopCode',
11855
+ reissueType: 'wdtReissueType' // pubsub 事件
11856
+ }
11857
+ };
11858
+
11405
11859
  var BsReissue = function BsReissue(props) {
11860
+ var _typeMap$type14, _typeMap$type15, _typeMap$type16;
11406
11861
  var value = props.value,
11407
11862
  onChange = props.onChange,
11408
11863
  _props$reasonList = props.reasonList,
11409
11864
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
11410
11865
  disabled = props.disabled,
11866
+ type = props.type,
11411
11867
  other = _objectWithoutProperties(props, _excluded$e);
11412
11868
  var valueRef = useRef({});
11413
11869
  useEffect(function () {
11414
- pubsub.subscribe('reissueSelectList', function (_, data) {
11870
+ var _typeMap$type;
11871
+ 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) {
11872
+ var _typeMap$type2;
11415
11873
  // console.log('reissueSelectList', data);
11416
11874
  if (disabled) return;
11417
11875
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11418
11876
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11419
11877
  });
11420
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11878
+ 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
11879
  item.money = 0;
11422
11880
  item.share = 0;
11423
11881
  item.canUpdateNumber = true;
@@ -11427,13 +11885,15 @@ var BsReissue = function BsReissue(props) {
11427
11885
  });
11428
11886
  }, []);
11429
11887
  useEffect(function () {
11430
- pubsub.subscribe('reissueSelectListReturn', function (_, data) {
11888
+ var _typeMap$type3;
11889
+ 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) {
11890
+ var _typeMap$type4;
11431
11891
  // console.log('reissueSelectListReturn', data);
11432
11892
  if (disabled) return;
11433
11893
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11434
11894
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11435
11895
  });
11436
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11896
+ 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
11897
  item.money = 0;
11438
11898
  item.share = 0;
11439
11899
  item.canUpdateNumber = true;
@@ -11443,39 +11903,43 @@ var BsReissue = function BsReissue(props) {
11443
11903
  });
11444
11904
  }, []);
11445
11905
  useEffect(function () {
11906
+ var _typeMap$type5, _typeMap$type8;
11446
11907
  valueRef.current = value;
11447
- pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
11908
+ 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
11909
  if (disabled) return;
11449
11910
  if (value) {
11911
+ var _typeMap$type6, _typeMap$type7;
11450
11912
  var newValue = _objectSpread2({}, value);
11451
- newValue.bsReissueGoods = newValue.bsReissueGoods.filter(function (item) {
11913
+ 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
11914
  return item.sku !== data;
11453
11915
  });
11454
11916
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11455
11917
  }
11456
11918
  });
11457
- pubsub.subscribeOnce('changeShopCode', function (type, data) {
11919
+ 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
11920
  onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11459
11921
  shopCode: data.shopCode
11460
11922
  }));
11461
11923
  });
11462
11924
  }, [value, disabled]);
11463
11925
  var changeTypeHandle = function changeTypeHandle(val) {
11926
+ var _typeMap$type9, _typeMap$type10, _typeMap$type11;
11464
11927
  var newValue = _objectSpread2({}, value);
11465
- newValue['bsReissueType'] = val;
11466
- newValue.bsReissueGoods = [];
11928
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type9 = typeMap[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.typeName)] = val;
11929
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type10 = typeMap[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = [];
11467
11930
  if (['2', '4'].includes(val[0])) {
11468
11931
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11469
11932
  valueRef.current = newValue;
11470
11933
  }
11471
- pubsub.publish('reissueType', {
11934
+ 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
11935
  val: val[0],
11473
11936
  goodValue: newValue
11474
11937
  });
11475
11938
  };
11476
11939
  var changeGoodHandle = function changeGoodHandle(val) {
11940
+ var _typeMap$type12;
11477
11941
  var newValue = _objectSpread2({}, value);
11478
- newValue['bsReissueGoods'] = (val || []).map(function (item) {
11942
+ 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
11943
  item.money = 0;
11480
11944
  item.share = 0;
11481
11945
  return item;
@@ -11484,9 +11948,9 @@ var BsReissue = function BsReissue(props) {
11484
11948
  };
11485
11949
  //显示选择商品按钮 原单换不显示选择商品
11486
11950
  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]);
11951
+ var _value, _typeMap$type13;
11952
+ 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]);
11953
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type14 = typeMap[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.typeName]]);
11490
11954
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
11491
11955
  style: {
11492
11956
  marginBottom: '8px'
@@ -11494,18 +11958,19 @@ var BsReissue = function BsReissue(props) {
11494
11958
  disabled: disabled,
11495
11959
  allowClear: false,
11496
11960
  options: reasonList,
11497
- value: value === null || value === void 0 ? void 0 : value.bsReissueType,
11961
+ 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
11962
  onChange: function onChange(val) {
11499
11963
  return changeTypeHandle(val);
11500
11964
  }
11501
11965
  }), /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
11502
11966
  key: 'reissueGoods'
11503
11967
  }, other), {}, {
11968
+ type: type,
11504
11969
  disabled: disabled,
11505
11970
  canUpdateNumber: showChangeBtn,
11506
11971
  showChangeBtn: showChangeBtn,
11507
11972
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11508
- value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
11973
+ 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
11974
  onChange: function onChange(val) {
11510
11975
  return changeGoodHandle(val);
11511
11976
  }
@@ -11760,14 +12225,14 @@ var index$1 = (function (props) {
11760
12225
  return _objectSpread2(_objectSpread2({}, item), {}, {
11761
12226
  billNo: item.tradeNo,
11762
12227
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
11763
- billTag: item.tradeTag
12228
+ billTag: item.tagName
11764
12229
  });
11765
12230
  }),
11766
12231
  showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
11767
12232
  return {
11768
12233
  billNo: item.tradeNo,
11769
12234
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
11770
- billTag: item.tradeTag || '后期补上'
12235
+ billTag: item.tagName
11771
12236
  };
11772
12237
  })
11773
12238
  }));
@@ -11836,13 +12301,164 @@ var WlnGoods = function WlnGoods(props) {
11836
12301
  }));
11837
12302
  };
11838
12303
 
12304
+ var componentMap$1 = {
12305
+ 'WDT_GOODS': {
12306
+ type: 'wdt',
12307
+ key: 'wdtGoods',
12308
+ name: '旺店通',
12309
+ eventNameMap: {
12310
+ type: 'wdtType',
12311
+ selectListReturn: 'wdtSelectListReturn',
12312
+ selectList: 'wdtSelectList',
12313
+ reissueSelectList: 'wdtReissueSelectList',
12314
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12315
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12316
+ changeShopCode: 'wdtChangeShopCode',
12317
+ reissueType: 'wdtReissueType',
12318
+ returnType: 'wdtReturnType',
12319
+ returnSelectListReturn: 'wdtReturnSelectListReturn',
12320
+ deleteGood: 'wdtDeleteGood',
12321
+ returnDeleteGood: 'wdtReturnDeleteGood'
12322
+ }
12323
+ }
12324
+ };
12325
+ var CommonGoods = function CommonGoods(props) {
12326
+ var _withInfo$current3, _withInfo$current4;
12327
+ var value = props.value,
12328
+ disabled = props.disabled,
12329
+ onChange = props.onChange,
12330
+ compType = props.type;
12331
+ var _useState = useState(false),
12332
+ _useState2 = _slicedToArray(_useState, 2),
12333
+ tableSelect = _useState2[0],
12334
+ setTableSelect = _useState2[1];
12335
+ var withInfo = useRef(null);
12336
+ var valueRef = useRef(null);
12337
+ useEffect(function () {
12338
+ valueRef.current = value;
12339
+ }, [value]);
12340
+ useEffect(function () {
12341
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
12342
+ if (disabled) return;
12343
+ // console.log(type, data);
12344
+ withInfo.current = {
12345
+ type: type,
12346
+ val: data.val,
12347
+ goodValue: data.goodValue
12348
+ };
12349
+ setTableSelect(['2', '4'].includes(data.val));
12350
+ if (['1', '3'].includes(data.val)) {
12351
+ var _valueRef$current, _valueRef$current2;
12352
+ pubsub.publish(componentMap$1[compType].eventNameMap.selectListReturn, {
12353
+ 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]) || []),
12354
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
12355
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12356
+ });
12357
+ }
12358
+ });
12359
+ //补发
12360
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
12361
+ if (disabled) return;
12362
+ withInfo.current = {
12363
+ type: type,
12364
+ val: data.val,
12365
+ goodValue: data.goodValue
12366
+ };
12367
+ setTableSelect(['2', '4'].includes(data.val));
12368
+ if (['1', '3'].includes(data.val)) {
12369
+ var _valueRef$current3, _valueRef$current4;
12370
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueSelectListReturn, {
12371
+ 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]) || []),
12372
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
12373
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12374
+ });
12375
+ }
12376
+ });
12377
+ //退货
12378
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
12379
+ if (disabled) return;
12380
+ withInfo.current = {
12381
+ type: type,
12382
+ val: data.val,
12383
+ goodValue: data.goodValue
12384
+ };
12385
+ setTableSelect(['2', '4'].includes(data.val));
12386
+ if (['1', '3'].includes(data.val)) {
12387
+ var _valueRef$current5, _valueRef$current6;
12388
+ pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
12389
+ 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]) || []),
12390
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
12391
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12392
+ });
12393
+ }
12394
+ });
12395
+ pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
12396
+ // console.log(data);
12397
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
12398
+ shopCode: data.shopCode
12399
+ }));
12400
+ });
12401
+ return function () {
12402
+ pubsub.clearAllSubscriptions();
12403
+ };
12404
+ }, [disabled]);
12405
+ var _onSelect = function onSelect(list) {
12406
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
12407
+ if (disabled) return;
12408
+ var newList = cloneDeep(list);
12409
+ var typeMap = {
12410
+ type: componentMap$1[compType].eventNameMap.selectList,
12411
+ reissueType: componentMap$1[compType].eventNameMap.reissueSelectList,
12412
+ returnType: componentMap$1[compType].eventNameMap.returnSelectList
12413
+ };
12414
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
12415
+ // console.log('onSelect', type, withInfo.current, newList);
12416
+ pubsub.publish(type, {
12417
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
12418
+ list: newList.map(function (item) {
12419
+ item.canDelete = true;
12420
+ return item;
12421
+ }),
12422
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
12423
+ goodValue: withInfo.current.goodValue
12424
+ });
12425
+ };
12426
+ var _onDelete = function onDelete(item) {
12427
+ var deleteId = item === null || item === void 0 ? void 0 : item.sku;
12428
+ pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
12429
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
12430
+ pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
12431
+ };
12432
+ var changeHandle = function changeHandle(list) {
12433
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
12434
+ };
12435
+ return /*#__PURE__*/React.createElement(GoodItem, _objectSpread2(_objectSpread2({
12436
+ key: componentMap$1[compType].key
12437
+ }, props), {}, {
12438
+ disabled: disabled,
12439
+ value: value === null || value === void 0 ? void 0 : value[componentMap$1[compType].key],
12440
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
12441
+ 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),
12442
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
12443
+ onSelect: function onSelect(list) {
12444
+ return _onSelect(list);
12445
+ },
12446
+ onDelete: function onDelete(item) {
12447
+ return _onDelete(item);
12448
+ },
12449
+ onChange: function onChange(val) {
12450
+ return changeHandle(val);
12451
+ }
12452
+ }));
12453
+ };
12454
+
11839
12455
  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
12456
  styleInject(css_248z$9);
11841
12457
 
11842
12458
  var TabPane$1 = Tabs.TabPane;
11843
12459
  var Option$2 = Select.Option;
11844
12460
  var Search$1 = Input.Search;
11845
- var GoodsModal$3 = function GoodsModal(props) {
12461
+ var GoodsModal$4 = function GoodsModal(props) {
11846
12462
  var onSubmit = props.onSubmit,
11847
12463
  _onCancel = props.onCancel,
11848
12464
  visible = props.visible,
@@ -12293,7 +12909,7 @@ var Goods$1 = function Goods(props, ref) {
12293
12909
  };
12294
12910
  return /*#__PURE__*/React.createElement("div", {
12295
12911
  className: "goodsBox"
12296
- }, /*#__PURE__*/React.createElement(GoodsModal$3, {
12912
+ }, /*#__PURE__*/React.createElement(GoodsModal$4, {
12297
12913
  visible: visible,
12298
12914
  onSubmit: onSubmit,
12299
12915
  type: type,
@@ -12598,4 +13214,4 @@ var CalculationInput = function CalculationInput(props) {
12598
13214
  }, config === null || config === void 0 ? void 0 : config.unit));
12599
13215
  };
12600
13216
 
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 };
13217
+ 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 };