@kmkf-fe-packages/basic-components 0.24.1 → 0.24.2-beta.0

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
@@ -3,7 +3,7 @@ import { Cascader, DatePicker, InputNumber, Input, Select, Upload, Image, messag
3
3
  import { EyeOutlined, DeleteOutlined, CaretUpOutlined } from '@ant-design/icons';
4
4
  import request, { extend as extend$1 } from 'umi-request';
5
5
  import { CopyToClipboard } from 'react-copy-to-clipboard';
6
- import { AddressData, BsAddressData, toTree, request as request$1, ExpressData, uuid, LogisticsAddressData } from '@kmkf-fe-packages/kmkf-utils';
6
+ import { AddressData, BsAddressData, WdtAddressData, toTree, request as request$1, ExpressData, uuid, LogisticsAddressData, WDT_ORDER_TYPE_MAP } from '@kmkf-fe-packages/kmkf-utils';
7
7
  import zhCN from 'antd/lib/locale/zh_CN';
8
8
  import { cloneDeep, difference, differenceWith } from 'lodash';
9
9
  import { useDebounceEffect } from 'ahooks';
@@ -7369,6 +7369,7 @@ function ApaasRate(props) {
7369
7369
 
7370
7370
  var addressData = AddressData.getInstance();
7371
7371
  var bsAddressData = BsAddressData.getInstance();
7372
+ var wdtAddressData = WdtAddressData.getInstance();
7372
7373
  var Province = function Province(props) {
7373
7374
  var _props$type = props.type,
7374
7375
  type = _props$type === void 0 ? 'workOrder' : _props$type,
@@ -7387,7 +7388,11 @@ var Province = function Province(props) {
7387
7388
  while (1) switch (_context.prev = _context.next) {
7388
7389
  case 0:
7389
7390
  num++;
7390
- options = type !== 'bs' ? addressData.addressOptions || [] : bsAddressData.addressOptions || [];
7391
+ options = ({
7392
+ bs: bsAddressData,
7393
+ wdt: wdtAddressData,
7394
+ workOrder: addressData
7395
+ }[type] || addressData).addressOptions || [];
7391
7396
  if (!(options === null || options === void 0 ? void 0 : options.length) && num < 6) {
7392
7397
  time.current = setTimeout(function () {
7393
7398
  initPageSource();
@@ -7526,7 +7531,11 @@ var IdentifyAddress = function IdentifyAddress(props) {
7526
7531
  receiverMobile: val === null || val === void 0 ? void 0 : val.phone,
7527
7532
  address: []
7528
7533
  };
7529
- var addressData = type === 'bs' ? BsAddressData.getInstance() : AddressData.getInstance();
7534
+ var addressData = (type && {
7535
+ bs: BsAddressData,
7536
+ wdt: WdtAddressData,
7537
+ workOrder: AddressData
7538
+ }[type] || AddressData).getInstance();
7530
7539
  if ((val === null || val === void 0 ? void 0 : val.province) && addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province)) {
7531
7540
  params.address = [addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.province), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.city), addressData.getProCodeByName(val === null || val === void 0 ? void 0 : val.district)];
7532
7541
  }
@@ -11070,6 +11079,440 @@ var GoodsModal$1 = function GoodsModal(props, ref) {
11070
11079
  };
11071
11080
  var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11072
11081
 
11082
+ var RangePicker = DatePicker.RangePicker;
11083
+ var columns$1 = [{
11084
+ dataIndex: 'index',
11085
+ title: 'NO',
11086
+ render: function render(val, record, index) {
11087
+ return /*#__PURE__*/React.createElement("div", {
11088
+ style: {
11089
+ width: 25
11090
+ }
11091
+ }, index + 1);
11092
+ }
11093
+ }, {
11094
+ dataIndex: 'goodName',
11095
+ title: '商品名称',
11096
+ width: 200,
11097
+ ellipsis: true
11098
+ }, {
11099
+ dataIndex: 'goodNo',
11100
+ title: '商品spu编码',
11101
+ width: 200,
11102
+ ellipsis: true
11103
+ }, {
11104
+ dataIndex: 'goodId',
11105
+ title: 'SPUID',
11106
+ width: 200,
11107
+ ellipsis: true
11108
+ }, {
11109
+ dataIndex: 'specCount',
11110
+ title: '规格数',
11111
+ width: 160,
11112
+ ellipsis: true
11113
+ }];
11114
+ var expandedColumns = [{
11115
+ dataIndex: 'specName',
11116
+ title: '商品sku名称',
11117
+ width: 200,
11118
+ ellipsis: true
11119
+ }, {
11120
+ dataIndex: 'specNo',
11121
+ title: '商品sku编码',
11122
+ width: 200,
11123
+ ellipsis: true
11124
+ }, {
11125
+ dataIndex: 'specId',
11126
+ title: 'SKUID',
11127
+ width: 200,
11128
+ ellipsis: true
11129
+ }, {
11130
+ dataIndex: 'imgUrl',
11131
+ title: '商品图片',
11132
+ width: 100,
11133
+ render: function render(picUrl) {
11134
+ return /*#__PURE__*/React.createElement("img", {
11135
+ style: {
11136
+ width: '40px',
11137
+ height: '40px',
11138
+ objectFit: 'contain'
11139
+ },
11140
+ src: picUrl
11141
+ });
11142
+ }
11143
+ }, {
11144
+ dataIndex: 'marketPrice',
11145
+ title: '市场价',
11146
+ width: 140
11147
+ }, {
11148
+ dataIndex: 'retailPrice',
11149
+ title: '零售价',
11150
+ width: 140
11151
+ }, {
11152
+ dataIndex: 'memberPrice',
11153
+ title: '会员价',
11154
+ width: 140
11155
+ }];
11156
+ var dateFormat = 'YYYY-MM-DD HH:mm:ss';
11157
+ var GoodsModal$3 = function GoodsModal(props, ref) {
11158
+ var initStartTime = hooks().subtract(1, 'M');
11159
+ var initEndTime = hooks();
11160
+ useImperativeHandle(ref, function () {
11161
+ return {
11162
+ open: function open(shopCode) {
11163
+ setVisible(true);
11164
+ setPageNo(1);
11165
+ setSelect([]);
11166
+ setSelectIds([]);
11167
+ form.setFieldsValue({
11168
+ dateTimePicker: [initStartTime, initEndTime],
11169
+ code: ''
11170
+ });
11171
+ // getShopList();
11172
+ }
11173
+ };
11174
+ });
11175
+
11176
+ var onSubmit = props.onSubmit,
11177
+ shopId = props.shopId,
11178
+ shopList = props.shopList,
11179
+ width = props.width,
11180
+ companyKey = props.companyKey;
11181
+ var _useState = useState(false),
11182
+ _useState2 = _slicedToArray(_useState, 2),
11183
+ visible = _useState2[0],
11184
+ setVisible = _useState2[1];
11185
+ var _useState3 = useState([]),
11186
+ _useState4 = _slicedToArray(_useState3, 2),
11187
+ selectList = _useState4[0],
11188
+ setSelect = _useState4[1];
11189
+ var _useState5 = useState([]),
11190
+ _useState6 = _slicedToArray(_useState5, 2),
11191
+ selectIds = _useState6[0],
11192
+ setSelectIds = _useState6[1];
11193
+ var _useState7 = useState(1),
11194
+ _useState8 = _slicedToArray(_useState7, 2),
11195
+ pageNo = _useState8[0],
11196
+ setPageNo = _useState8[1];
11197
+ var _useState9 = useState(20),
11198
+ _useState10 = _slicedToArray(_useState9, 1),
11199
+ pageSize = _useState10[0];
11200
+ var _useState11 = useState([]),
11201
+ _useState12 = _slicedToArray(_useState11, 2),
11202
+ goodList = _useState12[0],
11203
+ setGoodList = _useState12[1];
11204
+ var _useState13 = useState(false),
11205
+ _useState14 = _slicedToArray(_useState13, 2),
11206
+ loading = _useState14[0],
11207
+ setLoading = _useState14[1];
11208
+ var _useState15 = useState(0),
11209
+ _useState16 = _slicedToArray(_useState15, 2),
11210
+ total = _useState16[0],
11211
+ setTotal = _useState16[1];
11212
+ var displaySelectList = useMemo(function () {
11213
+ return selectList.map(function (item, i) {
11214
+ item.index = i + 1;
11215
+ return item;
11216
+ });
11217
+ }, [selectList]);
11218
+ useEffect(function () {
11219
+ if (visible) {
11220
+ queryItems();
11221
+ }
11222
+ }, [pageNo, visible]);
11223
+ var _Form$useForm = Form.useForm(),
11224
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
11225
+ form = _Form$useForm2[0];
11226
+ //选择页码
11227
+ var pageChange = function pageChange(page) {
11228
+ setPageNo(page);
11229
+ };
11230
+ /**
11231
+ * 查询商品
11232
+ */
11233
+ var queryItems = /*#__PURE__*/function () {
11234
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11235
+ var search,
11236
+ _formData$dateTimePic,
11237
+ _formData$dateTimePic2,
11238
+ _formData$dateTimePic3,
11239
+ _formData$dateTimePic4,
11240
+ _formData$dateTimePic5,
11241
+ _formData$dateTimePic6,
11242
+ formData,
11243
+ startTime,
11244
+ endTime,
11245
+ params,
11246
+ res,
11247
+ _res$data,
11248
+ _res$data$productList,
11249
+ productList,
11250
+ _res$data$total,
11251
+ _total,
11252
+ errorMsg,
11253
+ newProducts,
11254
+ _args = arguments;
11255
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
11256
+ while (1) switch (_context.prev = _context.next) {
11257
+ case 0:
11258
+ search = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
11259
+ _context.prev = 1;
11260
+ setLoading(true);
11261
+ formData = form.getFieldsValue();
11262
+ startTime = ((_formData$dateTimePic = formData.dateTimePicker) === null || _formData$dateTimePic === void 0 ? void 0 : (_formData$dateTimePic2 = _formData$dateTimePic[0]) === null || _formData$dateTimePic2 === void 0 ? void 0 : (_formData$dateTimePic3 = _formData$dateTimePic2.format) === null || _formData$dateTimePic3 === void 0 ? void 0 : _formData$dateTimePic3.call(_formData$dateTimePic2, dateFormat)) || hooks().subtract(1, 'M').format(dateFormat);
11263
+ endTime = ((_formData$dateTimePic4 = formData.dateTimePicker) === null || _formData$dateTimePic4 === void 0 ? void 0 : (_formData$dateTimePic5 = _formData$dateTimePic4[1]) === null || _formData$dateTimePic5 === void 0 ? void 0 : (_formData$dateTimePic6 = _formData$dateTimePic5.format) === null || _formData$dateTimePic6 === void 0 ? void 0 : _formData$dateTimePic6.call(_formData$dateTimePic5, dateFormat)) || hooks().format(dateFormat);
11264
+ params = {
11265
+ // shopCode: shopCode,
11266
+ pageSize: pageSize,
11267
+ pageNo: pageNo - 1,
11268
+ goodNo: search.code,
11269
+ startTime: startTime,
11270
+ endTime: endTime
11271
+ };
11272
+ _context.next = 9;
11273
+ return extendRequest('/qy/gdfw/product/wdtListProduct', {
11274
+ method: 'post',
11275
+ data: params
11276
+ });
11277
+ case 9:
11278
+ res = _context.sent;
11279
+ _res$data = res.data, _res$data$productList = _res$data.productList, productList = _res$data$productList === void 0 ? [] : _res$data$productList, _res$data$total = _res$data.total, _total = _res$data$total === void 0 ? 0 : _res$data$total, errorMsg = _res$data.errorMsg;
11280
+ if (res.success) {
11281
+ newProducts = productList.map(function (item, index) {
11282
+ return _objectSpread2(_objectSpread2({}, item), {}, {
11283
+ index: index + 1
11284
+ });
11285
+ });
11286
+ setGoodList(_toConsumableArray(newProducts));
11287
+ if (pageNo === 1) {
11288
+ setTotal(_total);
11289
+ }
11290
+ } else {
11291
+ setGoodList([]);
11292
+ setTotal(0);
11293
+ message.error(errorMsg || res.message);
11294
+ }
11295
+ case 12:
11296
+ _context.prev = 12;
11297
+ setLoading(false);
11298
+ return _context.finish(12);
11299
+ case 15:
11300
+ case "end":
11301
+ return _context.stop();
11302
+ }
11303
+ }, _callee, null, [[1,, 12, 15]]);
11304
+ }));
11305
+ return function queryItems() {
11306
+ return _ref.apply(this, arguments);
11307
+ };
11308
+ }();
11309
+ var _onCancel = function onCancel() {
11310
+ setVisible(false);
11311
+ };
11312
+ var onOk = function onOk() {
11313
+ onSubmit(selectList);
11314
+ _onCancel();
11315
+ };
11316
+ var onFinish = function onFinish(fieldsValue) {
11317
+ var searchValue = {
11318
+ code: fieldsValue.code
11319
+ };
11320
+ queryItems(searchValue);
11321
+ };
11322
+ var onReset = function onReset() {
11323
+ form.resetFields();
11324
+ form.setFieldsValue({
11325
+ dateTimePicker: [hooks().subtract(1, 'M'), hooks()],
11326
+ code: ''
11327
+ });
11328
+ setPageNo(function (prev) {
11329
+ if (prev === 1 && visible) {
11330
+ queryItems();
11331
+ }
11332
+ return 1;
11333
+ });
11334
+ };
11335
+ // const getShopList = async () => {
11336
+ // const { success, data } = await request('/qy/diamond/getConfigInfo', {
11337
+ // method: 'get',
11338
+ // params: {
11339
+ // key: 'company-third-shop-info',
11340
+ // },
11341
+ // });
11342
+ // const obj: any = JSON.parse(data || '{}');
11343
+ // if (success) {
11344
+ // const list = (obj?.[companyKey] || []).map((item: any) => {
11345
+ // return {
11346
+ // label: item.shopName,
11347
+ // value: item.shopCode,
11348
+ // };
11349
+ // });
11350
+ // setShopList(list);
11351
+ // }
11352
+ // };
11353
+ var onValuesChange = function onValuesChange(changedValues) {
11354
+ if (changedValues === null || changedValues === void 0 ? void 0 : changedValues['shopId']) {
11355
+ queryItems(changedValues === null || changedValues === void 0 ? void 0 : changedValues.shopId);
11356
+ pubsub.publish('changeShopCode', {
11357
+ shopCode: changedValues.shopId
11358
+ });
11359
+ }
11360
+ };
11361
+ var handleDelete = function handleDelete(record, index) {
11362
+ var newSelectList = selectList.filter(function (item) {
11363
+ return item.specId !== record.specId;
11364
+ });
11365
+ setSelect(_toConsumableArray(newSelectList));
11366
+ setSelectIds(_toConsumableArray(newSelectList.map(function (item) {
11367
+ return item.specId;
11368
+ })));
11369
+ };
11370
+ var displaySelectedColumns = [{
11371
+ dataIndex: 'operation',
11372
+ title: '',
11373
+ render: function render(_, record, index) {
11374
+ return /*#__PURE__*/React.createElement(DeleteOutlined, {
11375
+ onClick: function onClick() {
11376
+ return handleDelete(record);
11377
+ }
11378
+ });
11379
+ }
11380
+ }, {
11381
+ dataIndex: 'index',
11382
+ title: 'NO',
11383
+ render: function render(val, record, index) {
11384
+ return /*#__PURE__*/React.createElement("div", {
11385
+ style: {
11386
+ width: 25
11387
+ }
11388
+ }, index + 1);
11389
+ }
11390
+ }];
11391
+ var expandedRowSelection = {
11392
+ fixed: true,
11393
+ selectedRowKeys: selectIds,
11394
+ onSelect: function onSelect(record, selected, selectedRows, nativeEvent) {
11395
+ var tempList = [];
11396
+ if (selected) {
11397
+ tempList = [].concat(_toConsumableArray(selectList), [record]);
11398
+ } else {
11399
+ tempList = selectList.filter(function (item) {
11400
+ return item.specId !== record.specId;
11401
+ });
11402
+ }
11403
+ setSelect(_toConsumableArray(tempList));
11404
+ setSelectIds(_toConsumableArray(tempList.map(function (item) {
11405
+ return item.specId;
11406
+ })));
11407
+ },
11408
+ onSelectAll: function onSelectAll(selected, selectedRows, changeRows) {
11409
+ var tempAllList = [];
11410
+ if (selected) {
11411
+ tempAllList = [].concat(_toConsumableArray(selectList), _toConsumableArray(selectedRows.filter(Boolean)));
11412
+ } else {
11413
+ tempAllList = selectList.filter(function (list) {
11414
+ return changeRows.filter(Boolean).every(function (item) {
11415
+ return list.specId !== item.specId;
11416
+ });
11417
+ });
11418
+ }
11419
+ setSelect(_toConsumableArray(tempAllList));
11420
+ setSelectIds(_toConsumableArray(tempAllList.map(function (item) {
11421
+ return item.specId;
11422
+ })));
11423
+ }
11424
+ };
11425
+ var expandedRowRender = function expandedRowRender(record, index, indent, expanded) {
11426
+ return /*#__PURE__*/React.createElement(Table, {
11427
+ rowKey: 'specId',
11428
+ size: 'small',
11429
+ columns: expandedColumns,
11430
+ dataSource: record.itemDetailList || [],
11431
+ pagination: false,
11432
+ rowSelection: expandedRowSelection,
11433
+ scroll: {
11434
+ x: true
11435
+ }
11436
+ });
11437
+ };
11438
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
11439
+ title: '选择商品',
11440
+ okText: '确认',
11441
+ cancelText: '取消',
11442
+ visible: visible,
11443
+ width: width || 850,
11444
+ onCancel: function onCancel() {
11445
+ _onCancel();
11446
+ },
11447
+ onOk: onOk,
11448
+ wrapClassName: "goodModal"
11449
+ }, /*#__PURE__*/React.createElement(Form, {
11450
+ layout: "inline",
11451
+ form: form,
11452
+ onFinish: onFinish,
11453
+ onValuesChange: onValuesChange,
11454
+ initialValues: {
11455
+ code: ''
11456
+ }
11457
+ }, /*#__PURE__*/React.createElement(Form.Item, {
11458
+ name: "dateTimePicker"
11459
+ }, /*#__PURE__*/React.createElement(RangePicker, {
11460
+ placeholder: ['开始日期', '结束日期'],
11461
+ showTime: true,
11462
+ defaultValue: [hooks(initStartTime.format(dateFormat), dateFormat), hooks(initEndTime.format(dateFormat), dateFormat)]
11463
+ })), /*#__PURE__*/React.createElement(Form.Item, {
11464
+ name: "code"
11465
+ }, /*#__PURE__*/React.createElement(Input, {
11466
+ placeholder: "\u5546\u54C1\u7F16\u7801",
11467
+ allowClear: true,
11468
+ style: {
11469
+ width: 150
11470
+ }
11471
+ })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
11472
+ type: "primary",
11473
+ htmlType: "submit"
11474
+ }, "\u67E5\u8BE2"), /*#__PURE__*/React.createElement(Button, {
11475
+ onClick: onReset
11476
+ }, "\u91CD\u7F6E"))), /*#__PURE__*/React.createElement("div", {
11477
+ style: {
11478
+ marginTop: '16px'
11479
+ }
11480
+ }, /*#__PURE__*/React.createElement(Table, {
11481
+ rowKey: 'goodNo',
11482
+ columns: columns$1,
11483
+ dataSource: goodList,
11484
+ loading: loading,
11485
+ scroll: {
11486
+ x: true,
11487
+ y: 250
11488
+ },
11489
+ expandable: {
11490
+ expandedRowRender: expandedRowRender
11491
+ },
11492
+ pagination: {
11493
+ size: 'small',
11494
+ total: total,
11495
+ current: pageNo,
11496
+ pageSize: pageSize,
11497
+ pageSizeOptions: [],
11498
+ onChange: pageChange
11499
+ }
11500
+ })), !!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, {
11501
+ rowKey: 'specId',
11502
+ columns: [].concat(displaySelectedColumns, expandedColumns),
11503
+ dataSource: displaySelectList,
11504
+ pagination: false,
11505
+ scroll: {
11506
+ x: true,
11507
+ y: 250
11508
+ },
11509
+ style: {
11510
+ width: '100%'
11511
+ }
11512
+ })))));
11513
+ };
11514
+ var WdtGoodsModal = /*#__PURE__*/forwardRef(GoodsModal$3);
11515
+
11073
11516
  // interface GoodsItem {
11074
11517
  // title: string;
11075
11518
  // pic: string;
@@ -11080,6 +11523,7 @@ var GoodsModal$2 = /*#__PURE__*/forwardRef(GoodsModal$1);
11080
11523
  var GoodItem$1 = function GoodItem(props) {
11081
11524
  var _props$value = props.value,
11082
11525
  value = _props$value === void 0 ? [] : _props$value,
11526
+ type = props.type,
11083
11527
  onChange = props.onChange,
11084
11528
  disabled = props.disabled,
11085
11529
  _props$showHeader = props.showHeader,
@@ -11127,105 +11571,214 @@ var GoodItem$1 = function GoodItem(props) {
11127
11571
  onChange === null || onChange === void 0 ? void 0 : onChange(_toConsumableArray(value));
11128
11572
  }
11129
11573
  };
11130
- //商品信息
11131
- var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
11574
+ var COLUMNS_MAP = function COLUMNS_MAP() {
11132
11575
  var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11133
- return [{
11134
- dataIndex: 'mark',
11135
- title: "\u5546\u54C1\u6807\u8BB0",
11136
- align: 'center',
11137
- ellipsis: true,
11138
- width: 70,
11139
- render: function render(val, record, index) {
11140
- return /*#__PURE__*/React.createElement(Select, {
11141
- options: [{
11142
- label: '是',
11143
- value: '是'
11144
- }, {
11145
- label: '否',
11146
- value: '否'
11147
- }],
11148
- disabled: disabled,
11149
- value: val,
11150
- onChange: function onChange(val) {
11151
- return updateHandle(val, index, 'mark');
11152
- }
11153
- });
11154
- }
11155
- }, {
11156
- dataIndex: 'skuName',
11157
- title: "".concat(text, "sku\u540D\u79F0"),
11158
- align: 'center',
11159
- ellipsis: true,
11160
- width: 250
11161
- }, {
11162
- dataIndex: 'sku',
11163
- title: "".concat(text, "sku\u7F16\u7801"),
11164
- align: 'center',
11165
- ellipsis: true,
11166
- width: 100
11167
- }, {
11168
- dataIndex: 'name',
11169
- title: "".concat(text, "\u540D\u79F0"),
11170
- align: 'center',
11171
- ellipsis: true,
11172
- width: 250
11173
- }, {
11174
- dataIndex: 'pic',
11175
- title: "\u56FE\u7247",
11176
- align: 'center',
11177
- ellipsis: true,
11178
- width: 100,
11179
- render: function render(val) {
11180
- return /*#__PURE__*/React.createElement(Image, {
11181
- width: 60,
11182
- src: val
11183
- });
11184
- }
11185
- }, {
11186
- dataIndex: 'code',
11187
- title: "".concat(text, "\u7F16\u7801"),
11188
- align: 'center',
11189
- ellipsis: true,
11190
- width: 100
11191
- }, {
11192
- dataIndex: 'money',
11193
- title: "\u5B9E\u4ED8\u91D1\u989D",
11194
- align: 'center',
11195
- ellipsis: true,
11196
- width: 100
11197
- }, {
11198
- dataIndex: 'number',
11199
- title: "".concat(text, "\u6570\u91CF"),
11200
- align: 'center',
11201
- ellipsis: true,
11202
- width: 100,
11203
- render: function render(val, record, index) {
11204
- return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11205
- style: {
11576
+ return function (type) {
11577
+ var columns = [];
11578
+ switch (type) {
11579
+ case 'WDT_REISSUE_GOODS':
11580
+ case 'WDT_GOODS':
11581
+ columns = [{
11582
+ dataIndex: 'goodId',
11583
+ title: "SPUID",
11584
+ align: 'center',
11585
+ ellipsis: true,
11206
11586
  width: 70
11587
+ }, {
11588
+ dataIndex: 'goodNo',
11589
+ title: "SPU\u5546\u54C1\u7F16\u7801",
11590
+ align: 'center',
11591
+ ellipsis: true,
11592
+ width: 100
11593
+ }, {
11594
+ dataIndex: 'goodName',
11595
+ title: "".concat(text, "\u5546\u54C1\u540D\u79F0"),
11596
+ align: 'center',
11597
+ ellipsis: true,
11598
+ width: 250
11599
+ }, {
11600
+ dataIndex: 'specId',
11601
+ title: "".concat(text, "SKUID"),
11602
+ align: 'center',
11603
+ ellipsis: true,
11604
+ width: 100
11605
+ }, {
11606
+ dataIndex: 'specNo',
11607
+ title: "".concat(text, "sku\u7F16\u7801"),
11608
+ align: 'center',
11609
+ ellipsis: true,
11610
+ width: 100
11611
+ }, {
11612
+ dataIndex: 'specName',
11613
+ title: "".concat(text, "sku\u540D\u79F0"),
11614
+ align: 'center',
11615
+ ellipsis: true,
11616
+ width: 250
11617
+ }, {
11618
+ dataIndex: 'orderPrice',
11619
+ title: "\u5B9E\u4ED8\u603B\u91D1\u989D",
11620
+ align: 'center',
11621
+ ellipsis: true,
11622
+ width: 100
11623
+ }, {
11624
+ dataIndex: 'num',
11625
+ title: "".concat(text, "\u6570\u91CF"),
11626
+ align: 'center',
11627
+ ellipsis: true,
11628
+ width: 100,
11629
+ render: function render(val, record, index) {
11630
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11631
+ style: {
11632
+ width: 70
11633
+ },
11634
+ value: val,
11635
+ min: 0,
11636
+ precision: 0,
11637
+ onChange: function onChange(num) {
11638
+ return updateHandle(num, index, 'num');
11639
+ }
11640
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11641
+ }
11207
11642
  },
11208
- value: val,
11209
- min: 0,
11210
- precision: 0,
11211
- onChange: function onChange(num) {
11212
- return updateHandle(num, index, 'number');
11213
- }
11214
- }) : /*#__PURE__*/React.createElement("span", null, val);
11643
+ // {
11644
+ // dataIndex: 'actualNum',
11645
+ // title: `${text}实发数量`,
11646
+ // align: 'center',
11647
+ // ellipsis: true,
11648
+ // width: 100,
11649
+ // },
11650
+ {
11651
+ dataIndex: 'sharePrice',
11652
+ title: "\u5206\u644A\u4EF7",
11653
+ align: 'center',
11654
+ ellipsis: true,
11655
+ width: 70
11656
+ }, {
11657
+ dataIndex: 'giftType',
11658
+ title: "\u8D60\u54C1\u65B9\u5F0F",
11659
+ align: 'center',
11660
+ ellipsis: true,
11661
+ width: 100,
11662
+ render: function render(val) {
11663
+ var giftTypeMap = {
11664
+ 0: '非赠品',
11665
+ 1: '自动赠送',
11666
+ 2: '手工赠送',
11667
+ 3: '回购自动送赠品',
11668
+ 4: '前N有礼送赠品',
11669
+ 6: '天猫优仓赠品',
11670
+ 7: '淘宝CRM会员送赠'
11671
+ };
11672
+ return /*#__PURE__*/React.createElement("span", null, giftTypeMap[val]);
11673
+ }
11674
+ }];
11675
+ break;
11676
+ default:
11677
+ columns = [{
11678
+ dataIndex: 'mark',
11679
+ title: "\u5546\u54C1\u6807\u8BB0",
11680
+ align: 'center',
11681
+ ellipsis: true,
11682
+ width: 70,
11683
+ render: function render(val, record, index) {
11684
+ return /*#__PURE__*/React.createElement(Select, {
11685
+ options: [{
11686
+ label: '是',
11687
+ value: '是'
11688
+ }, {
11689
+ label: '否',
11690
+ value: '否'
11691
+ }],
11692
+ disabled: disabled,
11693
+ value: val,
11694
+ onChange: function onChange(val) {
11695
+ return updateHandle(val, index, 'mark');
11696
+ }
11697
+ });
11698
+ }
11699
+ }, {
11700
+ dataIndex: 'skuName',
11701
+ title: "".concat(text, "sku\u540D\u79F0"),
11702
+ align: 'center',
11703
+ ellipsis: true,
11704
+ width: 250
11705
+ }, {
11706
+ dataIndex: 'sku',
11707
+ title: "".concat(text, "sku\u7F16\u7801"),
11708
+ align: 'center',
11709
+ ellipsis: true,
11710
+ width: 100
11711
+ }, {
11712
+ dataIndex: 'name',
11713
+ title: "".concat(text, "\u540D\u79F0"),
11714
+ align: 'center',
11715
+ ellipsis: true,
11716
+ width: 250
11717
+ }, {
11718
+ dataIndex: 'pic',
11719
+ title: "\u56FE\u7247",
11720
+ align: 'center',
11721
+ ellipsis: true,
11722
+ width: 100,
11723
+ render: function render(val) {
11724
+ return /*#__PURE__*/React.createElement(Image, {
11725
+ width: 60,
11726
+ src: val
11727
+ });
11728
+ }
11729
+ }, {
11730
+ dataIndex: 'code',
11731
+ title: "".concat(text, "\u7F16\u7801"),
11732
+ align: 'center',
11733
+ ellipsis: true,
11734
+ width: 100
11735
+ }, {
11736
+ dataIndex: 'money',
11737
+ title: "\u5B9E\u4ED8\u91D1\u989D",
11738
+ align: 'center',
11739
+ ellipsis: true,
11740
+ width: 100
11741
+ }, {
11742
+ dataIndex: 'number',
11743
+ title: "".concat(text, "\u6570\u91CF"),
11744
+ align: 'center',
11745
+ ellipsis: true,
11746
+ width: 100,
11747
+ render: function render(val, record, index) {
11748
+ return record.canUpdateNumber && !disabled ? /*#__PURE__*/React.createElement(InputNumber, {
11749
+ style: {
11750
+ width: 70
11751
+ },
11752
+ value: val,
11753
+ min: 0,
11754
+ precision: 0,
11755
+ onChange: function onChange(num) {
11756
+ return updateHandle(num, index, 'number');
11757
+ }
11758
+ }) : /*#__PURE__*/React.createElement("span", null, val);
11759
+ }
11760
+ }, {
11761
+ dataIndex: 'share',
11762
+ title: "\u5206\u644A\u4EF7",
11763
+ align: 'center',
11764
+ ellipsis: true,
11765
+ width: 70
11766
+ }, {
11767
+ dataIndex: 'type',
11768
+ title: "\u8D60\u54C1\u7C7B\u578B",
11769
+ align: 'center',
11770
+ ellipsis: true,
11771
+ width: 100
11772
+ }];
11215
11773
  }
11216
- }, {
11217
- dataIndex: 'share',
11218
- title: "\u5206\u644A\u4EF7",
11219
- align: 'center',
11220
- ellipsis: true,
11221
- width: 70
11222
- }, {
11223
- dataIndex: 'type',
11224
- title: "\u8D60\u54C1\u7C7B\u578B",
11225
- align: 'center',
11226
- ellipsis: true,
11227
- width: 100
11228
- }];
11774
+ return columns;
11775
+ };
11776
+ };
11777
+ //商品信息
11778
+ var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
11779
+ var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
11780
+ var COLUMNS_INFO = COLUMNS_MAP(text);
11781
+ return COLUMNS_INFO(type);
11229
11782
  };
11230
11783
  var newColumns = useMemo(function () {
11231
11784
  var columnList = [{
@@ -11260,30 +11813,43 @@ var GoodItem$1 = function GoodItem(props) {
11260
11813
  return columnList;
11261
11814
  }, [showHeader, value, disabled]);
11262
11815
  var onSubmit = function onSubmit(list) {
11263
- var newList = list.map(function (item) {
11264
- var goodsId = item.goodsId,
11265
- name = item.name,
11266
- code = item.code,
11267
- skuCode = item.skuCode,
11268
- marketPrice = item.marketPrice,
11269
- skuName = item.skuName;
11270
- return {
11271
- id: goodsId,
11272
- mark: '是',
11273
- pic: '',
11274
- skuName: skuName,
11275
- name: name,
11276
- code: code,
11277
- sku: skuCode,
11278
- money: marketPrice || 0,
11279
- share: marketPrice || 0,
11280
- number: 1,
11281
- type: '',
11282
- uuid: uuid(),
11283
- canDelete: true,
11284
- canUpdateNumber: canUpdateNumber
11285
- };
11286
- });
11816
+ var newList = [];
11817
+ if (['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type)) {
11818
+ newList = list.map(function (item) {
11819
+ item.uuid = uuid();
11820
+ item.canDelete = true;
11821
+ item.num = 1;
11822
+ item.orderPrice = 0;
11823
+ item.sharePrice = 0;
11824
+ item.canUpdateNumber = canUpdateNumber;
11825
+ return item;
11826
+ });
11827
+ } else {
11828
+ newList = list.map(function (item) {
11829
+ var goodsId = item.goodsId,
11830
+ name = item.name,
11831
+ code = item.code,
11832
+ skuCode = item.skuCode,
11833
+ marketPrice = item.marketPrice,
11834
+ skuName = item.skuName;
11835
+ return {
11836
+ id: goodsId,
11837
+ mark: '是',
11838
+ pic: '',
11839
+ skuName: skuName,
11840
+ name: name,
11841
+ code: code,
11842
+ sku: skuCode,
11843
+ money: marketPrice || 0,
11844
+ share: marketPrice || 0,
11845
+ number: 1,
11846
+ type: '',
11847
+ uuid: uuid(),
11848
+ canDelete: true,
11849
+ canUpdateNumber: canUpdateNumber
11850
+ };
11851
+ });
11852
+ }
11287
11853
  onChange === null || onChange === void 0 ? void 0 : onChange([].concat(_toConsumableArray(value), _toConsumableArray(newList)));
11288
11854
  };
11289
11855
  var onSelectChange = function onSelectChange(newSelectedRowKeys) {
@@ -11326,7 +11892,15 @@ var GoodItem$1 = function GoodItem(props) {
11326
11892
  locale: {
11327
11893
  emptyText: '暂无数据'
11328
11894
  }
11329
- })), /*#__PURE__*/React.createElement(GoodsModal$2, {
11895
+ })), ['WDT_REISSUE_GOODS', 'WDT_GOODS'].includes(type) ? /*#__PURE__*/React.createElement(WdtGoodsModal, {
11896
+ ref: refModal,
11897
+ onSubmit: onSubmit,
11898
+ width: width,
11899
+ shopList: shopList,
11900
+ shopId: shopId,
11901
+ maxLength: maxLength,
11902
+ companyKey: companyKey
11903
+ }) : /*#__PURE__*/React.createElement(GoodsModal$2, {
11330
11904
  ref: refModal,
11331
11905
  onSubmit: onSubmit,
11332
11906
  width: width,
@@ -11707,25 +12281,60 @@ var BsExchange = function BsExchange(props) {
11707
12281
  }))) : null);
11708
12282
  };
11709
12283
 
11710
- var _excluded$e = ["value", "onChange", "reasonList", "disabled"];
12284
+ var _excluded$e = ["value", "onChange", "reasonList", "disabled", "type"];
12285
+ var typeMap = {
12286
+ BS_REISSUE_GOODS: {
12287
+ key: 'bsReissueGoods',
12288
+ name: 'bs',
12289
+ typeName: 'bsReissueType',
12290
+ reissueSelectList: 'reissueSelectList',
12291
+ reissueSelectListReturn: 'reissueSelectListReturn',
12292
+ reissueDeleteGood: 'reissueDeleteGood',
12293
+ changeShopCode: 'changeShopCode',
12294
+ reissueType: 'reissueType',
12295
+ formatDefaultField: {
12296
+ money: 'money',
12297
+ share: 'share'
12298
+ }
12299
+ },
12300
+ WDT_REISSUE_GOODS: {
12301
+ key: 'wdtReissueGoods',
12302
+ name: '旺店通',
12303
+ typeName: 'wdtReissueType',
12304
+ reissueSelectList: 'wdtReissueSelectList',
12305
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12306
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12307
+ changeShopCode: 'wdtChangeShopCode',
12308
+ reissueType: 'wdtReissueType',
12309
+ formatDefaultField: {
12310
+ money: 'orderPrice',
12311
+ share: 'sharePrice'
12312
+ }
12313
+ }
12314
+ };
11711
12315
  var BsReissue = function BsReissue(props) {
12316
+ var _typeMap$type20, _typeMap$type21, _typeMap$type22;
11712
12317
  var value = props.value,
11713
12318
  onChange = props.onChange,
11714
12319
  _props$reasonList = props.reasonList,
11715
12320
  reasonList = _props$reasonList === void 0 ? [] : _props$reasonList,
11716
12321
  disabled = props.disabled,
12322
+ type = props.type,
11717
12323
  other = _objectWithoutProperties(props, _excluded$e);
11718
12324
  var valueRef = useRef({});
11719
12325
  useEffect(function () {
11720
- pubsub.subscribe('reissueSelectList', function (_, data) {
12326
+ var _typeMap$type;
12327
+ 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) {
12328
+ var _typeMap$type2;
11721
12329
  // console.log('reissueSelectList', data);
11722
12330
  if (disabled) return;
11723
12331
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11724
12332
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11725
12333
  });
11726
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11727
- item.money = 0;
11728
- item.share = 0;
12334
+ 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) {
12335
+ var _typeMap$type3, _typeMap$type4;
12336
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type3 = typeMap[type]) === null || _typeMap$type3 === void 0 ? void 0 : _typeMap$type3.formatDefaultField.money)] = 0;
12337
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type4 = typeMap[type]) === null || _typeMap$type4 === void 0 ? void 0 : _typeMap$type4.formatDefaultField.share)] = 0;
11729
12338
  item.canUpdateNumber = true;
11730
12339
  return item;
11731
12340
  });
@@ -11733,15 +12342,18 @@ var BsReissue = function BsReissue(props) {
11733
12342
  });
11734
12343
  }, []);
11735
12344
  useEffect(function () {
11736
- pubsub.subscribe('reissueSelectListReturn', function (_, data) {
12345
+ var _typeMap$type5;
12346
+ pubsub.subscribe("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type5 = typeMap[type]) === null || _typeMap$type5 === void 0 ? void 0 : _typeMap$type5.reissueSelectListReturn), function (_, data) {
12347
+ var _typeMap$type6;
11737
12348
  // console.log('reissueSelectListReturn', data);
11738
12349
  if (disabled) return;
11739
12350
  var newValue = _objectSpread2(_objectSpread2({}, data.goodValue), {}, {
11740
12351
  shopCode: data === null || data === void 0 ? void 0 : data.shopCode
11741
12352
  });
11742
- newValue.bsReissueGoods = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
11743
- item.money = 0;
11744
- item.share = 0;
12353
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type6 = typeMap[type]) === null || _typeMap$type6 === void 0 ? void 0 : _typeMap$type6.key)] = data === null || data === void 0 ? void 0 : data.list.map(function (item) {
12354
+ var _typeMap$type7, _typeMap$type8;
12355
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type7 = typeMap[type]) === null || _typeMap$type7 === void 0 ? void 0 : _typeMap$type7.formatDefaultField.money)] = 0;
12356
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type8 = typeMap[type]) === null || _typeMap$type8 === void 0 ? void 0 : _typeMap$type8.formatDefaultField.share)] = 0;
11745
12357
  item.canUpdateNumber = true;
11746
12358
  return item;
11747
12359
  });
@@ -11749,50 +12361,55 @@ var BsReissue = function BsReissue(props) {
11749
12361
  });
11750
12362
  }, []);
11751
12363
  useEffect(function () {
12364
+ var _typeMap$type9, _typeMap$type12;
11752
12365
  valueRef.current = value;
11753
- pubsub.subscribeOnce('reissueDeleteGood', function (_, data) {
12366
+ pubsub.subscribeOnce("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type9 = typeMap[type]) === null || _typeMap$type9 === void 0 ? void 0 : _typeMap$type9.reissueDeleteGood), function (_, data) {
11754
12367
  if (disabled) return;
11755
12368
  if (value) {
12369
+ var _typeMap$type10, _typeMap$type11;
11756
12370
  var newValue = _objectSpread2({}, value);
11757
- newValue.bsReissueGoods = newValue.bsReissueGoods.filter(function (item) {
12371
+ newValue["".concat((_typeMap$type10 = typeMap[type]) === null || _typeMap$type10 === void 0 ? void 0 : _typeMap$type10.key)] = newValue === null || newValue === void 0 ? void 0 : newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type11 = typeMap[type]) === null || _typeMap$type11 === void 0 ? void 0 : _typeMap$type11.key)].filter(function (item) {
11758
12372
  return item.sku !== data;
11759
12373
  });
11760
12374
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11761
12375
  }
11762
12376
  });
11763
- pubsub.subscribeOnce('changeShopCode', function (type, data) {
12377
+ pubsub.subscribeOnce("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type12 = typeMap[type]) === null || _typeMap$type12 === void 0 ? void 0 : _typeMap$type12.changeShopCode), function (type, data) {
11764
12378
  onChange(_objectSpread2(_objectSpread2({}, value), {}, {
11765
12379
  shopCode: data.shopCode
11766
12380
  }));
11767
12381
  });
11768
12382
  }, [value, disabled]);
11769
12383
  var changeTypeHandle = function changeTypeHandle(val) {
12384
+ var _typeMap$type13, _typeMap$type14, _typeMap$type15;
11770
12385
  var newValue = _objectSpread2({}, value);
11771
- newValue['bsReissueType'] = val;
11772
- newValue.bsReissueGoods = [];
12386
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type13 = typeMap[type]) === null || _typeMap$type13 === void 0 ? void 0 : _typeMap$type13.typeName)] = val;
12387
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type14 = typeMap[type]) === null || _typeMap$type14 === void 0 ? void 0 : _typeMap$type14.key)] = [];
11773
12388
  if (['2', '4'].includes(val[0])) {
11774
12389
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11775
12390
  valueRef.current = newValue;
11776
12391
  }
11777
- pubsub.publish('reissueType', {
12392
+ pubsub.publish("".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type15 = typeMap[type]) === null || _typeMap$type15 === void 0 ? void 0 : _typeMap$type15.reissueType), {
11778
12393
  val: val[0],
11779
12394
  goodValue: newValue
11780
12395
  });
11781
12396
  };
11782
12397
  var changeGoodHandle = function changeGoodHandle(val) {
12398
+ var _typeMap$type16;
11783
12399
  var newValue = _objectSpread2({}, value);
11784
- newValue['bsReissueGoods'] = (val || []).map(function (item) {
11785
- item.money = 0;
11786
- item.share = 0;
12400
+ newValue["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type16 = typeMap[type]) === null || _typeMap$type16 === void 0 ? void 0 : _typeMap$type16.key)] = (val || []).map(function (item) {
12401
+ var _typeMap$type17, _typeMap$type18;
12402
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type17 = typeMap[type]) === null || _typeMap$type17 === void 0 ? void 0 : _typeMap$type17.formatDefaultField.money)] = 0;
12403
+ item["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type18 = typeMap[type]) === null || _typeMap$type18 === void 0 ? void 0 : _typeMap$type18.formatDefaultField.share)] = 0;
11787
12404
  return item;
11788
12405
  });
11789
12406
  onChange === null || onChange === void 0 ? void 0 : onChange(newValue);
11790
12407
  };
11791
12408
  //显示选择商品按钮 原单换不显示选择商品
11792
12409
  var showChangeBtn = useMemo(function () {
11793
- var _value$bsReissueType;
11794
- 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]);
11795
- }, [value === null || value === void 0 ? void 0 : value.bsReissueType]);
12410
+ var _value, _typeMap$type19;
12411
+ return ['2', '3', '4'].includes(value === null || value === void 0 ? void 0 : (_value = value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type19 = typeMap[type]) === null || _typeMap$type19 === void 0 ? void 0 : _typeMap$type19.typeName)]) === null || _value === void 0 ? void 0 : _value[0]);
12412
+ }, [value === null || value === void 0 ? void 0 : value[(_typeMap$type20 = typeMap[type]) === null || _typeMap$type20 === void 0 ? void 0 : _typeMap$type20.typeName]]);
11796
12413
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Cascader, {
11797
12414
  style: {
11798
12415
  marginBottom: '8px'
@@ -11800,18 +12417,19 @@ var BsReissue = function BsReissue(props) {
11800
12417
  disabled: disabled,
11801
12418
  allowClear: false,
11802
12419
  options: reasonList,
11803
- value: value === null || value === void 0 ? void 0 : value.bsReissueType,
12420
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type21 = typeMap[type]) === null || _typeMap$type21 === void 0 ? void 0 : _typeMap$type21.typeName)],
11804
12421
  onChange: function onChange(val) {
11805
12422
  return changeTypeHandle(val);
11806
12423
  }
11807
12424
  }), /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
11808
12425
  key: 'reissueGoods'
11809
12426
  }, other), {}, {
12427
+ type: type,
11810
12428
  disabled: disabled,
11811
12429
  canUpdateNumber: showChangeBtn,
11812
12430
  showChangeBtn: showChangeBtn,
11813
12431
  shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
11814
- value: value === null || value === void 0 ? void 0 : value.bsReissueGoods,
12432
+ value: value === null || value === void 0 ? void 0 : value["".concat(typeMap === null || typeMap === void 0 ? void 0 : (_typeMap$type22 = typeMap[type]) === null || _typeMap$type22 === void 0 ? void 0 : _typeMap$type22.key)],
11815
12433
  onChange: function onChange(val) {
11816
12434
  return changeGoodHandle(val);
11817
12435
  }
@@ -11923,6 +12541,10 @@ var columnsNameMap = {
11923
12541
  WLN_SYSTEM_ORDER: {
11924
12542
  typeName: '订单类型',
11925
12543
  tagName: '标记'
12544
+ },
12545
+ WDT_SYSTEM_ORDER: {
12546
+ typeName: '订单类型',
12547
+ tagName: '订单标签'
11926
12548
  }
11927
12549
  };
11928
12550
  var index$1 = (function (props) {
@@ -11937,6 +12559,8 @@ var index$1 = (function (props) {
11937
12559
  getOrderList(value.orderNo);
11938
12560
  } else if (type === 'WLN_SYSTEM_ORDER') {
11939
12561
  getWlnOrderList(value.orderNo);
12562
+ } else if (type === 'WDT_SYSTEM_ORDER') {
12563
+ getWdtOrderList(value.orderNo);
11940
12564
  }
11941
12565
  }
11942
12566
  }, [value, type]);
@@ -12037,6 +12661,51 @@ var index$1 = (function (props) {
12037
12661
  return _ref2.apply(this, arguments);
12038
12662
  };
12039
12663
  }();
12664
+ var getWdtOrderList = /*#__PURE__*/function () {
12665
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(orderNo) {
12666
+ var _yield$request3, success, data;
12667
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
12668
+ while (1) switch (_context3.prev = _context3.next) {
12669
+ case 0:
12670
+ _context3.next = 2;
12671
+ return extendRequest('/qy/gdfw/order/wdtOrderDetail', {
12672
+ method: 'post',
12673
+ data: {
12674
+ billNo: orderNo
12675
+ }
12676
+ });
12677
+ case 2:
12678
+ _yield$request3 = _context3.sent;
12679
+ success = _yield$request3.success;
12680
+ data = _yield$request3.data;
12681
+ if (success) {
12682
+ _onChange(_objectSpread2(_objectSpread2({}, value), {}, {
12683
+ orders: ((data === null || data === void 0 ? void 0 : data.trades) || []).map(function (item) {
12684
+ return _objectSpread2(_objectSpread2({}, item), {}, {
12685
+ billNo: item.tradeNo,
12686
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
12687
+ billTag: item.tagName
12688
+ });
12689
+ }),
12690
+ showOrderInfo: data === null || data === void 0 ? void 0 : data.trades.map(function (item) {
12691
+ return {
12692
+ billNo: item.tradeNo,
12693
+ billType: WDT_ORDER_TYPE_MAP[item.tradeType],
12694
+ billTag: item.tagName
12695
+ };
12696
+ })
12697
+ }));
12698
+ }
12699
+ case 6:
12700
+ case "end":
12701
+ return _context3.stop();
12702
+ }
12703
+ }, _callee3);
12704
+ }));
12705
+ return function getWdtOrderList(_x3) {
12706
+ return _ref3.apply(this, arguments);
12707
+ };
12708
+ }();
12040
12709
  var rowSelection = {
12041
12710
  selectedRowKeys: (value === null || value === void 0 ? void 0 : value.selectIds) || [],
12042
12711
  fixed: true,
@@ -12091,13 +12760,165 @@ var WlnGoods = function WlnGoods(props) {
12091
12760
  }));
12092
12761
  };
12093
12762
 
12763
+ var componentMap$1 = {
12764
+ 'WDT_GOODS': {
12765
+ type: 'wdt',
12766
+ key: 'wdtGoods',
12767
+ name: '旺店通',
12768
+ eventNameMap: {
12769
+ type: 'wdtType',
12770
+ selectListReturn: 'wdtSelectListReturn',
12771
+ selectList: 'wdtSelectList',
12772
+ reissueSelectList: 'wdtReissueSelectList',
12773
+ reissueSelectListReturn: 'wdtReissueSelectListReturn',
12774
+ reissueDeleteGood: 'wdtReissueDeleteGood',
12775
+ changeShopCode: 'wdtChangeShopCode',
12776
+ reissueType: 'wdtReissueType',
12777
+ returnType: 'wdtReturnType',
12778
+ returnSelectListReturn: 'wdtReturnSelectListReturn',
12779
+ deleteGood: 'wdtDeleteGood',
12780
+ returnDeleteGood: 'wdtReturnDeleteGood'
12781
+ }
12782
+ }
12783
+ };
12784
+ var CommonGoods = function CommonGoods(props) {
12785
+ var _withInfo$current3, _withInfo$current4;
12786
+ var value = props.value,
12787
+ disabled = props.disabled,
12788
+ onChange = props.onChange,
12789
+ compType = props.type;
12790
+ var _useState = useState(false),
12791
+ _useState2 = _slicedToArray(_useState, 2),
12792
+ tableSelect = _useState2[0],
12793
+ setTableSelect = _useState2[1];
12794
+ var withInfo = useRef(null);
12795
+ var valueRef = useRef(null);
12796
+ useEffect(function () {
12797
+ valueRef.current = value;
12798
+ }, [value]);
12799
+ useEffect(function () {
12800
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.type, function (type, data) {
12801
+ if (disabled) return;
12802
+ // console.log(type, data);
12803
+ withInfo.current = {
12804
+ type: type,
12805
+ val: data.val,
12806
+ goodValue: data.goodValue
12807
+ };
12808
+ setTableSelect(['2', '4'].includes(data.val));
12809
+ if (['1', '3'].includes(data.val)) {
12810
+ var _valueRef$current, _valueRef$current2;
12811
+ pubsub.publish(componentMap$1[compType].eventNameMap.selectListReturn, {
12812
+ 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]) || []),
12813
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current2 = valueRef.current) === null || _valueRef$current2 === void 0 ? void 0 : _valueRef$current2.shopCode,
12814
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12815
+ });
12816
+ }
12817
+ });
12818
+ //补发
12819
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.reissueType, function (type, data) {
12820
+ if (disabled) return;
12821
+ withInfo.current = {
12822
+ type: type,
12823
+ val: data.val,
12824
+ goodValue: data.goodValue
12825
+ };
12826
+ setTableSelect(['2', '4'].includes(data.val));
12827
+ if (['1', '3'].includes(data.val)) {
12828
+ var _valueRef$current3, _valueRef$current4;
12829
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueSelectListReturn, {
12830
+ 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]) || []),
12831
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current4 = valueRef.current) === null || _valueRef$current4 === void 0 ? void 0 : _valueRef$current4.shopCode,
12832
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12833
+ });
12834
+ }
12835
+ });
12836
+ //退货
12837
+ pubsub.subscribe(componentMap$1[compType].eventNameMap.returnType, function (type, data) {
12838
+ if (disabled) return;
12839
+ withInfo.current = {
12840
+ type: type,
12841
+ val: data.val,
12842
+ goodValue: data.goodValue
12843
+ };
12844
+ setTableSelect(['2', '4'].includes(data.val));
12845
+ if (['1', '3'].includes(data.val)) {
12846
+ var _valueRef$current5, _valueRef$current6;
12847
+ pubsub.publish(componentMap$1[type].eventNameMap.returnSelectListReturn, {
12848
+ 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]) || []),
12849
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current6 = valueRef.current) === null || _valueRef$current6 === void 0 ? void 0 : _valueRef$current6.shopCode,
12850
+ goodValue: data === null || data === void 0 ? void 0 : data.goodValue
12851
+ });
12852
+ }
12853
+ });
12854
+ pubsub.subscribeOnce(componentMap$1[compType].eventNameMap.changeShopCode, function (type, data) {
12855
+ // console.log(data);
12856
+ onChange(_objectSpread2(_objectSpread2({}, valueRef === null || valueRef === void 0 ? void 0 : valueRef.current), {}, {
12857
+ shopCode: data.shopCode
12858
+ }));
12859
+ });
12860
+ return function () {
12861
+ pubsub.clearAllSubscriptions();
12862
+ };
12863
+ }, [disabled]);
12864
+ var _onSelect = function onSelect(list) {
12865
+ var _withInfo$current, _withInfo$current2, _valueRef$current7;
12866
+ if (disabled) return;
12867
+ var newList = cloneDeep(list);
12868
+ var typeMap = _defineProperty({
12869
+ // type: componentMap[compType].eventNameMap.selectList,
12870
+ // returnType: componentMap[compType].eventNameMap.returnSelectList,
12871
+ // reissueType: componentMap[compType].eventNameMap.reissueSelectList,
12872
+ type: componentMap$1[compType].eventNameMap.selectList
12873
+ }, "".concat(componentMap$1[compType].type, "ReissueType"), componentMap$1[compType].eventNameMap.reissueSelectList);
12874
+ var type = typeMap[(_withInfo$current = withInfo.current) === null || _withInfo$current === void 0 ? void 0 : _withInfo$current.type];
12875
+ // console.log('onSelect', type, withInfo.current, newList);
12876
+ pubsub.publish(type, {
12877
+ type: (_withInfo$current2 = withInfo.current) === null || _withInfo$current2 === void 0 ? void 0 : _withInfo$current2.val,
12878
+ list: newList.map(function (item) {
12879
+ item.canDelete = true;
12880
+ return item;
12881
+ }),
12882
+ shopCode: valueRef === null || valueRef === void 0 ? void 0 : (_valueRef$current7 = valueRef.current) === null || _valueRef$current7 === void 0 ? void 0 : _valueRef$current7.shopCode,
12883
+ goodValue: withInfo.current.goodValue
12884
+ });
12885
+ };
12886
+ var _onDelete = function onDelete(item) {
12887
+ var deleteId = item === null || item === void 0 ? void 0 : item.specId;
12888
+ pubsub.publish(componentMap$1[compType].eventNameMap.deleteGood, deleteId);
12889
+ pubsub.publish(componentMap$1[compType].eventNameMap.reissueDeleteGood, deleteId);
12890
+ pubsub.publish(componentMap$1[compType].eventNameMap.returnDeleteGood, deleteId);
12891
+ };
12892
+ var changeHandle = function changeHandle(list) {
12893
+ onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, _defineProperty({}, componentMap$1[compType].key, list)));
12894
+ };
12895
+ return /*#__PURE__*/React.createElement(GoodItem$1, _objectSpread2(_objectSpread2({
12896
+ key: componentMap$1[compType].key
12897
+ }, props), {}, {
12898
+ disabled: disabled,
12899
+ value: value === null || value === void 0 ? void 0 : value[componentMap$1[compType].key],
12900
+ shopCode: value === null || value === void 0 ? void 0 : value.shopCode,
12901
+ 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),
12902
+ selectType: withInfo === null || withInfo === void 0 ? void 0 : (_withInfo$current4 = withInfo.current) === null || _withInfo$current4 === void 0 ? void 0 : _withInfo$current4.type,
12903
+ onSelect: function onSelect(list) {
12904
+ return _onSelect(list);
12905
+ },
12906
+ onDelete: function onDelete(item) {
12907
+ return _onDelete(item);
12908
+ },
12909
+ onChange: function onChange(val) {
12910
+ return changeHandle(val);
12911
+ }
12912
+ }));
12913
+ };
12914
+
12094
12915
  var css_248z$a = ".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";
12095
12916
  styleInject(css_248z$a);
12096
12917
 
12097
12918
  var TabPane$1 = Tabs.TabPane;
12098
12919
  var Option$2 = Select.Option;
12099
12920
  var Search$1 = Input.Search;
12100
- var GoodsModal$3 = function GoodsModal(props) {
12921
+ var GoodsModal$4 = function GoodsModal(props) {
12101
12922
  var onSubmit = props.onSubmit,
12102
12923
  _onCancel = props.onCancel,
12103
12924
  visible = props.visible,
@@ -12548,7 +13369,7 @@ var Goods$1 = function Goods(props, ref) {
12548
13369
  };
12549
13370
  return /*#__PURE__*/React.createElement("div", {
12550
13371
  className: "goodsBox"
12551
- }, /*#__PURE__*/React.createElement(GoodsModal$3, {
13372
+ }, /*#__PURE__*/React.createElement(GoodsModal$4, {
12552
13373
  visible: visible,
12553
13374
  onSubmit: onSubmit,
12554
13375
  type: type,
@@ -12853,4 +13674,4 @@ var CalculationInput = function CalculationInput(props) {
12853
13674
  }, config === null || config === void 0 ? void 0 : config.unit));
12854
13675
  };
12855
13676
 
12856
- 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 };
13677
+ 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 };